yuang-framework-ui-common 1.0.92 → 1.0.94
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/dist/favicon.ico +0 -0
- package/dist/yuang-framework-ui-common.es.js +4 -0
- package/dist/yuang-framework-ui-common.umd.js +1 -0
- package/lib/config/httpConfig.ts +1 -1
- package/lib/hooks/framework/frameworkGroup.ts +2 -1
- package/lib/hooks/uims/uimsApplication.ts +2 -1
- package/lib/utils/ssoUtils.ts +7 -7
- package/package.json +1 -1
- package/src/router/index.ts +9 -9
- package/src/views/sso/{sso-auth → client/sso-auth}/index.vue +1 -1
- /package/src/views/sso/{sso-auth → client/sso-auth}/auth-success.vue +0 -0
package/dist/favicon.ico
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e["yuang-framework-ui-common"]=n())})(this,function(){"use strict";return{}});
|
package/lib/config/httpConfig.ts
CHANGED
|
@@ -102,7 +102,7 @@ http.interceptors.response.use(async (res: any) => {
|
|
|
102
102
|
} else if (res?.data?.statusCode === 500815006) {
|
|
103
103
|
// 这里存疑: 返回500815004 的时候获取router为null
|
|
104
104
|
const fullPath = router.currentRoute.value.fullPath;
|
|
105
|
-
router.push(`/sso/sso-auth/index?ssoRedirectRoutePath=${encodeURIComponent(fullPath)}`);
|
|
105
|
+
router.push(`/sso/client/sso-auth/index?ssoRedirectRoutePath=${encodeURIComponent(fullPath)}`);
|
|
106
106
|
return;
|
|
107
107
|
} else if (res?.data?.statusCode === 500815003) {
|
|
108
108
|
showErrorMessage(res?.data?.message || messageMap.requestError);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { nextTick } from 'vue';
|
|
2
2
|
import { http } from '../../../lib/config/httpConfig';
|
|
3
|
+
import { application } from '../../../lib/config/applicationConfig';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* 处理分组树默认展开节点,由于树组件的默认展开节点是异步的,所以需要手动处理默认展开节点
|
|
@@ -9,7 +10,7 @@ const handleFrameworkGroupTreeDefaultExpandNode = async ({ id, treeId }) => {
|
|
|
9
10
|
console.error(`参数[treeId]不存在`);
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
|
-
const res = await http.post(
|
|
13
|
+
const res = await http.post(`${application.gatewayServerBaseUrl}/framework-api/core/framework-group/selectAncestorList`, { idForEqual: id, isReverseAncestorList: true });
|
|
13
14
|
const ancestorList = res.data.data;
|
|
14
15
|
expandNodeImpl({ ancestorList, index: 0, treeId });
|
|
15
16
|
};
|
package/lib/utils/ssoUtils.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { getIsDebug } from '../utils/htmlUtils';
|
|
|
12
12
|
* @param ssoRedirectUrl
|
|
13
13
|
*/
|
|
14
14
|
const getSsoLoginUrl = (ssoRedirectUrl = '') => {
|
|
15
|
-
if(getIsDebug) {
|
|
15
|
+
if(getIsDebug()) {
|
|
16
16
|
debugger;
|
|
17
17
|
}
|
|
18
18
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
|
@@ -36,7 +36,7 @@ const getSsoLoginUrl = (ssoRedirectUrl = '') => {
|
|
|
36
36
|
* @param ssoRedirectUrl
|
|
37
37
|
*/
|
|
38
38
|
const getSsoAuthUrl = (ssoRedirectUrl = '') => {
|
|
39
|
-
if(getIsDebug) {
|
|
39
|
+
if(getIsDebug()) {
|
|
40
40
|
debugger;
|
|
41
41
|
}
|
|
42
42
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
|
@@ -60,7 +60,7 @@ const getSsoAuthUrl = (ssoRedirectUrl = '') => {
|
|
|
60
60
|
* @param ssoRedirectUrl
|
|
61
61
|
*/
|
|
62
62
|
const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
|
|
63
|
-
if(getIsDebug) {
|
|
63
|
+
if(getIsDebug()) {
|
|
64
64
|
debugger;
|
|
65
65
|
}
|
|
66
66
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
|
@@ -84,16 +84,16 @@ const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
|
|
|
84
84
|
* @param ssoRedirectRoutePath
|
|
85
85
|
*/
|
|
86
86
|
const getSsoAuthRoutePath = (ssoRedirectRoutePath = '') => {
|
|
87
|
-
if(getIsDebug) {
|
|
87
|
+
if(getIsDebug()) {
|
|
88
88
|
debugger;
|
|
89
89
|
}
|
|
90
|
-
let ssoAuthRoutePath = '/sso/sso-auth/index';
|
|
90
|
+
let ssoAuthRoutePath = '/sso/client/sso-auth/index';
|
|
91
91
|
if (!ssoRedirectRoutePath) {
|
|
92
|
-
ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent('/sso/sso-auth/auth-success')}`;
|
|
92
|
+
ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent('/sso/client/sso-auth/auth-success')}`;
|
|
93
93
|
} else {
|
|
94
94
|
ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent(ssoRedirectRoutePath)}`;
|
|
95
95
|
}
|
|
96
|
-
if(getIsDebug) {
|
|
96
|
+
if(getIsDebug()) {
|
|
97
97
|
console.log('ssoAuthRoutePath', ssoAuthRoutePath);
|
|
98
98
|
}
|
|
99
99
|
return ssoAuthRoutePath;
|
package/package.json
CHANGED
package/src/router/index.ts
CHANGED
|
@@ -8,16 +8,16 @@ const router = createRouter({
|
|
|
8
8
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
9
9
|
routes: [
|
|
10
10
|
{
|
|
11
|
-
path: '/sso/sso-auth/index',
|
|
12
|
-
component: () => import('@/views/sso/sso-auth/index.vue'),
|
|
11
|
+
path: '/sso/client/sso-auth/index',
|
|
12
|
+
component: () => import('@/views/sso/client/sso-auth/index.vue'),
|
|
13
13
|
meta: {
|
|
14
14
|
title: '认证',
|
|
15
|
-
|
|
15
|
+
isSsoClientExcluded: true
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
path: '/sso/sso-auth/auth-success',
|
|
20
|
-
component: () => import('@/views/sso/sso-auth/auth-success.vue'),
|
|
19
|
+
path: '/sso/client/sso-auth/auth-success',
|
|
20
|
+
component: () => import('@/views/sso/client/sso-auth/auth-success.vue'),
|
|
21
21
|
meta: {
|
|
22
22
|
title: '认证成功',
|
|
23
23
|
}
|
|
@@ -46,21 +46,21 @@ const router = createRouter({
|
|
|
46
46
|
path: '/utils/gateway-utils',
|
|
47
47
|
component: () => import('@/views/utils/gateway-utils.vue'),
|
|
48
48
|
meta: {
|
|
49
|
-
|
|
49
|
+
isSsoClientExcluded: true
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
path: '/utils/http-utils',
|
|
54
54
|
component: () => import('@/views/utils/http-utils.vue'),
|
|
55
55
|
meta: {
|
|
56
|
-
|
|
56
|
+
isSsoClientExcluded: true
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
path: '/hooks/framework/framework-sse-client',
|
|
61
61
|
component: () => import('@/views/hooks/framework/framework-sse-client.vue'),
|
|
62
62
|
meta: {
|
|
63
|
-
|
|
63
|
+
isSsoClientExcluded: false
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
|
|
@@ -79,7 +79,7 @@ const router = createRouter({
|
|
|
79
79
|
/* 路由守卫 */
|
|
80
80
|
router.beforeEach(async (to) => {
|
|
81
81
|
if (!getSsoAccessToken()) {
|
|
82
|
-
if (!to.meta?.
|
|
82
|
+
if (!to.meta?.isSsoClientExcluded) {
|
|
83
83
|
return getSsoAuthRoutePath(to.fullPath);
|
|
84
84
|
}
|
|
85
85
|
return;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
http.get(`${application.gatewayServerBaseUrl}/sso-api/client/sso-auth/getSsoAccessToken`, { params: { ssoAuthCode: ssoAuthCode } }).then((res: any) => {
|
|
27
27
|
setSsoAccessToken(res.data.data);
|
|
28
28
|
let ssoRedirectRoutePath = router.currentRoute.value.query.ssoRedirectRoutePath as string;
|
|
29
|
-
ssoRedirectRoutePath = (ssoRedirectRoutePath && decodeURIComponent(ssoRedirectRoutePath)) || ('/sso/sso-auth/auth-success' as any);
|
|
29
|
+
ssoRedirectRoutePath = (ssoRedirectRoutePath && decodeURIComponent(ssoRedirectRoutePath)) || ('/sso/client/sso-auth/auth-success' as any);
|
|
30
30
|
ssoRedirectRoutePath = removeParameter('ssoAuthCode', ssoRedirectRoutePath) || '';
|
|
31
31
|
router.push(ssoRedirectRoutePath);
|
|
32
32
|
});
|
|
File without changes
|