document.cookie = “userJurisdiction=” + ‘true’;
页面进入的时候,用户权限为true
window.addEventListener(‘beforeunload’, function (){
document.cookie = “userJurisdiction=” + null;
}, false)
页面关闭的时候吧cookie的值改为null
完整代码
window.监听用户是否关闭了页面
window.addEventListener(‘beforeunload’, function (){
document.cookie = “userJurisdiction=” + null;
}, false)
//发给后台请求
Xym.getRequest({},’/后台地址’,function(data){
根据后台返回的值是否为true指向下一步
if(data.linkShopInformation == true) {
**存取cookie**
document.cookie = "userJieurisdiction=" + 'true';
if(getCookie("userJurisdiction")=='true'){
addTab('/跳转页面地址/','完善信息')
}
}