api.data 让可以修改

This commit is contained in:
liaoxuezhi 2019-11-25 19:01:37 +08:00
parent df29f412e3
commit 7fc5d7a136
1 changed files with 3 additions and 2 deletions

View File

@ -8,7 +8,8 @@ import {
isObjectShallowModified,
hasFile,
object2formData,
qsstringify
qsstringify,
cloneObject
} from './helper';
const rSchema = /(?:^|raw\:)(get|post|put|delete|patch|options|head):/i;
@ -75,7 +76,7 @@ export function buildApi(
if (api.data) {
api.data = dataMapping(api.data, data);
} else if (api.method === 'post' || api.method === 'put') {
api.data = data;
api.data = cloneObject(data);
}
// get 类请求,把 data 附带到 url 上。