scxxf
scxxf
  • 发布:2019-12-03 20:30
  • 更新:2021-04-12 18:50
  • 阅读:3081

跨域访问出现 request:fail invalid url是什么原因

分类:HBuilderX

我想通过app去抓取www.xx.com/a.html的内容,下面是跨域配置
"h5": {
"devServer": {
"port": 8000,
"disableHostCheck": true,
"proxy": {
"/list": {
"target": "http://www.xx.com",
"changeOrigin": true,
"secure": false,
"pathRewrite":{"^/list":""}
}
}
}
},

引用页面为:
uni.request({
url: "/list/a.html",
success: (res) => {
console.log(res)
}
});
控件台报request:fail invalid url "/list/a.html" 这个错误,请问错误出在什么地方

2019-12-03 20:30 负责人:无 分享
已邀请:
黑夜的川

黑夜的川

解决了吗,我也出现这个问题了

  • 姜盼

    解决了吗?

    2022-01-08 15:41

  • 黑夜的川

    回复 姜盼: 解决了,但是忘记怎么解决得了,时间太久了

    2022-01-11 16:24

该问题目前已经被锁定, 无法添加新回复