提交 b46081fc 编写于 作者: D DebugIsFalse

Update useFetchRequest.js

上级 dd9e129c
......@@ -9,7 +9,13 @@ const useFetchRequest = (baseUrl) => {
fetchConfig = fetchConfig || {}
fetchConfig.method = (fetchConfig.method || 'get').toLocaleUpperCase()
fetchConfig = Object.assign(config, fetchConfig)
return $fetch(url, fetchConfig)
return new Promise((resolve, reject) => {
$fetch(url, fetchConfig).then((result) => {
resolve(result)
}).catch(() => {
resolve(null)
})
})
}
return {
fetchRequest
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册