Browse Source

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

chenlei 1 year ago
parent
commit
52e6977c1f
1 changed files with 1 additions and 1 deletions
  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 ?? "请求失败",