module-menu 0.3.14 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "城市大数据平台公共头部及尾部",
5
5
  "main": "src/pages/index.jsx",
6
6
  "scripts": {
@@ -129,15 +129,15 @@ const ModuleUser = ({ stash = '' }) => {
129
129
  .then((res) => {
130
130
  if (res?.data?.data?.loginoutUrl) {
131
131
  console.log('Login URL found:', res.data.data.loginoutUrl);
132
- window.location.replace(res.data.data.loginoutUrl);
132
+ window.location.href = res.data.data.loginoutUrl;
133
133
  } else {
134
134
  console.log('No login URL found, redirect to default login page.');
135
- window.location.replace('/admin-ui/login');
135
+ window.location.href = '/admin-ui/login';
136
136
  }
137
137
  })
138
138
  .catch((e) => {
139
139
  console.log('GetLoginUrl error: ', e);
140
- window.location.replace('/admin-ui/login');
140
+ window.location.href = '/admin-ui/login';
141
141
  });
142
142
  } else {
143
143
  window.location.href = DEFAULT_LOGOUT_URL;
@@ -2,7 +2,7 @@ import { message } from 'antd';
2
2
  import axios from 'axios';
3
3
  import baseCof from './config';
4
4
  import getStore from './userInfo';
5
- import { checkToken, getLoginUrl } from './permessionUtils';
5
+ import { checkToken } from './permessionUtils';
6
6
  import CONSTANT from './constant';
7
7
 
8
8
  let tokenValue = '5de3ef8171364d6ba756221655fe1310';
@@ -16,23 +16,6 @@ const stash = localStorage.getItem('stash');
16
16
  axios.interceptors.response.use(
17
17
  (response) => {
18
18
  if (response.status === 200) {
19
- if (!tokenInSessionStor && response?.data?.code === 401) {
20
- getLoginUrl()
21
- .then((res) => {
22
- if (res?.data?.data?.loginoutUrl) {
23
- console.log('Login URL found:', res.data.data.loginoutUrl);
24
- window.location.replace(res.data.data.loginoutUrl);
25
- } else {
26
- console.log('No login URL found, redirect to default login page.');
27
- window.location.replace('/admin-ui/login');
28
- }
29
- })
30
- .catch((e) => {
31
- console.log('GetLoginUrl error: ', e);
32
- window.location.replace('/admin-ui/login');
33
- });
34
- return
35
- }
36
19
  return response;
37
20
  } else if (
38
21
  response.status === 401 ||
@@ -13,15 +13,15 @@ export const checkToken = (token) => {
13
13
  .then((res) => {
14
14
  if (res?.data?.data?.loginoutUrl) {
15
15
  console.log('Login URL found:', res.data.data.loginoutUrl);
16
- window.location.replace(res.data.data.loginoutUrl);
16
+ window.location.href = res.data.data.loginoutUrl;
17
17
  } else {
18
18
  console.log('No login URL found, redirect to default login page.');
19
- window.location.replace('/admin-ui/login');
19
+ window.location.href = '/admin-ui/login';
20
20
  }
21
21
  })
22
22
  .catch((e) => {
23
23
  console.log('GetLoginUrl error: ', e);
24
- window.location.replace('/admin-ui/login');
24
+ window.location.href = '/admin-ui/login';
25
25
  });
26
26
  }});
27
27
  })