打手端迁移至独立子域名
This commit is contained in:
@@ -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('/')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user