Kaynağa Gözat

退出登录时不提示订阅失败

li.shaoyi 3 yıl önce
ebeveyn
işleme
7aabd7f441
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      src/services/socket/quota/index.ts

+ 6 - 1
src/services/socket/quota/index.ts

@@ -3,6 +3,7 @@ import { funCode } from '@/services/funcode/index';
 import { buildSubscribePeq, parseSubscribeRsp } from '@/services/socket/quota/adapter/index';
 import { Callback } from '@/utils/websocket/index';
 import { SubscribeInfoType } from './interface';
+import { isLogin } from '@/services/bus/login';
 
 const subscribeGoodsList = new Map<string, SubscribeInfoType[]>(); // 订阅商品数据中心池
 
@@ -42,7 +43,11 @@ function actionSubcribe() {
                         console.log('订阅失败:', err);
                     });
             },
-            onFail: (err) => console.log('订阅失败:', err),
+            onFail: (err) => {
+                if (isLogin()) {
+                    console.log('订阅失败:', err)
+                }
+            },
         } as Callback);
     }
 }