0

    uni开发app 请求报错 request:fail abort statusC

    2023.06.26 | admin | 128次围观

    postman请求可以

    最近开发项目时开发者证书 换电脑,在自己电脑上运行了一个项目开发者证书 换电脑,postman可以请求成功

    换到项目中出现报错

    {
        "errMsg": "request:fail abort statusCode:-1 Failed to connect to /127.0.0.1:8080",
        "config": {
            "baseURL": "http://127.0.0.1:8080/api/",
            "method": "POST",
            "url": "/distribution/facade/loadDistributionOrder",
            "params": {},
            "custom": {},
            "header": {
                "Content-Type": "application/json;charset=UTF-8",
                "Auth-Token": null,
                "Root-Scope": null
            },
            "validateStatus": "function() { [native code] }",
            "data": {
                "merchantId": "",
                "startDate": "",
                "endDate": "",
                "status": "",
                "type": "transport",
                "userId": "no_login_user",
                "operatorUserId": "no_login_user",
                "customerId": null,
                "serviceId": null,
                "requestId": "b2580456a73126124d8563a29827c570"
            },
            "timeout": 20000,
            "dataType": "json",
            "responseType": "text",
            "sslVerify": false,
            "firstIpv4": false,
            "fullPath": "http://127.0.0.1:8080/api/distribution/facade/loadDistributionOrder"
        }
    }
    

    解决办法

    把请求地址127.0.0.1 改为自己本机ipv4的地址

    具体方法(mac电脑)

    版权声明

    本文仅代表作者观点。
    本文系作者授权发表,未经许可,不得转载。

    发表评论