|
|
@@ -1,5 +1,6 @@
|
|
|
import { parseReceivePush } from '@/services/socket/quota/adapter/index';
|
|
|
import eventBus from '@/utils/eventBus';
|
|
|
+import { throttle } from '@/utils/time'
|
|
|
|
|
|
/**
|
|
|
* 交易通知处理,涉及各个方面
|
|
|
@@ -29,7 +30,10 @@ export const notice = (logout: Function) => {
|
|
|
eventBus.$onOnly('quoteReceiveNtf', (msg: any) => {
|
|
|
if (msg) {
|
|
|
// console.warn(msg);
|
|
|
- parseReceivePush(msg);
|
|
|
+ // 节流优化,降低推送频率,防止页面渲染更新太快导致cpu占用率过高
|
|
|
+ throttle(() => {
|
|
|
+ parseReceivePush(msg);
|
|
|
+ }, 100)
|
|
|
}
|
|
|
});
|
|
|
};
|