From 3924b7c3ea444526be436a31f9e7d5623749580b Mon Sep 17 00:00:00 2001 From: luchweb Date: Tue, 23 Aug 2022 10:34:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=94=E5=9B=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0`rawData`,=E4=BF=9D=E7=95=99=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=E5=8E=9F=E5=A7=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/adapters/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/adapters/index.js b/src/lib/adapters/index.js index b871edb..9bcd653 100644 --- a/src/lib/adapters/index.js +++ b/src/lib/adapters/index.js @@ -1,7 +1,7 @@ import buildURL from '../helpers/buildURL' import buildFullPath from '../core/buildFullPath' import settle from '../core/settle' -import { isUndefined } from "../utils" +import {isUndefined} from "../utils" /** * 返回可选值存在的配置 @@ -20,13 +20,14 @@ const mergeKeys = (keys, config2) => { } export default (config) => { return new Promise((resolve, reject) => { - let fullPath = buildURL(buildFullPath(config.baseURL, config.url), config.params,config.paramsSerializer) + let fullPath = buildURL(buildFullPath(config.baseURL, config.url), config.params, config.paramsSerializer) const _config = { url: fullPath, header: config.header, complete: (response) => { config.fullPath = fullPath response.config = config + response.rawData = response.data try { // 对可能字符串不是json 的情况容错 if (typeof response.data === 'string') { @@ -90,7 +91,7 @@ export default (config) => { 'firstIpv4', // #endif ] - requestTask = uni.request({..._config,...mergeKeys(optionalKeys, config)}) + requestTask = uni.request({..._config, ...mergeKeys(optionalKeys, config)}) } if (config.getTask) { config.getTask(requestTask, config)