为了账号安全,请及时绑定邮箱和手机立即绑定

http://localhost:8000/user请求成http://localhost:8000/server/user

http://localhost:8000/user请求成http://localhost:8000/server/user

DIEA 2019-05-13 10:42:34
proxyTable:{'/server':{target:'http://localhost:8000/',//接口的域�?//secure:false,//如果是https接口,需要配置这个参�?changeOrigin:true,//如果接口跨域,需要进行这个参数配�?//pathRewrite:{//'^/api':''//}}'/user':{target:'http://localhost:8000/user/register',//接口的域�?secure:true,//如果是https接口,需要配置这个参�?changeOrigin:true,//如果接口跨域,需要进行这个参数配�?//pathRewrite:{//'^/api':''//}},}
查看完整描述

2 回答

?
繁华开满天机

TA贡献1816条经验 获得超4个赞

localhost:800还是localhost:8000呢?还有我不太理解为什么把第二个的secure设为true,从代码上来看,你只是链接到了http的接口呀
                            
查看完整回答
反对 回复 2019-05-13
?
炎炎设计

TA贡献1808条经验 获得超4个赞

后端接口地址是/server/user/register,前端请求的时候url地址写/server/user/register,
'/server':{
target:'http://localhost:8000',//后端服务地址,注意端口号后面没有/
changeOrigin:true
}
                            
查看完整回答
反对 回复 2019-05-13
  • 2 回答
  • 0 关注
  • 2949 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号