diff --git a/constant/UrlConstant.js b/constant/UrlConstant.js index 34456d0..25c2286 100644 --- a/constant/UrlConstant.js +++ b/constant/UrlConstant.js @@ -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'; diff --git a/factory/LoginFactory.js b/factory/LoginFactory.js index c02d773..90aa14d 100644 --- a/factory/LoginFactory.js +++ b/factory/LoginFactory.js @@ -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(); diff --git a/pages/login/login.vue b/pages/login/login.vue index fc41db4..cff3350 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -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"