end:跨域配置

This commit is contained in:
wangiegie@gmail.com 2017-11-13 17:08:11 +08:00
parent e788c476b3
commit edf2a1b155
2 changed files with 15 additions and 5 deletions

View File

@ -24,15 +24,25 @@ module.exports = {
},
dev: {
env: require('./dev.env'),
port: 9527,
port: 9528,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/auth': {
target: 'http://127.0.0.1:2000',
changeOrigin: true
}
target: 'http://127.0.0.1:1000',
changeOrigin: true,
pathRewrite: {
'^/auth' : '/auth'
}
},
'/admin': {
target: 'http://127.0.0.1:1000',
changeOrigin: true,
pathRewrite: {
'^/admin' : '/admin'
}
},
},
cssSourceMap: false
}

View File

@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url
// baseURL: process.env.BASE_API, // api的base_url
timeout: 5000 // 请求超时时间
})