yuang-framework-ui-common 1.0.81 → 1.0.83
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/interface/framework/frameworkLog.ts +2 -0
- package/lib/interface/gateway/gatewayRoute.ts +4 -4
- package/lib/utils/aesUtils.ts +9 -0
- package/lib/utils/ssoUtils.ts +32 -0
- package/package.json +1 -1
- package/dist/favicon.ico +0 -0
- package/dist/yuang-framework-ui-common.es.js +0 -4
- package/dist/yuang-framework-ui-common.umd.js +0 -1
@@ -5,8 +5,8 @@ import type { FrameworkBase, FrameworkBaseQueryParam } from '../framework/framew
|
|
5
5
|
*/
|
6
6
|
export interface GatewayRoute extends FrameworkBase {
|
7
7
|
routeId?: string;
|
8
|
-
|
9
|
-
|
8
|
+
name?: string;
|
9
|
+
forwardTargetUrl?: string;
|
10
10
|
predicateRoutePath?: string;
|
11
11
|
status?: number;
|
12
12
|
|
@@ -16,7 +16,7 @@ export interface GatewayRoute extends FrameworkBase {
|
|
16
16
|
* 网关路由搜索条件
|
17
17
|
*/
|
18
18
|
export interface UimsApiQueryParam extends FrameworkBaseQueryParam {
|
19
|
-
|
20
|
-
|
19
|
+
identifierForLike?: string;
|
20
|
+
nameForLike?: string;
|
21
21
|
statusForEqual?: number;
|
22
22
|
}
|
package/lib/utils/aesUtils.ts
CHANGED
@@ -17,6 +17,14 @@ const getAesRandomKey = () => {
|
|
17
17
|
return randomKey
|
18
18
|
}
|
19
19
|
|
20
|
+
/**
|
21
|
+
* 获取Aec静态key
|
22
|
+
*/
|
23
|
+
const getAesStaticKey = () => {
|
24
|
+
return "yuang-framework$";
|
25
|
+
}
|
26
|
+
|
27
|
+
|
20
28
|
/**
|
21
29
|
* aes加密
|
22
30
|
* @param aesKey
|
@@ -52,6 +60,7 @@ const aesDecrypt = (aesKey:string, originalData:string) => {
|
|
52
60
|
|
53
61
|
export {
|
54
62
|
getAesRandomKey,
|
63
|
+
getAesStaticKey,
|
55
64
|
aesEncrypt,
|
56
65
|
aesDecrypt
|
57
66
|
}
|
package/lib/utils/ssoUtils.ts
CHANGED
@@ -6,6 +6,10 @@ import { getLocalStorageItem, setLocalStorageItem, removeLocalStorageItem } from
|
|
6
6
|
import { application } from '../config/applicationConfig';
|
7
7
|
|
8
8
|
|
9
|
+
/**
|
10
|
+
* 获取sso登录地址
|
11
|
+
* @param ssoRedirectUrl
|
12
|
+
*/
|
9
13
|
const getSsoLoginUrl = (ssoRedirectUrl = '') => {
|
10
14
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
11
15
|
if (!gatewayServerBaseUrl) {
|
@@ -23,6 +27,31 @@ const getSsoLoginUrl = (ssoRedirectUrl = '') => {
|
|
23
27
|
return ssoLoginUrl;
|
24
28
|
}
|
25
29
|
|
30
|
+
/**
|
31
|
+
* 获取sso认证地址
|
32
|
+
* @param ssoRedirectUrl
|
33
|
+
*/
|
34
|
+
const getSsoAuthUrl = (ssoRedirectUrl = '') => {
|
35
|
+
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
36
|
+
if (!gatewayServerBaseUrl) {
|
37
|
+
throw new Error('参数[gatewayServerBaseUrl]为空');
|
38
|
+
}
|
39
|
+
if (!isFullUrl(gatewayServerBaseUrl)) {
|
40
|
+
throw new Error('参数[gatewayServerBaseUrl]必须是完整路径');
|
41
|
+
}
|
42
|
+
let ssoAuthUrl = `${gatewayServerBaseUrl}/sso-api/server/sso/auth`;
|
43
|
+
if (!ssoRedirectUrl) {
|
44
|
+
ssoAuthUrl += `?ssoRedirectUrl=${encodeURIComponent(window.location.href)}`;
|
45
|
+
} else {
|
46
|
+
ssoAuthUrl += `?ssoRedirectUrl=${encodeURIComponent(ssoRedirectUrl)}`;
|
47
|
+
}
|
48
|
+
return ssoAuthUrl;
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* 获取sso注销地址
|
53
|
+
* @param ssoRedirectUrl
|
54
|
+
*/
|
26
55
|
const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
|
27
56
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
28
57
|
if (!gatewayServerBaseUrl) {
|
@@ -91,6 +120,7 @@ const getSsoEncryptList = (passwordList = []) => {
|
|
91
120
|
|
92
121
|
|
93
122
|
const ssoAccessTokenCookieKey: string = 'Sso-Access-Token';
|
123
|
+
const ssoRefreshTokenCookieKey: string = 'Sso-Refresh-Token';
|
94
124
|
const ssoAccessTokenLocalKey: string = 'ssoAccessToken';
|
95
125
|
const ssoRefreshTokenLocalKey: string = 'ssoRefreshToken';
|
96
126
|
|
@@ -153,6 +183,7 @@ const setSsoCookieAccessToken = (param: any) => {
|
|
153
183
|
|
154
184
|
const clearSsoAccessToken = () => {
|
155
185
|
Cookies.remove(ssoAccessTokenCookieKey);
|
186
|
+
Cookies.remove(ssoRefreshTokenCookieKey);
|
156
187
|
|
157
188
|
removeLocalStorageItem(ssoAccessTokenLocalKey);
|
158
189
|
removeLocalStorageItem(ssoRefreshTokenLocalKey);
|
@@ -167,6 +198,7 @@ const logoutSso = () => {
|
|
167
198
|
|
168
199
|
export {
|
169
200
|
getSsoLoginUrl,
|
201
|
+
getSsoAuthUrl,
|
170
202
|
getSsoLogoutUrl,
|
171
203
|
getSsoAuthRoutePath,
|
172
204
|
|
package/package.json
CHANGED
package/dist/favicon.ico
DELETED
Binary file
|
@@ -1 +0,0 @@
|
|
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{}});
|