超时后无法的问题

This commit is contained in:
wuxw 2020-02-26 20:02:22 +08:00
parent df0724cfb9
commit 054d57dbf7
3 changed files with 8 additions and 5 deletions

View File

@ -4,8 +4,8 @@
* add by wuxw 2019-12-28
*/
// 服务器域名
const baseUrl = 'https://app.demo.winqi.cn/';
//const baseUrl = '/';
//const baseUrl = 'https://app.demo.winqi.cn/';
const baseUrl = '/';
const hcBaseUrl = 'https://hc.demo.winqi.cn'; // 登录接口
const loginUrl = baseUrl + 'app/loginProperty';

View File

@ -26,6 +26,7 @@ class LoginFactory {
let nowDate = new Date();
if (loginFlag && loginFlag.expireTime > nowDate.getTime()) {
console.log("现在还是有效时间内");
callback();
} else {
// 无登录态
@ -62,7 +63,7 @@ class LoginFactory {
let _userInfo = JSON.parse(util.des.desDecrypt(userInfo));
let _tmpUserInfo = {
userName:_userInfo.userName,
username:_userInfo.userName,
password:_userInfo.password
}
@ -81,7 +82,8 @@ class LoginFactory {
let afterOneHourDate = util.date.addHour(new Date(),1);
wx.setStorageSync(constant.mapping.LOGIN_FLAG, {
sessionKey: userInfo.userName,
expireTime: afterOneHourDate.getTime()
expireTime: afterOneHourDate.getTime(),
createTime: new Date().getTime()
});
wx.setStorageSync(constant.mapping.TOKEN, res.token);
callback();

View File

@ -98,7 +98,8 @@
let afterOneHourDate = _that.java110Util.date.addHour(new Date(), 1);
wx.setStorageSync(_that.java110Constant.mapping.LOGIN_FLAG, {
sessionKey: _tmpUserInfo.userName,
expireTime: afterOneHourDate.getTime()
expireTime: afterOneHourDate.getTime(),
createTime: new Date().getTime()
});
uni.switchTab({
url: "/pages/index/index"