批量优化

This commit is contained in:
hero920103 committed 2026-10-03 23:46:55 +08:00
1 parent e3db229f41
commit aa92ca40a2
79 files changed
+7495 -1104

No files matched your search

+5 -1
View File
@@ -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
}