|
|
@ -105,17 +105,17 @@ let logout = false |
|
|
|
export function getToken(){ |
|
|
|
export function getToken(){ |
|
|
|
// console.log(store.state.dataTime)
|
|
|
|
// console.log(store.state.dataTime)
|
|
|
|
if(process.env.NODE_ENV == 'production'){ |
|
|
|
if(process.env.NODE_ENV == 'production'){ |
|
|
|
// if(store.state.dataTime && !logout){
|
|
|
|
if(store.state.dataTime && !logout){ |
|
|
|
// axios.get(`${api.queryToken}?token=${store.state.token}`).then(res => {
|
|
|
|
axios.get(`${api.queryToken}?token=${store.state.token}`).then(res => { |
|
|
|
// if(store.state.dataTime && (res.data.message != store.state.dataTime)){
|
|
|
|
if(store.state.dataTime && (res.data.message != store.state.dataTime)){ |
|
|
|
// logout || Message.error('您已在另一台设备登录,本次登录已下线!')
|
|
|
|
logout || Message.error('您已在另一台设备登录,本次登录已下线!') |
|
|
|
// logout = true
|
|
|
|
logout = true |
|
|
|
// setTimeout(() => {
|
|
|
|
setTimeout(() => { |
|
|
|
// core.logout()
|
|
|
|
core.logout() |
|
|
|
// },1500)
|
|
|
|
},1500) |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }).catch(err => {})
|
|
|
|
}).catch(err => {}) |
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|