This commit is contained in:
java110 2022-04-02 16:09:34 +08:00
commit 5ccde634c7

View File

@ -15,6 +15,8 @@ import {
import url from '../../../constant/url.js'
import {addMinutes} from "../utils/DateUtil.js"
export function pageOnLoad(options) {
let _key = options.key;
if (isNotNull(_key)) {
@ -28,11 +30,31 @@ export function pageOnLoad(options) {
getPageWAppId(options);
if (isNull(_key)) {
doPageCheckSession(window.location.href,window.location.href,function(){});
onLoadHasAuth();
}
}
export function onLoadHasAuth(){
let _url = window.location.href;
// if(_url.indexOf('hasLoaded')>-1){
// return;
// }
// _url = _url.indexOf("?")> -1 ?(_url+"&hasLoaded=ON"):(_url+"?hasLoaded=ON")
let _hasLoadedObj = uni.getStorageSync("_hasLoadedObj");
let nowDate = new Date();
if (_hasLoadedObj && _hasLoadedObj.expireTime > nowDate.getTime()) {
return ;
}
uni.setStorageSync("_hasLoadedObj",{
expireTime:addMinutes(new Date(),15).getTime()
});
doPageCheckSession(_url,'',function(){});
}
/**
* H5 自登陆处理
* @param {Object} _key 自登陆key