feat: 重构前端

This commit is contained in:
tbphp
2025-07-02 17:15:10 +08:00
parent 6a96c4464b
commit f15d0dd8da
102 changed files with 5392 additions and 10344 deletions

View File

@@ -1,26 +1,31 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'url'
import path from 'path'
import { defineConfig } from 'vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
// 解析配置
resolve: {
// 配置路径别名
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
'@': path.resolve(__dirname, './src'),
},
},
build: {
outDir: 'dist'
},
base: './',
// 开发服务器配置
server: {
// 代理配置示例
proxy: {
'/api': {
target: 'http://localhost:3000',
target: 'http://api.example.com',
changeOrigin: true,
secure: false
}
}
}
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
// 构建配置
build: {
outDir: '../cmd/gpt-load/dist',
assetsDir: 'assets',
},
})