本地开发跨域配置,版本信息页面接口对接Mock数据

This commit is contained in:
付民康
2025-03-17 11:16:05 +08:00
parent ebcd74a34f
commit 8c68ceb413
4 changed files with 108 additions and 50 deletions

View File

@@ -35,6 +35,14 @@ export default (config: any) => {
open: true, // 启动服务打开浏览器
headers: {
'Access-Control-Allow-Origin': '*',
},
proxy: {
// 配置跨域代理
'/official': {
target: 'http://222.20.126.217:9527', // 目标服务器地址
changeOrigin: true, // 允许跨域
rewrite: (path) => path.replace(/^\/official/, '/official'), // 重写路径
}
}
},