批量优化
This commit is contained in:
1 parent
e3db229f41
commit
aa92ca40a2
79 files changed
+7495
-1104
No files matched your search
@@ -121,7 +121,11 @@ export function request(options = {}) {
|
||||
if (status < 200 || status >= 300) {
|
||||
const msg = body.msg || `请求失败(${status})`
|
||||
if (!silent) uni.showToast({ title: msg, icon: 'none' })
|
||||
reject(new Error(msg))
|
||||
const err = new Error(msg)
|
||||
// 保留响应体:登录等接口用 reason 等字段做差异化引导
|
||||
err.code = typeof body.code !== 'undefined' ? body.code : status
|
||||
err.response = body
|
||||
reject(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user