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

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':''
//}
},
}
DIEA
浏览 2950回答 2
2回答

繁华开满天机

localhost:800还是localhost:8000呢?还有我不太理解为什么把第二个的secure设为true,从代码上来看,你只是链接到了http的接口呀

炎炎设计

后端接口地址是/server/user/register,前端请求的时候url地址写/server/user/register,'/server':{target:'http://localhost:8000',//后端服务地址,注意端口号后面没有/changeOrigin:true}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript