yuang-framework-ui-common 1.0.59 → 1.0.61

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.
@@ -14,7 +14,8 @@ import { http } from './httpConfig';
14
14
 
15
15
  const application = {
16
16
  gatewayServerBaseUrl: '',
17
- apiBaseUrl: ''
17
+ apiBaseUrl: '',
18
+ uimsApplicationCode: ''
18
19
  };
19
20
 
20
21
  const initApplication = (app: any, config: any) => {
@@ -34,6 +35,7 @@ const initApplication = (app: any, config: any) => {
34
35
  }
35
36
  application.gatewayServerBaseUrl = Object.freeze(config.gatewayServerBaseUrl);
36
37
  application.apiBaseUrl = Object.freeze(config.apiBaseUrl);
38
+ application.uimsApplicationCode = Object.freeze(config.uimsApplicationCode);
37
39
 
38
40
  // 小程序没有window,暂时这样
39
41
  (window as any).application = Object.freeze(application);
@@ -152,16 +152,7 @@ const beforeRequestConfig = (config: any) => {
152
152
  config.headers["Sso-Access-Token"] = ssoAccessToken;
153
153
  }
154
154
 
155
- let uimsApplicationCode = '';
156
- if (config.url == `${application.gatewayServerBaseUrl}/sso-api/client/sso-user/getSsoIdentity`) {
157
- uimsApplicationCode = config.params.uimsApplicationCode
158
- setLocalStorageItem("uimsApplicationCode", uimsApplicationCode, 0);
159
- } else{
160
- uimsApplicationCode = getLocalStorageItem("uimsApplicationCode") ?? '';
161
- }
162
- if (uimsApplicationCode) {
163
- config.headers["Uims-Application-Code"] = uimsApplicationCode;
164
- }
155
+ config.headers["Uims-Application-Code"] = application.uimsApplicationCode;
165
156
 
166
157
  config.headers["Request-Id"] = new Date().getTime().toString() + (parseInt((Math.random() * 10000).toString())).toString();
167
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-common",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
package/src/main.ts CHANGED
@@ -7,13 +7,14 @@ import router from './router'
7
7
  import {initApplication} from '../lib/config/applicationConfig';
8
8
 
9
9
  const app = createApp(App)
10
- debugger
10
+
11
11
  app.use(createPinia())
12
12
  app.use(router)
13
13
 
14
14
  const config = {
15
15
  gatewayServerBaseUrl: import.meta.env.VITE_GATEWAY_SERVER_BASE_URL,
16
- apiBaseUrl: import.meta.env.VITE_API_BASE_URL
16
+ apiBaseUrl: import.meta.env.VITE_API_BASE_URL,
17
+ uimsApplicationCode: import.meta.env.VITE_UIMS_APPLICATION_CODE
17
18
  };
18
19
  initApplication(app, config);
19
20
 
@@ -32,7 +32,7 @@
32
32
  });
33
33
  };
34
34
  const getSsoIdentity = () => {
35
- http.get(`${application.gatewayServerBaseUrl}/sso-api/client/sso-user/getSsoIdentity`, { params: { uimsApplicationCode: 'yuang-sso-ui-pc' } }).then((res: any) => {
35
+ http.get(`${application.gatewayServerBaseUrl}/sso-api/client/sso-user/getSsoIdentity`).then((res: any) => {
36
36
  ssoData.ssoIdentity = res.data.data;
37
37
  console.log('ssoIdentity', ssoData.ssoIdentity);
38
38
  ElMessage.success('获取成功');