vue项目ios上接口直接报错,message显示Networkerror,安卓运行良好,配置问题?
发布于 5 年前 作者 mingcao 5054 次浏览 来自 官方Issues

    {

      “message”: “Network Error”,

      “name”: “Error”,

      “stack”: “exports@http://cloudh5uat.iqdii.com/weChatMessage/js/axios.min.js:2:11291\nonerror@http://cloudh5uat.iqdii.com/weChatMessage/js/axios.min.js:2:9858”,

      “config”: {

        “url”: “http://jybpushuat.iqdii.com/Utility/GetBindWeixinOpenIdUidCount”,

        “method”: “post”,

        “data”: “{\“code\”:\“011DEBFa1zC1qA0MCZGa1IPYT31DEBFw\”}”,

        “headers”: { “Accept”: “application/json, text/plain, */*”, “Content-Type”: “application/json;charset=UTF-8” },

        “transformRequest”: [null],

        “transformResponse”: [null],

        “timeout”: 0,

        “xsrfCookieName”: “XSRF-TOKEN”,

        “xsrfHeaderName”: “X-XSRF-TOKEN”,

        “maxContentLength”: -1

      }

    }

页面上的是在uat环境直接打印的catch中的报错,uat环境网页入口与接口都是http,生产环境入口与接口都是https,两个环境一样的问题,后台也没有收到客户端请求;这种问题只在ios上有发现,是微信将请求拦截了吗?有木有大神帮忙看下给个思路,非常感谢!

1 回复

将post请求的数据提交格式转换为 ‘application/x-www-form-urlencoded’ ,数据也转换为FormData则可以在安卓与ios上请求成功,具体报错原因暂时没有找到,转载大神链接

https://blog.csdn.net/baidu_34478852/article/details/109385342

https://www.cnblogs.com/yf-kk/p/13858773.html

回到顶部