问题现象:
- 管理端支出类型页面无法显示数据库数据
- 后端接口返回 404
根本原因:
- ExpenseTypeController 的路径是 /api/v1/exp/expense-type
- 前端 expense.ts 中所有 API 调用都缺少 /api/v1 前缀
修复内容:
- getExpenseTypeList: /exp/expense-type/page → /api/v1/exp/expense-type/page
- getExpenseTypeTree: /exp/expense-type/tree → /api/v1/exp/expense-type/tree
- createExpenseType: /exp/expense-type → /api/v1/exp/expense-type
- updateExpenseType: /exp/expense-type/{id} → /api/v1/exp/expense-type/{id}
- deleteExpenseType: /exp/expense-type/{id} → /api/v1/exp/expense-type/{id}
- getExpenseList: /exp/expense/page → /api/v1/exp/expense/page
- getExpenseById: /exp/expense/{id} → /api/v1/exp/expense/{id}
- createExpense: /exp/expense → /api/v1/exp/expense
- updateExpense: /exp/expense/{id} → /api/v1/exp/expense/{id}
- deleteExpense: /exp/expense/{id} → /api/v1/exp/expense/{id}
- 所有审批流程 API 同样添加 /api/v1 前缀
- exportExpense 导出 URL 也添加 /api/v1 前缀
技术细节:
- 统一 API路径规范,与后端 Controller 保持一致
- 符合项目 RESTful API 设计标准(/api/v1/模块/资源)
Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.
Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.