打手端迁移至独立子域名

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
+15
View File
@@ -0,0 +1,15 @@
export function resolveLegacyWorkerPath(hash: string) {
const value = hash.startsWith('#') ? hash.slice(1) : hash
const queryIndex = value.indexOf('?')
const pathname = queryIndex >= 0 ? value.slice(0, queryIndex) : value
const search = queryIndex >= 0 ? value.slice(queryIndex) : ''
if (pathname === '/worker' || pathname === '/worker/' || pathname === '/worker/login') {
return `/${search}`
}
if (pathname === '/worker/hall') return `/hall${search}`
if (pathname === '/worker/orders') return `/orders${search}`
if (pathname === '/worker/profile') return `/profile${search}`
return ''
}