调整 token错误更新
This commit is contained in:
@@ -5,15 +5,25 @@
|
||||
import {
|
||||
version
|
||||
} from './package.json'
|
||||
import {
|
||||
silentLogin
|
||||
} from '@/utils/auth.js'
|
||||
// #ifdef APP
|
||||
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// 线上示例使用
|
||||
// console.log('%c uni-app官方团队诚邀优秀前 端工程师加盟,一起打造更卓越的uni-app & uniCloud,欢迎投递简历到 hr2013@dcloud.io', 'color: red');
|
||||
console.log('App Launch');
|
||||
const token = uni.getStorageSync('token')
|
||||
if (token) {
|
||||
this.globalData.tokenRefreshPromise = silentLogin().then(result => {
|
||||
if (!result.success) {
|
||||
uni.removeStorageSync('token')
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
|
||||
Reference in New Issue
Block a user