- 修复路由守卫:未登录时直接跳转,不显示提示信息 - 修复API拦截器:401错误直接跳转,无需确认 - 移除不必要的ElMessageBox确认框 - 优化Token过期处理逻辑 - 修复文件管理API引入路径和URL前缀 - 修复调拨/回收管理API端点不匹配问题 - 修复通知管理API方法不匹配问题 - 统一系统配置API路径为单数形式 影响文件: - src/router/index.ts - src/api/request.ts - src/api/file.ts - src/api/index.ts 测试状态: - 前端构建通过 - 所有API路径已验证 - 登录流程测试通过 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
73 lines
1.6 KiB
TypeScript
73 lines
1.6 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 { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/assets/styles/variables.scss" as *;`
|
|
}
|
|
}
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
AutoImport({
|
|
// 自动导入 Vue 相关函数
|
|
imports: [
|
|
'vue',
|
|
'vue-router',
|
|
'pinia',
|
|
'@vueuse/core'
|
|
],
|
|
// 自动导入 Element Plus 相关函数
|
|
resolvers: [ElementPlusResolver()],
|
|
dts: 'src/auto-imports.d.ts',
|
|
eslintrc: {
|
|
enabled: true
|
|
}
|
|
}),
|
|
Components({
|
|
// 自动导入 Element Plus 组件
|
|
resolvers: [ElementPlusResolver()],
|
|
dts: 'src/components.d.ts'
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src')
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
open: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8000',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '/api/v1')
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
target: 'es2015',
|
|
outDir: 'dist',
|
|
assetsDir: 'assets',
|
|
sourcemap: false,
|
|
chunkSizeWarningLimit: 1500,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
|
'element-plus': ['element-plus', '@element-plus/icons-vue'],
|
|
'echarts': ['echarts']
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|