فهرست منبع

fix[service]: 修复 code 不为 0,没有抛出异常

chenlei 1 سال پیش
والد
کامیت
52e6977c1f
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      packages/service/src/request.ts

+ 1 - 1
packages/service/src/request.ts

@@ -76,7 +76,7 @@ export function createService() {
       };
     }
 
-    if (response.errorMessage) {
+    if (response.code !== 0) {
       throw new ResponseError({
         ...response,
         errorMessage: response.errorMessage ?? "请求失败",