yuang-framework-ui-common 1.0.94 → 1.0.95
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/applicationConfig.ts +2 -7
- package/lib/config/gatewayConfig.ts +1 -2
- package/lib/config/httpConfig.ts +2 -2
- package/lib/hooks/framework/frameworkGroup.ts +1 -2
- package/lib/hooks/uims/uimsApplication.ts +1 -2
- package/package.json +1 -1
- package/src/main.ts +0 -1
- package/src/views/sso/client/sso-auth/auth-success.vue +2 -3
- package/src/views/sso/client/sso-auth/index.vue +1 -2
|
@@ -14,7 +14,6 @@ import { http } from './httpConfig';
|
|
|
14
14
|
|
|
15
15
|
const application = {
|
|
16
16
|
gatewayServerBaseUrl: '',
|
|
17
|
-
apiBaseUrl: '',
|
|
18
17
|
uimsApplicationCode: ''
|
|
19
18
|
};
|
|
20
19
|
|
|
@@ -28,13 +27,9 @@ const initApplication = (app: any, config: any) => {
|
|
|
28
27
|
} else {
|
|
29
28
|
app.use(vant);
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
http.defaults.baseURL = config?.gatewayServerBaseUrl;
|
|
35
|
-
}
|
|
30
|
+
http.defaults.baseURL = config?.gatewayServerBaseUrl;
|
|
31
|
+
|
|
36
32
|
application.gatewayServerBaseUrl = Object.freeze(config.gatewayServerBaseUrl);
|
|
37
|
-
application.apiBaseUrl = Object.freeze(config.apiBaseUrl);
|
|
38
33
|
application.uimsApplicationCode = Object.freeze(config.uimsApplicationCode);
|
|
39
34
|
|
|
40
35
|
// 小程序没有window,暂时这样
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { http } from '../config/httpConfig';
|
|
2
2
|
import { getLocalStorageItem, setLocalStorageItem, removeLocalStorageItem } from '../utils/storageUtils';
|
|
3
|
-
import { application } from "./applicationConfig";
|
|
4
3
|
|
|
5
4
|
const initGateway = () => {
|
|
6
5
|
return new Promise<void>(async resolve => {
|
|
7
|
-
let res = await http.get(
|
|
6
|
+
let res = await http.get(`/server/gateway-config/getGatewayConfig`);
|
|
8
7
|
setLocalStorageItem("gatewayAccessToken", res.data.data.gatewayAccessToken, res.data.data.gatewayTimeout);
|
|
9
8
|
setLocalStorageItem("gatewayPublicKey", res.data.data.gatewayPublicKey, res.data.data.gatewayTimeout);
|
|
10
9
|
resolve();
|
package/lib/config/httpConfig.ts
CHANGED
|
@@ -36,7 +36,7 @@ const http = axios.create({
|
|
|
36
36
|
/* 请求拦截 */
|
|
37
37
|
http.interceptors.request.use(async config => {
|
|
38
38
|
let gatewayAccessToken = getLocalStorageItem("gatewayAccessToken") ?? '';
|
|
39
|
-
if (!gatewayAccessToken && config.url !=
|
|
39
|
+
if (!gatewayAccessToken && config.url != `/server/gateway-config/getGatewayConfig`) {
|
|
40
40
|
await initGateway();
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -187,7 +187,7 @@ const refreshSsoAccessToken = (res: any) => {
|
|
|
187
187
|
config.params = {
|
|
188
188
|
ssoRefreshToken: ssoRefreshToken,
|
|
189
189
|
}
|
|
190
|
-
http.get(
|
|
190
|
+
http.get(`/sso-api/client/sso-auth/getSsoRefreshToken`, config).then(res => {
|
|
191
191
|
if (res?.data?.statusCode !== 200) {
|
|
192
192
|
if (res?.data?.statusCode === 500815001) {
|
|
193
193
|
clearSsoAccessToken();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { nextTick } from 'vue';
|
|
2
2
|
import { http } from '../../../lib/config/httpConfig';
|
|
3
|
-
import { application } from '../../../lib/config/applicationConfig';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* 处理分组树默认展开节点,由于树组件的默认展开节点是异步的,所以需要手动处理默认展开节点
|
|
@@ -10,7 +9,7 @@ const handleFrameworkGroupTreeDefaultExpandNode = async ({ id, treeId }) => {
|
|
|
10
9
|
console.error(`参数[treeId]不存在`);
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
|
-
const res = await http.post(
|
|
12
|
+
const res = await http.post(`/framework-api/core/framework-group/selectAncestorList`, { idForEqual: id, isReverseAncestorList: true });
|
|
14
13
|
const ancestorList = res.data.data;
|
|
15
14
|
expandNodeImpl({ ancestorList, index: 0, treeId });
|
|
16
15
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { http } from '../../../lib/config/httpConfig';
|
|
2
|
-
import { application } from '../../../lib/config/applicationConfig';
|
|
3
2
|
|
|
4
3
|
// import { toTree } from 'yuang-framework-ui-pc/es';
|
|
5
4
|
|
|
@@ -10,7 +9,7 @@ const queryUimsApplicationTreeData = ({ applicationName }) => {
|
|
|
10
9
|
return new Promise((resolve, reject) => {
|
|
11
10
|
const data = { parentIdForEqual: '0', nameForLike: applicationName };
|
|
12
11
|
// prettier-ignore
|
|
13
|
-
http.post(
|
|
12
|
+
http.post(`/uims-api/admin/uims-application/selectPage`, data).then(res=>{
|
|
14
13
|
const listData = [
|
|
15
14
|
{
|
|
16
15
|
id: '0',
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -13,7 +13,6 @@ 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,
|
|
17
16
|
uimsApplicationCode: import.meta.env.VITE_UIMS_APPLICATION_CODE
|
|
18
17
|
};
|
|
19
18
|
initApplication(app, config);
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
import { getSsoAccessToken, logoutSso } from '../../../../lib/utils/ssoUtils';
|
|
15
15
|
import { http } from '../../../../lib/config/httpConfig';
|
|
16
|
-
import { application } from "../../../../lib/config/applicationConfig";
|
|
17
16
|
|
|
18
17
|
let ssoData = reactive({
|
|
19
18
|
ssoTokenUser: {},
|
|
@@ -25,14 +24,14 @@
|
|
|
25
24
|
getSsoTokenUser();
|
|
26
25
|
});
|
|
27
26
|
const getSsoTokenUser = () => {
|
|
28
|
-
http.get(
|
|
27
|
+
http.get(`/sso-api/client/sso-user/getSsoTokenUser`).then((res: any) => {
|
|
29
28
|
ssoData.ssoTokenUser = res.data.data;
|
|
30
29
|
console.log('ssoTokenUser', ssoData.ssoTokenUser);
|
|
31
30
|
ElMessage.success('获取成功');
|
|
32
31
|
});
|
|
33
32
|
};
|
|
34
33
|
const getSsoIdentity = () => {
|
|
35
|
-
http.get(
|
|
34
|
+
http.get(`/sso-api/client/sso-user/getSsoIdentity`).then((res: any) => {
|
|
36
35
|
ssoData.ssoIdentity = res.data.data;
|
|
37
36
|
console.log('ssoIdentity', ssoData.ssoIdentity);
|
|
38
37
|
ElMessage.success('获取成功');
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { getCurrentInstance, onMounted } from 'vue';
|
|
7
7
|
import { useRouter } from 'vue-router';
|
|
8
8
|
|
|
9
|
-
import { application } from '../../../../lib/config/applicationConfig';
|
|
10
9
|
import { getSsoAuthUrl, setSsoAccessToken } from '../../../../lib/utils/ssoUtils';
|
|
11
10
|
import { removeParameter } from '../../../../lib/utils/urlUtils';
|
|
12
11
|
import { http } from '../../../../lib/config/httpConfig';
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
http.get(
|
|
25
|
+
http.get(`/sso-api/client/sso-auth/getSsoAccessToken`, { params: { ssoAuthCode: ssoAuthCode } }).then((res: any) => {
|
|
27
26
|
setSsoAccessToken(res.data.data);
|
|
28
27
|
let ssoRedirectRoutePath = router.currentRoute.value.query.ssoRedirectRoutePath as string;
|
|
29
28
|
ssoRedirectRoutePath = (ssoRedirectRoutePath && decodeURIComponent(ssoRedirectRoutePath)) || ('/sso/client/sso-auth/auth-success' as any);
|