File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,19 @@ export const request: RequestConfig = {
2626 } ,
2727 errorHandler : ( err ) => {
2828 console . log ( 'errorHandler' , err ) ;
29+ const { options : { HIDE_ERROR_MESSAGE } = { } } = err . config || { } ;
30+
2931 if ( err ?. response ?. status === 401 ) {
3032 location . href = '/#/login' ;
3133 } else {
32- message . error ( err ?. response ?. data ?. message || err . message ) ;
34+ if ( ! HIDE_ERROR_MESSAGE ) {
35+ message . error ( err ?. response ?. data ?. message || err . message ) ;
36+ }
3337 }
3438 } ,
3539 } ,
3640} ;
41+
3742export const rootContainer = ( element : JSX . Element ) => {
3843 const locale = getLocale ( ) || 'zh-CN' ;
3944 request . headers = {
Original file line number Diff line number Diff line change @@ -151,5 +151,8 @@ export async function reportData({
151151 } ) ,
152152 component : appInfo . appName ,
153153 } ,
154+ options : {
155+ HIDE_ERROR_MESSAGE : true ,
156+ } ,
154157 } ) ;
155158}
You can’t perform that action at this time.
0 commit comments