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,14 +2492,23 @@ COMMON.SetObjectLogActionTime = function( strContentId, objectId, actionTime ){ ...@@ -2490,14 +2492,23 @@ 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) {
var arrContentLogs = ClientData.ContentLogData();
var isError = false;
for (var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) { if(isUnload == null){
var dateEnd = new Date(arrContentLogs[nIndex].readingEndDate); isUnload = false;
var dateStart = new Date(arrContentLogs[nIndex].readingStartDate); }
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データの作成 //ページログJSONデータの作成
var pageLogJson = ""; var pageLogJson = "";
...@@ -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