19 lines
408 B
TypeScript
19 lines
408 B
TypeScript
// 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' })
|
|
})
|
|
},
|
|
})
|