登录后默认进入总体概况页
- 将 Zustand 默认 activeModule 从 workspace 调整为 dashboard,登录后默认展示总体概况页。 - 同步测试 resetStore 的默认模块,避免测试环境与真实默认入口不一致。 - 补充 useStore 默认模块回归测试,固定 dashboard 初始入口行为。 - 更新 AGENTS 和前端实现文档,记录登录后的默认模块。
This commit is contained in:
@@ -7,6 +7,10 @@ describe('useStore', () => {
|
||||
resetStore();
|
||||
});
|
||||
|
||||
it('defaults to the dashboard module after login state is initialized', () => {
|
||||
expect(useStore.getState().activeModule).toBe('dashboard');
|
||||
});
|
||||
|
||||
it('stores and clears auth state with localStorage', () => {
|
||||
useStore.getState().login('token-1', { id: 1, username: 'admin', role: 'admin' });
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ export const useStore = create<AppState>((set) => ({
|
||||
})),
|
||||
|
||||
// Workspace
|
||||
activeModule: 'workspace',
|
||||
activeModule: 'dashboard',
|
||||
activeTool: 'move',
|
||||
aiModel: DEFAULT_AI_MODEL_ID,
|
||||
frames: [],
|
||||
|
||||
@@ -7,7 +7,7 @@ export function resetStore() {
|
||||
currentUser: null,
|
||||
projects: [],
|
||||
currentProject: null,
|
||||
activeModule: 'workspace',
|
||||
activeModule: 'dashboard',
|
||||
activeTool: 'move',
|
||||
aiModel: DEFAULT_AI_MODEL_ID,
|
||||
frames: [],
|
||||
|
||||
Reference in New Issue
Block a user