uview ui框架封装的Http请求获取不到config

nodejs yekong

这里获取config需要修改uview ui文件 添加一段代码用来获取config

response.config = options

这样就可以获取config了

{
    "data": {
        "code": 10041,
        "message": "access token 损坏",
        "request": "POST /v1/collection/list"
    },
    "statusCode": 401,
    "header": {
        "Date": "Fri, 06 Aug 2021 03:48:49 GMT",
        "Keep-Alive": "timeout=5",
        "Content-Length": "83",
        "Connection": "keep-alive",
        "Content-Type": "application/json; charset=utf-8",
        "Vary": "Origin"
    },
    "errMsg": "request:ok",
    "cookies": [],
    "config": {
        "url": "http://localhost:7000/v1/collection/list",
        "method": "POST",
        "header": {
            "Authorization": "Bearer 123",
            "Content-Type": "application/json"
        },
        "data": {
            "pageNum": 1,
            "pageSize": 10
        },
        "dataType": "json",
        "responseType": "text",
        "params": {},
        "complete": "function() { [native code] }"
    }
}

喜欢