Browse Source

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

chenlei 1 năm trước cách đây
mục cha
commit
52e6977c1f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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({
       throw new ResponseError({
         ...response,
         ...response,
         errorMessage: response.errorMessage ?? "请求失败",
         errorMessage: response.errorMessage ?? "请求失败",