|
|
@@ -49,8 +49,10 @@ service.interceptors.response.use(
|
|
|
(res) => {
|
|
|
// token 自动续期
|
|
|
|
|
|
- window.businessstatus = res;
|
|
|
- console.log(window, 'res');
|
|
|
+ if (window.__POWERED_BY_QIANKUN__) {
|
|
|
+ console.log('主应用的 window 对象:', window.parent);
|
|
|
+ window.parent.window.businessstatus = error;
|
|
|
+ }
|
|
|
|
|
|
// && res.config?.showErrorToast !== false
|
|
|
if (Number(res.data.code) == -1) {
|
|
|
@@ -76,8 +78,10 @@ service.interceptors.response.use(
|
|
|
return res;
|
|
|
},
|
|
|
(error) => {
|
|
|
- console.log(error, 'error');
|
|
|
- window.businessstatus = error;
|
|
|
+ if (window.__POWERED_BY_QIANKUN__) {
|
|
|
+ console.log('主应用的 window 对象:', window.parent);
|
|
|
+ window.parent.window.businessstatus = error;
|
|
|
+ }
|
|
|
// 登录过期处理
|
|
|
if (error?.response?.status === 401) {
|
|
|
const currentPath = router.currentRoute.path;
|