调整接口走代理
This commit is contained in:
@@ -2,7 +2,7 @@ import config from '@/config'
|
|||||||
// import urlMap from '@/config/urlMap'
|
// import urlMap from '@/config/urlMap'
|
||||||
|
|
||||||
export default function getUrl(url, domainType = 'admin') {
|
export default function getUrl(url, domainType = 'admin') {
|
||||||
let domain = process.env.VUE_APP_ADMIN || ''
|
let domain = config[domainType] || ''
|
||||||
return domain + url
|
return domain + url
|
||||||
// return 'https://ecotest.happyinsurance.com.cn:4443/api' + url
|
// return 'https://ecotest.happyinsurance.com.cn:4443/api' + url
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
let envInfo = process.env
|
let envInfo = process.env
|
||||||
let [admin] = [envInfo.VUE_APP_ADMIN]
|
let [admin] = ['/api']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
admin,
|
admin,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ module.exports = {
|
|||||||
https: false,
|
https: false,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://127.0.0.1:7100',
|
target: 'https://ecotest.happyinsurance.com.cn:4443/api',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user