File tree Expand file tree Collapse file tree 2 files changed +7
-22
lines changed
Expand file tree Collapse file tree 2 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,8 @@ instance.interceptors.response.use(
4242 ( response : any ) => {
4343 if ( response . data ) {
4444 if ( response . data . code !== 200 && ! ( response . data instanceof Blob ) ) {
45- if ( response . config . url . includes ( '/application/authentication' ) ) {
46- return Promise . reject ( response . data )
47- }
48- if (
49- ! response . config . url . includes ( '/valid' ) &&
50- ! response . config . url . includes ( '/tool/debug' )
51- ) {
52- MsgError ( response . data . message )
53- return Promise . reject ( response . data )
54- }
45+ MsgError ( response . data . message )
46+ return Promise . reject ( response . data )
5547 }
5648 }
5749 return response
@@ -61,20 +53,14 @@ instance.interceptors.response.use(
6153 MsgError ( err . message )
6254 console . error ( err )
6355 }
64- if ( err . response ?. status === 404 ) {
65- if ( ! err . response . config . url . includes ( '/application/authentication' ) ) {
66- router . push ( '/404 ' )
67- }
68- }
6956 if ( err . response ?. status === 401 ) {
70- if (
71- ! err . response . config . url . includes ( 'chat/open' ) &&
72- ! err . response . config . url . includes ( 'application/profile' )
73- ) {
74- router . push ( { name : 'login' } )
57+ const { chatUser } = useStore ( )
58+ if ( chatUser . accessToken ) {
59+ router . push ( { name : 'login' , params : { accessToken : chatUser . accessToken } } )
60+ } else {
61+ router . push ( '/404 ' )
7562 }
7663 }
77-
7864 if ( err . response ?. status === 403 && ! err . response . config . url . includes ( 'chat/open' ) ) {
7965 MsgError (
8066 err . response . data && err . response . data . message ? err . response . data . message : '没有权限访问' ,
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ router.beforeEach(
5151 } else {
5252 await chatUser . anonymousAuthentication ( )
5353 }
54-
5554 if ( ! chatUser . application ) {
5655 await chatUser . applicationProfile ( )
5756 }
You can’t perform that action at this time.
0 commit comments