Commit 702705f6 by Masaru Abe

閲覧ログが二重で記録される問題対応

parent 142e3a9d
......@@ -906,7 +906,7 @@ AVWEB.avwSetLogoutNortice = function() {
if( "CONTENTVIEW_GENERAL" in window ){
if(CONTENTVIEW_GENERAL.contentID != null ){
COMMON.SetEndLog(CONTENTVIEW_GENERAL.contentID);
COMMON.RegisterLog();
COMMON.RegisterLog(true);
}
}
} else {
......
......@@ -8,6 +8,8 @@
//グローバルの名前空間用のオブジェクトを用意する
var COMMON = {};
COMMON.registerLogBusyFlag = false;
COMMON.resourceVersionArr = [];
COMMON.metaVersionArr = [];
......@@ -2490,14 +2492,23 @@ COMMON.SetObjectLogActionTime = function( strContentId, objectId, actionTime ){
/*
Register reading log of content to server by calling api
*/
COMMON.RegisterLog = function(is) {
var arrContentLogs = ClientData.ContentLogData();
var isError = false;
COMMON.RegisterLog = function(isUnload) {
for (var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
var dateEnd = new Date(arrContentLogs[nIndex].readingEndDate);
var dateStart = new Date(arrContentLogs[nIndex].readingStartDate);
if(isUnload == null){
isUnload = false;
}
var arrContentLogs = ClientData.ContentLogData();
//ブラウザ閉じる場合は重複を回避するためログデータ先に削除
if(isUnload){
ClientData.ContentLogData([]);
}
var isError = false;
for (var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
var dateEnd = new Date(arrContentLogs[nIndex].readingEndDate);
var dateStart = new Date(arrContentLogs[nIndex].readingStartDate);
//ページログJSONデータの作成
var pageLogJson = "";
......@@ -2646,6 +2657,7 @@ COMMON.RegisterLog = function(is) {
}
);
};
if (AVWEB.avwHasError()) {
return;
}
......@@ -2662,6 +2674,7 @@ COMMON.RegisterLog = function(is) {
}
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