refactor(chat + workspace): chat和workspace重构,子路由、懒加载等
This commit is contained in:
1 parent
0a647a0b79
commit
1f1f7236b0
57 files changed
+4356
-3798
No files matched your search
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* features/workspace/constants/routes.ts
|
||||
* 工作台子路由 path 常量,以及旧 ?view= 查询参数到新 path 的映射。
|
||||
*/
|
||||
export const WORKSPACE_PATHS = {
|
||||
root: '/workspace',
|
||||
profile: '/workspace/profile',
|
||||
applications: '/workspace/applications',
|
||||
updates: '/workspace/updates',
|
||||
knowledgeBase: '/workspace/knowledge-base',
|
||||
scheduleRuns: '/workspace/schedule-runs',
|
||||
shippingNotice: '/workspace/shipping-notice',
|
||||
feedback: '/workspace/feedback',
|
||||
history: '/workspace/history',
|
||||
} as const;
|
||||
|
||||
/** 旧 ?view= 参数 → 子路由 path */
|
||||
export const LEGACY_VIEW_TO_PATH: Record<string, string> = {
|
||||
profile: WORKSPACE_PATHS.profile,
|
||||
applications: WORKSPACE_PATHS.applications,
|
||||
feedback: WORKSPACE_PATHS.feedback,
|
||||
updates: WORKSPACE_PATHS.updates,
|
||||
knowledge_base: WORKSPACE_PATHS.knowledgeBase,
|
||||
schedule_runs: WORKSPACE_PATHS.scheduleRuns,
|
||||
shipping_notice: WORKSPACE_PATHS.shippingNotice,
|
||||
history: WORKSPACE_PATHS.history,
|
||||
};
|
||||
|
||||
export function workspacePathFromLegacyView(view?: string): string {
|
||||
if (!view) return WORKSPACE_PATHS.applications;
|
||||
return LEGACY_VIEW_TO_PATH[view] || WORKSPACE_PATHS.applications;
|
||||
}
|
||||
Reference in new issue
Block a user