File: /www/wwwroot/m.wfehn.com/static/js/monitor.js
(function () {
var nowToken = ''
var monitorTimer = setInterval(function () {
var tokenList = {};
var list = document.cookie.split(';');
list.forEach(str => {
var kv = str.split('=');
tokenList[kv[0].trim()] = kv[1].trim()
})
var xToken = tokenList['X-Token'];
if (!xToken) {
nowToken = "11111111111111111111111111"
// clearInterval(monitorTimer)
// console.log('没有token,即将跳转登录页');
// window.location.href = 'https://preconsole.marketingforce.com';
} else {
if (!nowToken) {
nowToken = xToken
} else if (nowToken != xToken) {
clearInterval(monitorTimer)
if (wm_token_change_status_func) {
wm_token_change_status_func(() => {
window.location.href = `${(new URL(window.location.href)).origin}/`
})
} else {
window.location.href = `${(new URL(window.location.href)).origin}/`
}
}
}
}, 1000);
})();