打手端迁移至独立子域名

This commit is contained in:
yml2213
2026-08-16 16:08:38 +08:00
parent 8d07b06d52
commit bc2909d6f2
20 changed files with 173 additions and 52 deletions
+3 -5
View File
@@ -1,5 +1,6 @@
import axios from 'axios'
import { clearAdminSession, getAdminToken } from '@/utils/admin-auth'
import { isWorkerSite } from '@/utils/site'
import { clearWorkerSession, getWorkerToken } from '@/utils/worker-auth'
export interface ApiEnvelope<T> {
@@ -84,11 +85,8 @@ http.interceptors.response.use(
if (status === 401 && shouldClearWorkerSession(errorCode)) {
clearWorkerSession()
if (
window.location.hash.startsWith('#/worker') &&
!window.location.hash.startsWith('#/worker/login')
) {
window.location.hash = '#/worker/login'
if (isWorkerSite() && window.location.pathname !== '/') {
window.location.replace('/')
}
}
}