## P0 三层架构违规修复 (4项) - 创建 SchoolStatsService/TeacherStatsService,移除Controller直接调用Mapper - 修复 AdminCourseController 使用 Service 层方法 - 修复 TeacherCourseController 使用 ClassService 获取班级 - 新增 ClassService.getActiveClassesByTenantId() - 新增 CourseService.createSystemCourse() ## P1 API 路径统一 (8项) 后端路径统一为 /api/v1/admin/*: - AdminCourseController: /api/admin/courses → /api/v1/admin/courses - AdminTenantController: /api/admin/tenants → /api/v1/admin/tenants 前端配置调整: - vite.config.ts: 移除代理重写规则 - src/api/index.ts: baseURL /api/v1 → /api - 更新 admin.ts, lesson.ts, package.ts, theme.ts 使用 /v1/admin/* 路径 ## P2 文档规范更新 (5项) - 更新 CLAUDE.md 前端 API 调用文档 - 新增三种调用方式说明(http/适配层/Orval客户端) - 新增 API 路径规范表格 - 更新前端目录结构说明 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
80 lines
1.9 KiB
TypeScript
80 lines
1.9 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { resolve } from 'path';
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
|
|
import viteCompression from 'vite-plugin-compression';
|
|
import fileRouter from 'unplugin-vue-router/vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
fileRouter({
|
|
routesFolder: 'src/views',
|
|
extensions: ['.vue'],
|
|
importMode: 'sync',
|
|
}),
|
|
AutoImport({
|
|
imports: [
|
|
'vue',
|
|
'vue-router',
|
|
'pinia',
|
|
{
|
|
'ant-design-vue': ['message', 'notification', 'Modal'],
|
|
},
|
|
],
|
|
dts: 'src/auto-imports.d.ts',
|
|
// 添加 vue-router 的自动导入
|
|
vueTemplate: true,
|
|
}),
|
|
Components({
|
|
resolvers: [
|
|
AntDesignVueResolver({
|
|
importStyle: false,
|
|
}),
|
|
],
|
|
dts: 'src/components.d.ts',
|
|
}),
|
|
viteCompression({
|
|
verbose: true,
|
|
disable: false,
|
|
threshold: 10240,
|
|
algorithm: 'gzip',
|
|
ext: '.gz',
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
host: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
'/uploads': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'ant-design-vue': ['ant-design-vue', '@ant-design/icons-vue'],
|
|
'echarts': ['echarts'],
|
|
'fullcalendar': ['@fullcalendar/vue3', '@fullcalendar/core', '@fullcalendar/daygrid', '@fullcalendar/timegrid', '@fullcalendar/interaction'],
|
|
'dayjs': ['dayjs'],
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 1000,
|
|
},
|
|
});
|