Skip to content

Commit b62790c

Browse files
committed
Merge branch 'vite'
2 parents 7bcde6c + 4b4d87a commit b62790c

157 files changed

Lines changed: 13238 additions & 7508 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ jobs:
4545
scp -i private_key.pem -C -r dist.tar.gz $USERNAME@$HOST:/work/nexus
4646
# 解压并替换目标目录 --strip-components=1 表示解压后删除第一层目录(dist)
4747
ssh -i private_key.pem $USERNAME@$HOST "tar -zxvf /work/nexus/dist.tar.gz --strip-components=1 -C /work/nexus"
48-
ssh -i private_key.pem $USERNAME@$HOST "rm -rf dist.tar.gz"
48+
ssh -i private_key.pem $USERNAME@$HOST "rm -rf /work/nexus/dist.tar.gz"
4949
ssh -i private_key.pem $USERNAME@$HOST "sudo systemctl reload nginx"
5050
rm private_key.pem

biome.json

Lines changed: 106 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,145 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
33
"vcs": {
4-
"enabled": false,
4+
"enabled": true,
55
"clientKind": "git",
6-
"useIgnoreFile": false
6+
"useIgnoreFile": true
77
},
88
"files": {
9-
"ignoreUnknown": false
9+
"ignoreUnknown": false,
10+
"ignore": [
11+
"node_modules/**",
12+
"dist/**",
13+
"build/**",
14+
"*.min.js",
15+
"*.bundle.js"
16+
]
1017
},
1118
"formatter": {
1219
"enabled": true,
1320
"indentStyle": "space",
14-
"lineWidth": 120
21+
"indentWidth": 2,
22+
"lineWidth": 120,
23+
"lineEnding": "lf"
1524
},
1625
"linter": {
1726
"enabled": true,
1827
"rules": {
1928
"recommended": true,
2029
"style": {
21-
"noInferrableTypes": "off"
30+
"noInferrableTypes": "off",
31+
"useConst": "error",
32+
"useTemplate": "error",
33+
"noVar": "error",
34+
"useShorthandArrayType": "error",
35+
"useShorthandAssign": "error"
2236
},
2337
"suspicious": {
24-
"noExplicitAny": "info"
38+
"noExplicitAny": "warn",
39+
"noArrayIndexKey": "warn",
40+
"noAssignInExpressions": "error",
41+
"noAsyncPromiseExecutor": "error",
42+
"noCatchAssign": "error",
43+
"noClassAssign": "error",
44+
"noCompareNegZero": "error",
45+
"noControlCharactersInRegex": "error",
46+
"noDebugger": "error",
47+
"noDuplicateCase": "error",
48+
"noDuplicateClassMembers": "error",
49+
"noDuplicateObjectKeys": "error",
50+
"noDuplicateParameters": "error",
51+
"noEmptyBlockStatements": "warn",
52+
"noExtraNonNullAssertion": "error",
53+
"noFallthroughSwitchClause": "error",
54+
"noFunctionAssign": "error",
55+
"noGlobalObjectCalls": "error",
56+
"noImportAssign": "error",
57+
"noMisleadingCharacterClass": "error",
58+
"noMisleadingInstantiator": "error",
59+
"noPrototypeBuiltins": "error",
60+
"noRedeclare": "error",
61+
"noShadowRestrictedNames": "error",
62+
"noUnsafeDeclarationMerging": "error",
63+
"noUnsafeNegation": "error",
64+
"useGetterReturn": "error",
65+
"useValidTypeof": "error"
2566
},
2667
"correctness": {
27-
"useExhaustiveDependencies": "off",
28-
"noUnusedVariables": "off"
68+
"useExhaustiveDependencies": "warn",
69+
"noUnusedVariables": "warn",
70+
"noUnusedImports": "error",
71+
"useHookAtTopLevel": "error",
72+
"useIsNan": "error",
73+
"useValidForDirection": "error"
74+
},
75+
"complexity": {
76+
"noBannedTypes": "warn",
77+
"noUselessFragments": "error",
78+
"noUselessTypeConstraint": "error",
79+
"useLiteralKeys": "error",
80+
"useOptionalChain": "error"
81+
},
82+
"performance": {
83+
"noAccumulatingSpread": "warn",
84+
"noDelete": "error"
2985
},
3086
"a11y": {
3187
"useKeyWithClickEvents": "off",
3288
"noSvgWithoutTitle": "off",
33-
"noStaticElementInteractions": "off"
89+
"noStaticElementInteractions": "off",
90+
"useAltText": "warn",
91+
"useAnchorContent": "warn",
92+
"useButtonType": "warn",
93+
"useHeadingContent": "warn",
94+
"useHtmlLang": "warn",
95+
"useIframeTitle": "warn",
96+
"useMediaCaption": "warn",
97+
"useValidAnchor": "warn",
98+
"useValidAriaProps": "warn",
99+
"useValidAriaValues": "warn",
100+
"useValidLang": "warn"
101+
},
102+
"nursery": {
103+
"useSortedClasses": "warn"
34104
}
35105
}
36106
},
37107
"javascript": {
108+
"formatter": {
109+
"quoteStyle": "single",
110+
"jsxQuoteStyle": "double",
111+
"semicolons": "always",
112+
"trailingCommas": "es5",
113+
"bracketSpacing": true,
114+
"bracketSameLine": false,
115+
"arrowParentheses": "always",
116+
"quoteProperties": "asNeeded"
117+
}
118+
},
119+
"typescript": {
38120
"formatter": {
39121
"quoteStyle": "single",
40122
"jsxQuoteStyle": "double"
41123
}
42124
},
125+
"json": {
126+
"formatter": {
127+
"indentStyle": "space",
128+
"indentWidth": 2
129+
}
130+
},
131+
"css": {
132+
"formatter": {
133+
"indentStyle": "space",
134+
"indentWidth": 2
135+
}
136+
},
43137
"assist": {
44138
"enabled": true,
45139
"actions": {
46140
"source": {
47-
"organizeImports": "on"
141+
"organizeImports": "on",
142+
"fixAll": "on"
48143
}
49144
}
50145
}

mock/README.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# 权限管理 Mock 数据说明
2+
3+
本目录包含了权限管理相关的Mock数据,用于前端开发和测试。
4+
5+
## 文件结构
6+
7+
```
8+
mock/
9+
├── login.mock.ts # 登录相关Mock
10+
├── permission.mock.ts # 权限管理总入口
11+
├── permissionButton.mock.ts # 权限按钮Mock
12+
├── permissionAssign.mock.ts # 权限分配Mock
13+
├── permissionAudit.mock.ts # 权限审计Mock
14+
└── README.md # 说明文档
15+
```
16+
17+
## 数据说明
18+
19+
### 1. 权限按钮 (PermissionButton)
20+
21+
**数据表对应**: `t_sys_menu` (menu_type = 3, 按钮权限)
22+
23+
**主要字段**:
24+
- `id`: 按钮ID
25+
- `name`: 按钮名称
26+
- `code`: 权限代码 (对应 perms 字段)
27+
- `menuId`: 所属菜单ID (对应 parent_id 字段)
28+
- `menuName`: 所属菜单名称
29+
- `parentMenuId`: 父级菜单ID
30+
- `parentMenuName`: 父级菜单名称
31+
- `description`: 描述信息
32+
- `status`: 状态 (对应 status 字段)
33+
- `sortNo`: 排序号 (对应 sort_no 字段)
34+
35+
**Mock数据特点**:
36+
- 包含15个权限按钮示例
37+
- 涵盖用户管理、角色管理、菜单管理、应用中心等模块
38+
- 每个按钮都有对应的接口权限关联
39+
40+
### 2. 权限分配 (PermissionAssign)
41+
42+
**数据表对应**: 权限分配关系表
43+
44+
**主要字段**:
45+
- `id`: 分配记录ID
46+
- `roleId`: 角色ID
47+
- `roleName`: 角色名称
48+
- `permissionType`: 权限类型 (menu/button/interface)
49+
- `permissionId`: 权限ID
50+
- `permissionName`: 权限名称
51+
- `permissionCode`: 权限代码
52+
- `assignTime`: 分配时间
53+
- `assignBy`: 分配人
54+
55+
**Mock数据特点**:
56+
- 包含3个角色:系统管理员、普通用户、操作员
57+
- 涵盖菜单权限、按钮权限、接口权限的分配关系
58+
- 提供角色权限详情查询
59+
60+
### 3. 权限审计 (PermissionAudit)
61+
62+
**数据表对应**: 权限审计相关表
63+
64+
**主要功能**:
65+
- 权限使用统计
66+
- 权限变更日志
67+
- 异常权限检测
68+
69+
**Mock数据特点**:
70+
- 提供完整的统计数据
71+
- 包含8条变更日志记录
72+
- 包含8条异常检测结果
73+
74+
## 使用方式
75+
76+
### 启用Mock数据
77+
78+
在对应的Mock文件中,将 `enabled: false` 改为 `enabled: true` 即可启用Mock数据。
79+
80+
### API接口
81+
82+
所有Mock接口都遵循以下URL格式:
83+
- 权限按钮: `/api/system/permission/button/*`
84+
- 权限分配: `/api/system/permission/assign/*`
85+
- 权限审计: `/api/system/permission/audit/*`
86+
87+
### 响应格式
88+
89+
所有Mock接口都返回统一的响应格式:
90+
```json
91+
{
92+
"code": 200,
93+
"message": "操作成功",
94+
"data": {} // 具体数据
95+
}
96+
```
97+
98+
## 数据库表结构对应
99+
100+
### t_sys_menu 表字段映射
101+
102+
| Mock字段 | 数据库字段 | 说明 |
103+
|---------|-----------|------|
104+
| id | id | 主键ID |
105+
| name | name | 菜单/按钮名称 |
106+
| code | perms | 权限代码 |
107+
| menuId | parent_id | 父级菜单ID |
108+
| description | description | 描述信息 |
109+
| status | status | 状态 |
110+
| sortNo | sort_no | 排序号 |
111+
| createTime | create_time | 创建时间 |
112+
| updateTime | update_time | 更新时间 |
113+
| createBy | create_by | 创建人 |
114+
| updateBy | update_by | 更新人 |
115+
116+
### 菜单类型说明
117+
118+
- `menu_type = 0`: 一级菜单
119+
- `menu_type = 1`: 子菜单
120+
- `menu_type = 2`: 子路由
121+
- `menu_type = 3`: 按钮权限
122+
123+
## 注意事项
124+
125+
1. Mock数据仅用于前端开发和测试,生产环境请使用真实API
126+
2. 数据中的ID和时间戳都是模拟数据,实际使用时需要根据后端接口调整
127+
3. 权限代码命名规范:`模块:功能:操作`,如 `system:user:add`
128+
4. 接口权限代码格式:`/api/模块/功能/操作`,如 `/api/system/user/add`
129+
130+
## 扩展说明
131+
132+
如需添加新的Mock数据:
133+
134+
1. 在对应的Mock文件中添加新的数据项
135+
2. 确保数据格式与API接口定义一致
136+
3. 更新此README文档
137+
4. 测试Mock数据的正确性

mock/permission.mock.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineMock } from 'vite-plugin-mock-dev-server';
2+
import permissionButtonMock from './permissionButton.mock';
3+
import permissionAssignMock from './permissionAssign.mock';
4+
import permissionAuditMock from './permissionAudit.mock';
5+
6+
// 合并所有权限相关的Mock配置
7+
export default defineMock([
8+
...permissionButtonMock,
9+
...permissionAssignMock,
10+
...permissionAuditMock,
11+
]);

0 commit comments

Comments
 (0)