yuang-framework-ui-common 1.0.51 → 1.0.53

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.
@@ -10,7 +10,7 @@ import { getSsoLoginUrl, clearSsoAccessToken, setSsoAccessToken } from '../utils
10
10
 
11
11
  import { clearGatewayConfig, initGatewayConfig, getGatewayConfigUrl } from '../config/gatewayConfig';
12
12
 
13
- import { getLocalStorageItem } from '../utils/storageUtils'
13
+ import { getLocalStorageItem, setLocalStorageItem } from '../utils/storageUtils'
14
14
 
15
15
  const router = useRouter();
16
16
 
@@ -85,6 +85,10 @@ http.interceptors.response.use(async (res: any) => {
85
85
  } else if (res?.data?.statusCode === 500815005) {
86
86
  await refreshSsoAccessToken(res);
87
87
  // 重发请求
88
+ let ssoAccessToken = getLocalStorageItem('ssoAccessToken');
89
+ if (ssoAccessToken) {
90
+ res.config.headers["Sso-Access-Token"] = ssoAccessToken;
91
+ }
88
92
  return axios.request(res.config);
89
93
  } else if (res?.data?.statusCode === 500815006) {
90
94
  const fullPath = router.currentRoute.value.fullPath;
@@ -10,11 +10,11 @@ import 'vant/lib/index.css';
10
10
 
11
11
 
12
12
  import {http} from './httpConfig';
13
- import moment from 'moment';
13
+ // import moment from 'moment';
14
14
 
15
15
  const initConfig = (app: any, config: any) => {
16
- app.config.globalProperties.$http = http;
17
- app.config.globalProperties.$moment = moment;
16
+ // app.config.globalProperties.$http = http;
17
+ // app.config.globalProperties.$moment = moment;
18
18
 
19
19
  if (isPc()) {
20
20
  app.config.globalProperties.$message = ElMessage;
@@ -5,7 +5,7 @@ import { getLocalStorageItem, setLocalStorageItem, removeLocalStorageItem } from
5
5
 
6
6
 
7
7
  const getSsoLoginUrl = (ssoRedirectUrl = '') => {
8
- let apiFullBaseUrl = (window as any).$config?.apiFullBaseUrl;
8
+ let apiFullBaseUrl = (window as any).$config?.ssoApiFullBaseUrl || (window as any).$config?.apiFullBaseUrl;
9
9
  if (!apiFullBaseUrl) {
10
10
  throw new Error('参数[apiFullBaseUrl]为空');
11
11
  }
@@ -19,7 +19,7 @@ const getSsoLoginUrl = (ssoRedirectUrl = '') => {
19
19
  }
20
20
 
21
21
  const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
22
- let apiFullBaseUrl = (window as any).$config?.apiFullBaseUrl;
22
+ let apiFullBaseUrl = (window as any).$config?.ssoApiFullBaseUrl || (window as any).$config?.apiFullBaseUrl;
23
23
  if (!apiFullBaseUrl) {
24
24
  throw new Error('参数[apiFullBaseUrl]为空');
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-common",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {