后端代理地址改用配置文件
This commit is contained in:
parent
ea8258ce5f
commit
a6551f61a1
@ -1,6 +1,7 @@
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
VITE_APP_API_HOST = 'http://localhost:8888'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = '/dev-api'
|
||||
|
||||
@ -51,12 +51,12 @@ export default defineConfig(({ mode, command }) => {
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
target: 'http://localhost:8888',
|
||||
target: env.VITE_APP_API_HOST,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/dev-api/, '')
|
||||
},
|
||||
'/msghub': {
|
||||
target: 'http://localhost:8888',
|
||||
target: env.VITE_APP_API_HOST,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(/^\/msgHub/, '')
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user