janryWang / mfetch

mfetch will provide you with a strong ability to request resource management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fetch 方法 breaking change

monkindey opened this issue · comments

commented

mfetch/src/index.js

Lines 72 to 88 in 37377a0

export const fetch = (url, _options) => {
const options = getOptions(
url,
Object.assign(
{
method: 'get',
headers: {
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
}
},
_options
)
)
if (monkey_patch_fetch) return monkey_patch_fetch(options)
return http(createParams(options), options)
}

shared-service createRequestAction 是直接 fetch($options) 的, 导致 $options 里面的 method 是 "POST", 到这里被 Object.assign 覆盖了, 也就是我没法用 POST 了。

commented

fixed by edd3d4d