feat: vue重构

This commit is contained in:
Cassianvale
2025-03-05 17:45:09 +08:00
parent 5dacc9f528
commit 4393bf68cd
27 changed files with 4164 additions and 15 deletions

43
frontend/vite.config.ts Normal file
View File

@@ -0,0 +1,43 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'
// 获取当前文件的目录路径在ESM中替代__dirname
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8888',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/analyze': {
target: 'http://127.0.0.1:8888',
changeOrigin: true,
},
'/test_api_connection': {
target: 'http://127.0.0.1:8888',
changeOrigin: true,
},
'/search_us_stocks': {
target: 'http://127.0.0.1:8888',
changeOrigin: true,
},
'/config': {
target: 'http://127.0.0.1:8888',
changeOrigin: true,
},
},
},
})