refactor: mock清理+安全配置+通用组件+菜单优化

P0安全: SECRET_KEY/ADMIN_PASSWORD/CORS环境变量化, seed仅admin

P1Mock: mock.ts 301->88行, 删8数据mock+5generateMock, net-1300行

P2组件: useToast/useFetchList+ConfirmDialog/FormDialog

P3菜单: menuSections/menuItems->constants/menu.ts

P4API: NotificationsPage/WorkflowPage重写+RolesPage演示

测试: 1050passed, tsc clean
This commit is contained in:
logan committed 2026-05-24 02:42:29 +08:00
1 parent ec3a03cf38
commit 8b921c6c83
33 files changed
+1734 -2006

No files matched your search

+1 -23
View File
@@ -97,28 +97,6 @@ function highlightDDL(ddl: string): string {
return highlighted;
}
function generateMockRelations(tableName: string): TableRelation[] {
const relations: TableRelation[] = [];
if (tableName.includes('order')) {
relations.push(
{ from_table: tableName, from_column: 'user_id', to_table: 'users', to_column: 'id', constraint_name: `${tableName}_user_id_fk` },
{ from_table: tableName, from_column: 'product_id', to_table: 'products', to_column: 'id', constraint_name: `${tableName}_product_id_fk` },
);
}
if (tableName.includes('user')) {
relations.push(
{ from_table: 'orders', from_column: 'user_id', to_table: tableName, to_column: 'id', constraint_name: `orders_${tableName}_user_id_fk` },
{ from_table: 'comments', from_column: 'user_id', to_table: tableName, to_column: 'id', constraint_name: `comments_${tableName}_user_id_fk` },
);
}
if (tableName.includes('comment')) {
relations.push(
{ from_table: tableName, from_column: 'post_id', to_table: 'posts', to_column: 'id', constraint_name: `${tableName}_post_id_fk` },
);
}
return relations;
}
/* ───────── Tree Component ───────── */
function DbTreeNode({
@@ -265,7 +243,7 @@ export default function DataDictionaryPage() {
const relations = useMemo(() => {
if (!selectedTable) return [];
return generateMockRelations(selectedTable);
return [];
}, [selectedTable]);
const handleExport = () => {