yuang-framework-ui-common 1.0.56 → 1.0.58
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/lib/config/httpConfig.ts
CHANGED
@@ -36,6 +36,7 @@ http.interceptors.request.use(async config => {
|
|
36
36
|
if (!gatewayAccessToken && config.url != `${application.gatewayServerBaseUrl}/server/gateway-config/getGatewayConfig`) {
|
37
37
|
await initGateway();
|
38
38
|
}
|
39
|
+
|
39
40
|
beforeRequestConfig(config);
|
40
41
|
return config;
|
41
42
|
}, error => {
|
@@ -150,6 +151,18 @@ const beforeRequestConfig = (config: any) => {
|
|
150
151
|
if (ssoAccessToken) {
|
151
152
|
config.headers["Sso-Access-Token"] = ssoAccessToken;
|
152
153
|
}
|
154
|
+
|
155
|
+
let uimsApplicationCode = '';
|
156
|
+
if (config.url == `${application.gatewayServerBaseUrl}/gateway-server/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
|
+
}
|
165
|
+
|
153
166
|
config.headers["Request-Id"] = new Date().getTime().toString() + (parseInt((Math.random() * 10000).toString())).toString();
|
154
167
|
}
|
155
168
|
|
package/package.json
CHANGED
package/src/router/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import {createRouter, createWebHistory} from 'vue-router'
|
2
|
-
import {getExceptionRoutes} from '../../lib/utils/
|
2
|
+
import {getExceptionRoutes} from '../../lib/utils/routerUtils'
|
3
3
|
|
4
4
|
import { getSsoAccessToken, getSsoAuthRoutePath } from '../../lib/utils/ssoUtils';
|
5
5
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
});
|
33
33
|
};
|
34
34
|
const getSsoIdentity = () => {
|
35
|
-
http.get(`${application.gatewayServerBaseUrl}/sso-api/client/sso-user/getSsoIdentity`, { params: {
|
35
|
+
http.get(`${application.gatewayServerBaseUrl}/sso-api/client/sso-user/getSsoIdentity`, { params: { uimsApplicationCode: 'yuang-sso-ui-pc' } }).then((res: any) => {
|
36
36
|
ssoData.ssoIdentity = res.data.data;
|
37
37
|
console.log('ssoIdentity', ssoData.ssoIdentity);
|
38
38
|
ElMessage.success('获取成功');
|
File without changes
|