Commit f2b15311 by Masaru Abe

閲覧ログ送信 1件でも送信失敗した場合PC側にバッファされている全ての閲覧ログが残り再送信され続ける問題修正

parent ba5c1c73
...@@ -2551,11 +2551,23 @@ function RegisterLog() { ...@@ -2551,11 +2551,23 @@ function RegisterLog() {
pageLog: pageLogJson, pageLog: pageLogJson,
objectLog: objectLogJson objectLog: objectLogJson
}; };
//API送信結果判定
arrContentLogs[nIndex].sendResult = false;
avwCmsApiSync(ClientData.userInfo_accountPath(), "contentReadingLog", 'post', params, avwCmsApiSync(ClientData.userInfo_accountPath(), "contentReadingLog", 'post', params,
null, function (data) {
if (data.result == 'success') {
//成功したログは削除
arrContentLogs[nIndex].sendResult = true;
}
},
function (xhr, b, c) { function (xhr, b, c) {
if (xhr.status != 0) { if (xhr.status != 0) {
isError = true; isError = true;
var xhrData = JSON.parse(xhr.responseText);
if ( xhrData && xhrData.httpStatus == 500 ) {
//なんらか不正なデータなので送信成功にして捨てる
arrContentLogs[nIndex].sendResult = true;
}
} }
else { else {
showSystemError(); showSystemError();
...@@ -2568,6 +2580,15 @@ function RegisterLog() { ...@@ -2568,6 +2580,15 @@ function RegisterLog() {
// Clear logs in local // Clear logs in local
if (!isError) { if (!isError) {
ClientData.ContentLogData([]); ClientData.ContentLogData([]);
} else {
//送信成功したログは削除
var arrTarget = [];
for (var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
if( arrContentLogs[nIndex].sendResult == false ){
arrTarget.push(arrContentLogs[nIndex]);
}
}
ClientData.ContentLogData(arrTarget);
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment