unknown
1 year ago
11 changed files with 176 additions and 29 deletions
-
3common/js/mixins.js
-
8config/api.js
-
35config/request.js
-
13config/utils.js
-
60pages/carEntry/simulateAppointment/comp/step1.vue
-
23pages/mineEntry/personaInfo/personaInfo.vue
-
38pages/tabbar/index/index.vue
-
2pages/tabbar/mine/index.vue
-
5pages/userCenter/login/loginByPhone.vue
-
BINstatic/images/index/ic_jsg.png
-
18store/modules/user.js
@ -0,0 +1,13 @@ |
|||||
|
|
||||
|
export function checkToken (vm) { |
||||
|
let expiresTime = vm.$store.state.user.vuex_loginInfo.expiresTime |
||||
|
let nowTime = new Date() * 1 |
||||
|
console.log('超时了') |
||||
|
console.log(expiresTime) |
||||
|
if(nowTime>expiresTime*1) { |
||||
|
vm.$store.commit('goLogin') |
||||
|
// 如果小于20分钟就刷新一下token &&
|
||||
|
}else if((expiresTime*1 - nowTime) / 60000 < 10 ) { |
||||
|
vm.$store.dispatch('refreshToken') |
||||
|
} |
||||
|
} |
After Width: 92 | Height: 92 | Size: 5.1 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue