docs: 注释优化

This commit is contained in:
haoxr 2023-03-22 22:19:27 +08:00
parent e15797b6b0
commit 9d17e600ed
1 changed files with 3 additions and 5 deletions

View File

@ -38,19 +38,17 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
} }
} }
}, },
// 本地反向代理解决浏览器跨域限制
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
port: Number(env.VITE_APP_PORT), port: Number(env.VITE_APP_PORT),
open: true, // 运行自动打开浏览器 open: true, // 运行是否自动打开浏览器
// 反向代理解决跨域
proxy: { proxy: {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
// 线上API地址
target: 'http://vapi.youlai.tech', target: 'http://vapi.youlai.tech',
// 本地API地址
// target: 'http://localhost:8989',
changeOrigin: true, changeOrigin: true,
rewrite: path => rewrite: path =>
// localhost:3000/dev-api/users/me → http://vapi.youlai.tech/users/me
path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
} }
} }