Commit 702705f6 by Masaru Abe

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

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