4***@qq.com
- 发布:2023-12-12 15:21
- 更新:2023-12-15 15:26
- 阅读:372
4***@qq.com (作者)
嗯嗯对的。第三方接口,post的时候需要类似于 像fetch请求一下token
2023-12-13 14:33
喜欢技术的前端
回复 4***@qq.com: uni.request 或者 axios 也是可以在请求接口的时候给请求头添加token ,如果你这个token 是 通过接口请求来的,可以通过async await 利用Promise 进行同步请求 拿到token,在调正式的接口
2023-12-13 15:45
4***@qq.com (作者)
回复 喜欢技术的前端: "message": "There is no suitable adapter to dispatch the request since :\n- adapter xhr is not supported by the environment\n- adapter http is not available in the build",
"name": "AxiosError",
"stack": "AxiosError: There is no suitable adapter to dispatch the request since :\n- adapter xhr is not supported by the environment\n- adapter http is not available in the build\n at Object.getAdapter (app-service.js:5830:13)\n at Axios.dispatchRequest (app-service.js:4705:35)\n at Axios.request (app-service.js:1939:44)\n at Axios.httpMethod [as post] (app-service.js:1975:19)\n at Function.wrap [as post] (app-service.js:1794:15)\n at _callee$ (webpack-internal:///12:59:39)\n at tryCatch (app-service.js:563:17)\n at Generator.<anonymous> (app-service.js:644:22)\n at Generator.next (app-service.js:588:21)\n at asyncGeneratorStep (app-service.js:841:24)",
"code": "ERR_NOT_SUPPORT",
"status": null 试了的 报这种错误
2023-12-15 15:18