first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// app.ts
|
||||
import * as auth from './utils/auth'
|
||||
import { setAuthExpiredHandler } from './utils/request'
|
||||
|
||||
App<IAppOption>({
|
||||
globalData: {
|
||||
userInfo: undefined,
|
||||
},
|
||||
|
||||
onLaunch() {
|
||||
// 登录失效 / 账号禁用时统一清登录态并跳转登录页
|
||||
setAuthExpiredHandler(() => {
|
||||
auth.clearTokens()
|
||||
auth.clearUserInfo()
|
||||
wx.reLaunch({ url: '/pages/login/login' })
|
||||
})
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user