打手端迁移至独立子域名

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
+10 -10
View File
@@ -13,15 +13,15 @@ import { useIsMobile } from '@/utils/use-is-mobile'
import { clearWorkerSession, getWorkerStatus, getWorkerUsername } from '@/utils/worker-auth'
const menuItems: MenuProps['items'] = [
{ key: '/worker/hall', icon: <ShoppingOutlined />, label: '抢单大厅' },
{ key: '/worker/orders', icon: <ContainerOutlined />, label: '我的订单' },
{ key: '/worker/profile', icon: <UserOutlined />, label: '个人中心' },
{ key: '/hall', icon: <ShoppingOutlined />, label: '抢单大厅' },
{ key: '/orders', icon: <ContainerOutlined />, label: '我的订单' },
{ key: '/profile', icon: <UserOutlined />, label: '个人中心' },
]
const tabItems = [
{ key: '/worker/hall', icon: ShoppingOutlined, label: '抢单大厅' },
{ key: '/worker/orders', icon: ContainerOutlined, label: '我的订单' },
{ key: '/worker/profile', icon: UserOutlined, label: '个人中心' },
{ key: '/hall', icon: ShoppingOutlined, label: '抢单大厅' },
{ key: '/orders', icon: ContainerOutlined, label: '我的订单' },
{ key: '/profile', icon: UserOutlined, label: '个人中心' },
]
export default function WorkerLayout() {
@@ -41,7 +41,7 @@ export default function WorkerLayout() {
} finally {
clearWorkerSession()
message.success('已退出登录')
navigate('/worker/login', { replace: true })
navigate('/', { replace: true })
}
}
@@ -144,9 +144,9 @@ export default function WorkerLayout() {
}
function resolveSelectedKey(pathname: string) {
if (pathname.startsWith('/worker/orders')) return '/worker/orders'
if (pathname.startsWith('/worker/profile')) return '/worker/profile'
return '/worker/hall'
if (pathname.startsWith('/orders')) return '/orders'
if (pathname.startsWith('/profile')) return '/profile'
return '/hall'
}
function formatWorkerStatus(status: string) {