yuang-framework-ui-common 1.0.89 → 1.0.91
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 +2 -2
- package/lib/utils/ssoUtils.ts +16 -0
- package/package.json +1 -1
package/lib/config/httpConfig.ts
CHANGED
|
@@ -10,11 +10,11 @@ import { alertMessageBox } from '../utils/messageBoxUtils';
|
|
|
10
10
|
|
|
11
11
|
import { application } from '../config/applicationConfig';
|
|
12
12
|
import { getSsoLoginUrl, clearSsoAccessToken, setSsoAccessToken } from '../utils/ssoUtils';
|
|
13
|
-
import { getIsDebug
|
|
13
|
+
import { getIsDebug } from '../utils/htmlUtils';
|
|
14
14
|
|
|
15
15
|
import { clearGateway, initGateway } from '../config/gatewayConfig';
|
|
16
16
|
|
|
17
|
-
import { getLocalStorageItem
|
|
17
|
+
import { getLocalStorageItem } from '../utils/storageUtils'
|
|
18
18
|
import { removeParameter } from "../utils/urlUtils";
|
|
19
19
|
|
|
20
20
|
const router = useRouter();
|
package/lib/utils/ssoUtils.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { rsaEncrypt } from './rsaUtils';
|
|
|
4
4
|
import { isFullUrl } from './urlUtils';
|
|
5
5
|
import { getLocalStorageItem, setLocalStorageItem, removeLocalStorageItem } from './storageUtils';
|
|
6
6
|
import { application } from '../config/applicationConfig';
|
|
7
|
+
import { getIsDebug } from '../utils/htmlUtils';
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -11,6 +12,9 @@ import { application } from '../config/applicationConfig';
|
|
|
11
12
|
* @param ssoRedirectUrl
|
|
12
13
|
*/
|
|
13
14
|
const getSsoLoginUrl = (ssoRedirectUrl = '') => {
|
|
15
|
+
if(getIsDebug) {
|
|
16
|
+
debugger;
|
|
17
|
+
}
|
|
14
18
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
|
15
19
|
if (!gatewayServerBaseUrl) {
|
|
16
20
|
throw new Error('参数[gatewayServerBaseUrl]为空');
|
|
@@ -32,6 +36,9 @@ const getSsoLoginUrl = (ssoRedirectUrl = '') => {
|
|
|
32
36
|
* @param ssoRedirectUrl
|
|
33
37
|
*/
|
|
34
38
|
const getSsoAuthUrl = (ssoRedirectUrl = '') => {
|
|
39
|
+
if(getIsDebug) {
|
|
40
|
+
debugger;
|
|
41
|
+
}
|
|
35
42
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
|
36
43
|
if (!gatewayServerBaseUrl) {
|
|
37
44
|
throw new Error('参数[gatewayServerBaseUrl]为空');
|
|
@@ -53,6 +60,9 @@ const getSsoAuthUrl = (ssoRedirectUrl = '') => {
|
|
|
53
60
|
* @param ssoRedirectUrl
|
|
54
61
|
*/
|
|
55
62
|
const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
|
|
63
|
+
if(getIsDebug) {
|
|
64
|
+
debugger;
|
|
65
|
+
}
|
|
56
66
|
let gatewayServerBaseUrl = application.gatewayServerBaseUrl;
|
|
57
67
|
if (!gatewayServerBaseUrl) {
|
|
58
68
|
throw new Error('参数[gatewayServerBaseUrl]为空');
|
|
@@ -74,12 +84,18 @@ const getSsoLogoutUrl = (ssoRedirectUrl = '') => {
|
|
|
74
84
|
* @param ssoRedirectRoutePath
|
|
75
85
|
*/
|
|
76
86
|
const getSsoAuthRoutePath = (ssoRedirectRoutePath = '') => {
|
|
87
|
+
if(getIsDebug) {
|
|
88
|
+
debugger;
|
|
89
|
+
}
|
|
77
90
|
let ssoAuthRoutePath = '/sso/sso-auth/index';
|
|
78
91
|
if (!ssoRedirectRoutePath) {
|
|
79
92
|
ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent('/sso/sso-auth/auth-success')}`;
|
|
80
93
|
} else {
|
|
81
94
|
ssoAuthRoutePath += `?ssoRedirectRoutePath=${encodeURIComponent(ssoRedirectRoutePath)}`;
|
|
82
95
|
}
|
|
96
|
+
if(getIsDebug) {
|
|
97
|
+
console.log('ssoAuthRoutePath', ssoAuthRoutePath);
|
|
98
|
+
}
|
|
83
99
|
return ssoAuthRoutePath;
|
|
84
100
|
}
|
|
85
101
|
|