优化请求统一处理
This commit is contained in:
@@ -7,17 +7,25 @@ export default defineConfig({
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
'/javaapi': {
|
||||
'/prodJavaApi': {
|
||||
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||
// target: 'http://192.168.1.42/', // 目标服务器地址
|
||||
changeOrigin: true, // 是否更改请求源
|
||||
rewrite: path => path.replace(/^\/javaapi/, '')
|
||||
rewrite: path => path.replace(/^\/prodJavaApi/, '')
|
||||
},
|
||||
'/phpapi': {
|
||||
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||
// target: 'http://192.168.1.42:8787/', // 目标服务器地址
|
||||
'/testJavaApi': {
|
||||
target: 'http://192.168.1.42/', // 目标服务器地址
|
||||
changeOrigin: true, // 是否更改请求源
|
||||
rewrite: path => path.replace(/^\/phpapi/, '')
|
||||
rewrite: path => path.replace(/^\/testJavaApi/, '')
|
||||
},
|
||||
'/prodPhpApi': {
|
||||
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||
changeOrigin: true, // 是否更改请求源
|
||||
rewrite: path => path.replace(/^\/prodPhpApi/, '')
|
||||
},
|
||||
'/testPhpApi': {
|
||||
target: 'http://192.168.1.42:8787/', // 目标服务器地址
|
||||
changeOrigin: true, // 是否更改请求源
|
||||
rewrite: path => path.replace(/^\/testPhpApi/, '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user