@@ -21,6 +21,7 @@ import { api } from '@/api'
2121import { message , notification } from 'ant-design-vue'
2222import eventBus from '@/config/eventBus'
2323import store from '@/store'
24+ import { sourceToken } from '@/utils/request'
2425
2526export const pollJobPlugin = {
2627 install ( Vue ) {
@@ -177,20 +178,22 @@ export const pollJobPlugin = {
177178 }
178179 } ) . catch ( e => {
179180 console . error ( `${ catchMessage } - ${ e } ` )
180- let countNotify = store . getters . countNotify
181- countNotify ++
182- store . commit ( 'SET_COUNT_NOTIFY' , countNotify )
183- notification . error ( {
184- top : '65px' ,
185- message : i18n . t ( 'label.error' ) ,
186- description : catchMessage ,
187- duration : 0 ,
188- onClose : ( ) => {
189- let countNotify = store . getters . countNotify
190- countNotify > 0 ? countNotify -- : countNotify = 0
191- store . commit ( 'SET_COUNT_NOTIFY' , countNotify )
192- }
193- } )
181+ if ( ! sourceToken . isCancel ( e ) ) {
182+ let countNotify = store . getters . countNotify
183+ countNotify ++
184+ store . commit ( 'SET_COUNT_NOTIFY' , countNotify )
185+ notification . error ( {
186+ top : '65px' ,
187+ message : i18n . t ( 'label.error' ) ,
188+ description : catchMessage ,
189+ duration : 0 ,
190+ onClose : ( ) => {
191+ let countNotify = store . getters . countNotify
192+ countNotify > 0 ? countNotify -- : countNotify = 0
193+ store . commit ( 'SET_COUNT_NOTIFY' , countNotify )
194+ }
195+ } )
196+ }
194197 catchMethod && catchMethod ( )
195198 } )
196199 }
0 commit comments