角色权限矩阵: - admin: 全部权限 - dba: 数据源管理+工单全流程+审批+执行 - developer: 查询+提交工单+审批(不能执行) - auditor: 只读(审计日志+审核规则+审批流程查看) 后端改动: - ticket.go: 修复GetCurrentUser返回值顺序bug(userID,username,role) - ticket.go: CreateTicket拦截auditor提交工单 - ticket.go: ApproveTicket允许admin/dba/developer - ticket.go: ExecuteTicket仅允许admin/dba - router.go: query执行限制admin/dba/developer - router.go: workflow写操作限制admin/dba - router.go: audit-rules写操作限制admin/dba 前端改动: - menu.ts: tickets去掉auditor, workflow加developer+auditor, audit-logs加auditor - useAuth.tsx: routePermissionMap和actionPermissionMap同步更新 - TicketDetailPage: canApprove加developer角色 DB迁移: test123/test234从auditor→developer
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])