chore(dev): 支持本地后端代理目标
This commit is contained in:
@@ -11,6 +11,7 @@ function resolveBuildId() {
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(() => {
|
||||
const buildId = resolveBuildId()
|
||||
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET?.trim() || 'https://ipad.shenynet.com'
|
||||
|
||||
return {
|
||||
plugins: [vue()],
|
||||
@@ -26,7 +27,7 @@ export default defineConfig(() => {
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'https://ipad.shenynet.com',
|
||||
target: apiProxyTarget,
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user