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