Merge pull request 'feat: 官网 + 管理端 + Gin/GORM 后端首个完整版本' (#1) from main into dev #2

Merged
Blizzard merged 15 commits from dev into main 2026-07-17 09:36:17 +00:00
Showing only changes of commit cc4aa647c5 - Show all commits
+3 -1
View File
@@ -42,7 +42,9 @@ export async function request<T>(
const res = await fetch(path, { ...init, headers }) const res = await fetch(path, { ...init, headers })
if (res.status === 401) { // 登录接口的 401 是「凭据错误」,交给下方按后端 message 处理;
// 其它接口的 401 才视为会话过期:清 token 并跳登录页
if (res.status === 401 && !path.includes('/admin/login')) {
clearToken() clearToken()
// basename=/admin,登录路由实际是 /admin/login // basename=/admin,登录路由实际是 /admin/login
if (!window.location.pathname.endsWith('/login')) { if (!window.location.pathname.endsWith('/login')) {