解决冲突

This commit is contained in:
zhoumengru
2025-09-04 13:44:31 +08:00
23 changed files with 1672 additions and 1365 deletions

View File

@@ -9,27 +9,13 @@ module.exports = defineConfig({
// 静态资源目录
assetsDir: 'static',
devServer: {
hot: true,
compress: true,
allowedHosts: 'all',
headers: {
// 1. 允许开发环境跨域
'Access-Control-Allow-Origin': '*'
},
historyApiFallback: true,
open: false,
port: 8080,
client: {
overlay: {
runtimeErrors: (error) => {
const ignoreErrors = [
'ResizeObserver loop limit exceeded',
'ResizeObserver loop completed with undelivered notifications.'
]
if (ignoreErrors.includes(error.message)) {
return false
}
return true
proxy: {
'/api': {
// 代理前缀,可以自定义(如 '/api'
target: 'http://192.168.0.187:19801', // 目标服务器地址
changeOrigin: true, // 是否改变请求源(跨域必备)
pathRewrite: {
'^/api': '' // 重写路径,去掉 '/api' 前缀
}
}
},