码迷,mamicode.com
首页 > 其他好文 > 详细

前端跨域配置

时间:2019-12-21 14:01:05      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:static   添加   geo   index   bsp   directory   tsp   配置   conf   

 

####VUE项目配置跨域

##在vue-project文件下config下的index中
module.exports = {
dev: {
// Paths
assetsSubDirectory: ‘static‘,
assetsPublicPath: ‘/‘,
proxyTable: {
##在这里添加以下api
‘/api‘:{
target: ‘http://127.0.0.1:8000/‘,
changeOrigin: true, //改变源,
pathRewrite: {???????
‘^/api‘: ‘‘ //路径重写?
}
}
},

前端跨域配置

标签:static   添加   geo   index   bsp   directory   tsp   配置   conf   

原文地址:https://www.cnblogs.com/ahmy/p/12076476.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!