Files
zt-closet-wxmini-frontend/miniprogram/app.ts
T
2026-09-11 01:45:04 +08:00

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' })
})
},
})