bugfix:未登录循环注册

This commit is contained in:
2026-09-13 01:08:11 +08:00
parent 0a8d60d87f
commit f897e1a391
12 changed files with 268 additions and 38 deletions
+7 -1
View File
@@ -1,4 +1,5 @@
import { request } from '../../utils/request'
import { request, redirectToLogin } from '../../utils/request'
import * as auth from '../../utils/auth'
import { PagedResult, ClothesItem, QuotaItem } from '../../types/models'
import { QuotaType } from '../../utils/config'
@@ -28,6 +29,11 @@ Page({
onShow() {
this.syncTabBar()
// 未登录直接回登录页(幂等跳转),不再发出必然 401 的请求
if (!auth.isLoggedIn()) {
redirectToLogin()
return
}
this.refresh()
},