uni-app跨域请求

根目录下找到 manifest.json 文件,找到源码视图 添加以下配置

"h5" : {
  "devServer" : {
    "port" : 8000,
    "disableHostCheck" : true,
    "proxy" : {
      "/yf" : {
        "target" : "*******************", // 需要跨域的域名
        "changeOrigin" : true,
        "secure" : false,
        "pathRewrite" : {
          "^/yf" : ""
        }
      }
    }
  }
},

猜你喜欢

转载自www.cnblogs.com/sww-blog/p/11060587.html