云Share
云Share
  • 发布:2022-08-26 09:18
  • 更新:2024-04-07 14:38
  • 阅读:338

uni-app跨域请求设置问题,vue.config.js不管用;manifest.json也无效

分类:uni-app
// vue.config.js  
module.exports = {  
  devServer: {  
    proxy: {  
      '/api': {  
        target: 'https://gitee.com/',  
        pathRewrite: {  
          '^/api': ''  
        }  
      }  
    },  
  }  
}
// manifest.json  
    "h5": {  
            "devServer": {  
                "proxy": {  
                    "/api": {  
                        "target": "https://gitee.com/",  
                        "pathRewrite": {  
                            "^/api": ""  
                        }  
                    }  
                }  
            }  
    }
uni.request({  
                    url: '/api/dmhsq/photos/raw/master/one.png',  
                    method: 'GET',  
                    success: res => {  
                        console.log(res);  
                    }  
                });
2022-08-26 09:18 负责人:无 分享
已邀请:
Anet

Anet

在manifest.json配置

  • 云Share (作者)

    在manifest.json也没有用,也是报403

    2022-08-26 14:32

2***@qq.com

2***@qq.com - 金子

可以问一下最后怎么解决的

piaoyi_UI

piaoyi_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

403不是跨域

要回复问题请先登录注册