@lambo-design/shared 1.0.0-beta.237 → 1.0.0-beta.239
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/config/config.js +51 -51
- package/config/env.js +4 -4
- package/config/index.js +7 -7
- package/config/themes/atrovirens/atrovirens.css +575 -575
- package/config/themes/atrovirens/atrovirens.less +667 -667
- package/config/themes/atrovirens/var.less +674 -674
- package/config/themes/blue/blue.css +575 -575
- package/config/themes/blue/blue.less +669 -669
- package/config/themes/blue/var.less +677 -677
- package/config/themes/blue-white/blue-white.css +575 -575
- package/config/themes/blue-white/blue-white.less +669 -669
- package/config/themes/blue-white/var.less +676 -676
- package/config/themes/blue-white-tight/blue-white-tight.css +576 -576
- package/config/themes/blue-white-tight/blue-white-tight.less +672 -672
- package/config/themes/blue-white-tight/var.less +677 -677
- package/config/themes/danqing/danqing.css +576 -575
- package/config/themes/danqing/danqing.css.map +1 -1
- package/config/themes/danqing/danqing.less +668 -668
- package/config/themes/danqing/danqing.wxss +572 -572
- package/config/themes/danqing/var.less +679 -679
- package/config/themes/deep/deep.css +575 -575
- package/config/themes/deep/deep.less +669 -669
- package/config/themes/deep/var.less +677 -677
- package/config/themes/default/default.css +575 -575
- package/config/themes/default/default.less +671 -671
- package/config/themes/default/var.less +677 -677
- package/config/themes/eap/eap.css +575 -575
- package/config/themes/eap/eap.less +671 -671
- package/config/themes/eap/var.less +677 -677
- package/config/themes/gold/gold.css +575 -575
- package/config/themes/gold/gold.less +671 -671
- package/config/themes/gold/var.less +677 -677
- package/config/themes/index.js +28 -28
- package/config/themes/lime/lime.css +575 -575
- package/config/themes/lime/lime.less +671 -671
- package/config/themes/lime/var.less +678 -678
- package/config/themes/orange/orange.css +575 -575
- package/config/themes/orange/orange.less +671 -671
- package/config/themes/orange/var.less +678 -678
- package/config/themes/red/red.css +575 -575
- package/config/themes/red/red.less +671 -671
- package/config/themes/red/var.less +677 -677
- package/config/themes/theme-atrovirens.js +558 -558
- package/config/themes/theme-blue.js +558 -558
- package/config/themes/theme-bw.js +558 -558
- package/config/themes/theme-bwt.js +559 -559
- package/config/themes/theme-danqing.js +558 -558
- package/config/themes/theme-deep.js +558 -558
- package/config/themes/theme-default.js +558 -558
- package/config/themes/theme-eap.js +558 -558
- package/config/themes/theme-gold.js +558 -558
- package/config/themes/theme-lime.js +558 -558
- package/config/themes/theme-orange.js +559 -559
- package/config/themes/theme-red.js +558 -558
- package/config/themes/theme-white.js +557 -557
- package/config/themes/white/var.less +675 -675
- package/config/themes/white/white.css +575 -575
- package/config/themes/white/white.less +668 -668
- package/directives/index.js +23 -23
- package/directives/module/draggable.js +56 -56
- package/directives/module/permission.js +49 -49
- package/directives/module/print.js +1 -1
- package/directives/module/vue-print-nb/README.md +63 -63
- package/directives/module/vue-print-nb/print.js +94 -94
- package/directives/module/vue-print-nb/printarea.js +532 -532
- package/index.js +10 -10
- package/nstyles/common.less +197 -197
- package/nstyles/components/404.less +46 -46
- package/nstyles/components/button.less +34 -34
- package/nstyles/components/date-picker.less +37 -37
- package/nstyles/components/drawer.less +20 -20
- package/nstyles/components/dropdown.less +18 -18
- package/nstyles/components/excel-flow.less +72 -72
- package/nstyles/components/form.less +313 -303
- package/nstyles/components/index.less +23 -23
- package/nstyles/components/layout/collect.less +10 -10
- package/nstyles/components/layout/detail-view.less +107 -107
- package/nstyles/components/layout/full-screen.less +7 -7
- package/nstyles/components/layout/index.less +7 -7
- package/nstyles/components/layout/other-menu.less +142 -142
- package/nstyles/components/layout/page-view.less +101 -101
- package/nstyles/components/layout/sider-trigger.less +41 -41
- package/nstyles/components/layout/tags-nav.less +113 -113
- package/nstyles/components/modal.less +85 -85
- package/nstyles/components/n-button.less +131 -131
- package/nstyles/components/n-image-preview.less +131 -131
- package/nstyles/components/n-model/index.less +19 -19
- package/nstyles/components/n-model/report-index.less +43 -43
- package/nstyles/components/n-panel.less +40 -40
- package/nstyles/components/n-picker.less +37 -37
- package/nstyles/components/n-sign.less +17 -17
- package/nstyles/components/n-tooltip.less +10 -10
- package/nstyles/components/panel.less +31 -31
- package/nstyles/components/select.less +3 -3
- package/nstyles/components/sign.less +27 -27
- package/nstyles/components/table.less +315 -315
- package/nstyles/components/tree.less +158 -158
- package/nstyles/components/upload.less +164 -164
- package/nstyles/index.less +5 -5
- package/nstyles/reset.less +65 -65
- package/nstyles/third/ag.less +174 -174
- package/nstyles/third/index.less +11 -11
- package/nstyles/third/view-design.less +366 -366
- package/nstyles/variables/base.less +143 -143
- package/nstyles/variables/index.less +4 -4
- package/nstyles/variables/theme/default/button.less +7 -7
- package/nstyles/variables/theme/default/common.less +57 -57
- package/nstyles/variables/theme/default/index.less +7 -7
- package/nstyles/variables/theme/default/layout.less +40 -40
- package/nstyles/variables/theme/default/table.less +37 -37
- package/nstyles/variables/theme/default/tag.less +3 -3
- package/nstyles/variables/theme/default/upload.less +3 -3
- package/nstyles/variables/theme/index.less +13 -13
- package/nstyles/variables/theme/small/button.less +7 -7
- package/nstyles/variables/theme/small/common.less +39 -39
- package/nstyles/variables/theme/small/index.less +5 -5
- package/nstyles/variables/theme/small/layout.less +21 -21
- package/nstyles/variables/theme/small/table.less +17 -17
- package/nstyles/variables/theme/small/tag.less +3 -3
- package/package.json +1 -1
- package/plugin/index.js +12 -12
- package/plugin/module/date-format.js +30 -30
- package/plugin/module/loading.js +26 -26
- package/plugin/module/warn-handler.js +11 -11
- package/styles/variables.less +21 -21
- package/utils/ajax/cacheconf.js +19 -19
- package/utils/ajax/content-type.js +30 -30
- package/utils/ajax/index.js +12 -12
- package/utils/ajax/interceptors.js +97 -97
- package/utils/assist.js +147 -147
- package/utils/base64.js +126 -126
- package/utils/blob.js +47 -47
- package/utils/bus.js +3 -3
- package/utils/crypto/index.js +48 -48
- package/utils/crypto/md5.js +152 -152
- package/utils/crypto/sm3.js +235 -235
- package/utils/date.js +381 -381
- package/utils/dict/built-in-dict.js +20 -20
- package/utils/dict/index.js +167 -167
- package/utils/dom.js +38 -38
- package/utils/event.js +72 -72
- package/utils/excel.js +655 -655
- package/utils/file.js +19 -19
- package/utils/form/validate.js +29 -29
- package/utils/half-year.js +68 -68
- package/utils/index.js +41 -41
- package/utils/json.js +29 -29
- package/utils/lodop.js +165 -165
- package/utils/menu/before-close.js +17 -17
- package/utils/menu/index.js +395 -395
- package/utils/mime_type.js +67 -67
- package/utils/modelerUtil.js +227 -227
- package/utils/n/api.js +22 -22
- package/utils/n/date.js +57 -57
- package/utils/n/index.js +9 -9
- package/utils/n/is-type.js +176 -176
- package/utils/n/number.js +144 -144
- package/utils/n/permission-cache.js +11 -11
- package/utils/n/reuqest/axiosN.js +17 -17
- package/utils/n/reuqest/content-type.js +19 -19
- package/utils/n/reuqest/interceptors.js +95 -95
- package/utils/n/reuqest/url-params.js +12 -12
- package/utils/n/storage.js +51 -51
- package/utils/n/token.js +51 -51
- package/utils/n/user-cache.js +11 -11
- package/utils/n/user.js +34 -34
- package/utils/n/uuid.js +16 -16
- package/utils/n-generator-routers.js +208 -208
- package/utils/n-router.js +205 -205
- package/utils/n-theme.js +30 -30
- package/utils/number.js +180 -180
- package/utils/oss.js +57 -57
- package/utils/platform.js +1334 -1334
- package/utils/quarter.js +58 -58
- package/utils/storage.js +198 -198
- package/utils/theme.js +138 -138
- package/utils/transform.js +179 -0
- package/utils/type.js +102 -102
- package/utils/util.js +795 -795
- package/utils/validator.js +181 -181
- package/utils/vxetable/index.js +25 -25
- package/utils/zoomScroll.js +9 -9
package/utils/n/storage.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
// ============ SessionStorage ============
|
|
2
|
-
export const getSessionStorage = (key) => {
|
|
3
|
-
const value = sessionStorage.getItem(key)
|
|
4
|
-
if (value) {
|
|
5
|
-
try {
|
|
6
|
-
return JSON.parse(value)
|
|
7
|
-
} catch (error) {
|
|
8
|
-
return value
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return value
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const setSessionStorage = (key, value) => {
|
|
15
|
-
if (typeof value !== 'string') {
|
|
16
|
-
value = JSON.stringify(value)
|
|
17
|
-
}
|
|
18
|
-
sessionStorage.setItem(key, value)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const removeSessionStorage = (key) => {
|
|
22
|
-
return sessionStorage.removeItem(key)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function clearSessionStorage() {
|
|
26
|
-
sessionStorage.clear()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// ============ LocalStorage ============
|
|
30
|
-
export const getLocalStorage = (key) => {
|
|
31
|
-
const value = localStorage.getItem(key)
|
|
32
|
-
if (value) {
|
|
33
|
-
try {
|
|
34
|
-
return JSON.parse(value)
|
|
35
|
-
} catch (error) {
|
|
36
|
-
return value
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return value
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const setLocalStorage = (key, value) => {
|
|
43
|
-
if (typeof value !== 'string') {
|
|
44
|
-
value = JSON.stringify(value)
|
|
45
|
-
}
|
|
46
|
-
localStorage.setItem(key, value)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const removeLocalStorage = (key) => {
|
|
50
|
-
return localStorage.removeItem(key)
|
|
51
|
-
}
|
|
1
|
+
// ============ SessionStorage ============
|
|
2
|
+
export const getSessionStorage = (key) => {
|
|
3
|
+
const value = sessionStorage.getItem(key)
|
|
4
|
+
if (value) {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(value)
|
|
7
|
+
} catch (error) {
|
|
8
|
+
return value
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return value
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const setSessionStorage = (key, value) => {
|
|
15
|
+
if (typeof value !== 'string') {
|
|
16
|
+
value = JSON.stringify(value)
|
|
17
|
+
}
|
|
18
|
+
sessionStorage.setItem(key, value)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const removeSessionStorage = (key) => {
|
|
22
|
+
return sessionStorage.removeItem(key)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function clearSessionStorage() {
|
|
26
|
+
sessionStorage.clear()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ============ LocalStorage ============
|
|
30
|
+
export const getLocalStorage = (key) => {
|
|
31
|
+
const value = localStorage.getItem(key)
|
|
32
|
+
if (value) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(value)
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return value
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return value
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const setLocalStorage = (key, value) => {
|
|
43
|
+
if (typeof value !== 'string') {
|
|
44
|
+
value = JSON.stringify(value)
|
|
45
|
+
}
|
|
46
|
+
localStorage.setItem(key, value)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const removeLocalStorage = (key) => {
|
|
50
|
+
return localStorage.removeItem(key)
|
|
51
|
+
}
|
package/utils/n/token.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { getLocalStorage, getSessionStorage, setLocalStorage } from './storage';
|
|
2
|
-
const TOKEN_KEY = 'v8-token';
|
|
3
|
-
const TOKEN_KEY_IBP = 'lambo-token';
|
|
4
|
-
// 要从门户跳转过来,sessionStorage不能带token过来,改成localStorage
|
|
5
|
-
export function setToken(token) {
|
|
6
|
-
setLocalStorage(TOKEN_KEY, token);
|
|
7
|
-
Cookie.set('TOKEN_KEY', token, 1);
|
|
8
|
-
}
|
|
9
|
-
export function getToken() {
|
|
10
|
-
let token = getSessionStorage(TOKEN_KEY_IBP);
|
|
11
|
-
if (!token) {
|
|
12
|
-
token = Cookie.get('lambo-sso-key');
|
|
13
|
-
}
|
|
14
|
-
if (!token) {
|
|
15
|
-
token = Cookie.get('TOKEN_KEY');
|
|
16
|
-
}
|
|
17
|
-
if (!token) {
|
|
18
|
-
token = getLocalStorage(TOKEN_KEY);
|
|
19
|
-
}
|
|
20
|
-
return token || false;
|
|
21
|
-
}
|
|
22
|
-
const Cookie = {
|
|
23
|
-
set: function (key, value, exdays) {
|
|
24
|
-
//校验Key, key中不能有等号【=】
|
|
25
|
-
if (key.indexOf('=') !== -1) {
|
|
26
|
-
throw new Error('Cookie不支持key中使用等号【=】, key:' + key);
|
|
27
|
-
}
|
|
28
|
-
let exdate = new Date(); // 获取时间
|
|
29
|
-
exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); // 保存的天数
|
|
30
|
-
// 字符串拼接cookie
|
|
31
|
-
// eslint-disable-next-line camelcase
|
|
32
|
-
window.document.cookie = key + '=' + value + ';path=/;expires=' + exdate.toGMTString();
|
|
33
|
-
},
|
|
34
|
-
get: function (key) {
|
|
35
|
-
if (document.cookie.length > 0) {
|
|
36
|
-
// 这里显示的格式需要切割一下自己可输出看下
|
|
37
|
-
var arr = document.cookie.split('; ');
|
|
38
|
-
for (let i = 0; i < arr.length; i++) {
|
|
39
|
-
let arr2 = arr[i].split('='); // 再次切割
|
|
40
|
-
// 判断查找相对应的值
|
|
41
|
-
if (arr2[0] === key) {
|
|
42
|
-
var value = arr2[1];
|
|
43
|
-
for (let j = 2; j < arr2.length; j++) {
|
|
44
|
-
value += '=' + arr2[j];
|
|
45
|
-
}
|
|
46
|
-
return value;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
};
|
|
1
|
+
import { getLocalStorage, getSessionStorage, setLocalStorage } from './storage';
|
|
2
|
+
const TOKEN_KEY = 'v8-token';
|
|
3
|
+
const TOKEN_KEY_IBP = 'lambo-token';
|
|
4
|
+
// 要从门户跳转过来,sessionStorage不能带token过来,改成localStorage
|
|
5
|
+
export function setToken(token) {
|
|
6
|
+
setLocalStorage(TOKEN_KEY, token);
|
|
7
|
+
Cookie.set('TOKEN_KEY', token, 1);
|
|
8
|
+
}
|
|
9
|
+
export function getToken() {
|
|
10
|
+
let token = getSessionStorage(TOKEN_KEY_IBP);
|
|
11
|
+
if (!token) {
|
|
12
|
+
token = Cookie.get('lambo-sso-key');
|
|
13
|
+
}
|
|
14
|
+
if (!token) {
|
|
15
|
+
token = Cookie.get('TOKEN_KEY');
|
|
16
|
+
}
|
|
17
|
+
if (!token) {
|
|
18
|
+
token = getLocalStorage(TOKEN_KEY);
|
|
19
|
+
}
|
|
20
|
+
return token || false;
|
|
21
|
+
}
|
|
22
|
+
const Cookie = {
|
|
23
|
+
set: function (key, value, exdays) {
|
|
24
|
+
//校验Key, key中不能有等号【=】
|
|
25
|
+
if (key.indexOf('=') !== -1) {
|
|
26
|
+
throw new Error('Cookie不支持key中使用等号【=】, key:' + key);
|
|
27
|
+
}
|
|
28
|
+
let exdate = new Date(); // 获取时间
|
|
29
|
+
exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); // 保存的天数
|
|
30
|
+
// 字符串拼接cookie
|
|
31
|
+
// eslint-disable-next-line camelcase
|
|
32
|
+
window.document.cookie = key + '=' + value + ';path=/;expires=' + exdate.toGMTString();
|
|
33
|
+
},
|
|
34
|
+
get: function (key) {
|
|
35
|
+
if (document.cookie.length > 0) {
|
|
36
|
+
// 这里显示的格式需要切割一下自己可输出看下
|
|
37
|
+
var arr = document.cookie.split('; ');
|
|
38
|
+
for (let i = 0; i < arr.length; i++) {
|
|
39
|
+
let arr2 = arr[i].split('='); // 再次切割
|
|
40
|
+
// 判断查找相对应的值
|
|
41
|
+
if (arr2[0] === key) {
|
|
42
|
+
var value = arr2[1];
|
|
43
|
+
for (let j = 2; j < arr2.length; j++) {
|
|
44
|
+
value += '=' + arr2[j];
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
};
|
package/utils/n/user-cache.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { getLocalStorage, removeLocalStorage, setLocalStorage } from './storage';
|
|
2
|
-
const USER_INFO_KEY = 'userInfo';
|
|
3
|
-
export function getUserInfoCache() {
|
|
4
|
-
return getLocalStorage(USER_INFO_KEY);
|
|
5
|
-
}
|
|
6
|
-
export function setUserInfoCache(data) {
|
|
7
|
-
setLocalStorage(USER_INFO_KEY, data);
|
|
8
|
-
}
|
|
9
|
-
export function clearUserInfoCache() {
|
|
10
|
-
removeLocalStorage(USER_INFO_KEY);
|
|
11
|
-
}
|
|
1
|
+
import { getLocalStorage, removeLocalStorage, setLocalStorage } from './storage';
|
|
2
|
+
const USER_INFO_KEY = 'userInfo';
|
|
3
|
+
export function getUserInfoCache() {
|
|
4
|
+
return getLocalStorage(USER_INFO_KEY);
|
|
5
|
+
}
|
|
6
|
+
export function setUserInfoCache(data) {
|
|
7
|
+
setLocalStorage(USER_INFO_KEY, data);
|
|
8
|
+
}
|
|
9
|
+
export function clearUserInfoCache() {
|
|
10
|
+
removeLocalStorage(USER_INFO_KEY);
|
|
11
|
+
}
|
package/utils/n/user.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { config } from '../../config/config';
|
|
2
|
-
import { axiosN } from './reuqest/axiosN'
|
|
3
|
-
|
|
4
|
-
const CONTEXT = config.authServerContext;
|
|
5
|
-
|
|
6
|
-
export function loginApi({ userName, password, validCodeId, validCodeInput }) {
|
|
7
|
-
let publicKey = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD2iolFHi+6bUh+V6JPr2gFJQsC0QNsq2EwI0MAPlI5AaizBHRVMjX1H73ptuDSiT3QZh4kk74w+eDLyYj4JXo1SvvDw5w378SLhUIDzH0zrlt3oleT3kiPQxC17yM3Os/wrtHO7IC+KGo9qrg+LJFyR/fYYHcyH9i+JAejBEnJQIDAQAB`
|
|
8
|
-
let nodeRSA = new window.NodeRSA(publicKey, 'pkcs8-public')
|
|
9
|
-
let rsaPaswword = nodeRSA.encrypt(password, 'base64','utf8')
|
|
10
|
-
let upw = window.Base64.encode(rsaPaswword)
|
|
11
|
-
|
|
12
|
-
const data = { usn: userName, upw, validCodeId, validCodeInput }
|
|
13
|
-
return axiosN.formPost(CONTEXT + '/sso/auth/login', data)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function getUserInfoApi() {
|
|
17
|
-
return axiosN.get(`${CONTEXT}/manage/user/getCurrentInfo`)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function getGlobalPolicyApi() {
|
|
21
|
-
return axiosN.get(`${CONTEXT}/anon/user/getGlobalPolicy`)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function updatePasswordApi(data) {
|
|
25
|
-
return axiosN.post(`${CONTEXT}/manage/user/updatePassword`, data)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function getCaptchaURL(validCodeId) {
|
|
29
|
-
return `${CONTEXT}/anon/user/getCaptcha/` + validCodeId
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function logoutApi() {
|
|
33
|
-
return axiosN.get(`${CONTEXT}/sso/logout`)
|
|
34
|
-
}
|
|
1
|
+
import { config } from '../../config/config';
|
|
2
|
+
import { axiosN } from './reuqest/axiosN'
|
|
3
|
+
|
|
4
|
+
const CONTEXT = config.authServerContext;
|
|
5
|
+
|
|
6
|
+
export function loginApi({ userName, password, validCodeId, validCodeInput }) {
|
|
7
|
+
let publicKey = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD2iolFHi+6bUh+V6JPr2gFJQsC0QNsq2EwI0MAPlI5AaizBHRVMjX1H73ptuDSiT3QZh4kk74w+eDLyYj4JXo1SvvDw5w378SLhUIDzH0zrlt3oleT3kiPQxC17yM3Os/wrtHO7IC+KGo9qrg+LJFyR/fYYHcyH9i+JAejBEnJQIDAQAB`
|
|
8
|
+
let nodeRSA = new window.NodeRSA(publicKey, 'pkcs8-public')
|
|
9
|
+
let rsaPaswword = nodeRSA.encrypt(password, 'base64','utf8')
|
|
10
|
+
let upw = window.Base64.encode(rsaPaswword)
|
|
11
|
+
|
|
12
|
+
const data = { usn: userName, upw, validCodeId, validCodeInput }
|
|
13
|
+
return axiosN.formPost(CONTEXT + '/sso/auth/login', data)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getUserInfoApi() {
|
|
17
|
+
return axiosN.get(`${CONTEXT}/manage/user/getCurrentInfo`)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function getGlobalPolicyApi() {
|
|
21
|
+
return axiosN.get(`${CONTEXT}/anon/user/getGlobalPolicy`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function updatePasswordApi(data) {
|
|
25
|
+
return axiosN.post(`${CONTEXT}/manage/user/updatePassword`, data)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getCaptchaURL(validCodeId) {
|
|
29
|
+
return `${CONTEXT}/anon/user/getCaptcha/` + validCodeId
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function logoutApi() {
|
|
33
|
+
return axiosN.get(`${CONTEXT}/sso/logout`)
|
|
34
|
+
}
|
package/utils/n/uuid.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { customAlphabet } from 'nanoid'
|
|
2
|
-
|
|
3
|
-
const uuid = customAlphabet('0123456789abcdef', 32)
|
|
4
|
-
|
|
5
|
-
export { uuid }
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 生成uid
|
|
9
|
-
*/
|
|
10
|
-
export function guid() {
|
|
11
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
12
|
-
var r = (Math.random() * 16) | 0,
|
|
13
|
-
v = c === 'x' ? r : (r & 0x3) | 0x8
|
|
14
|
-
return v.toString(16)
|
|
15
|
-
})
|
|
16
|
-
}
|
|
1
|
+
import { customAlphabet } from 'nanoid'
|
|
2
|
+
|
|
3
|
+
const uuid = customAlphabet('0123456789abcdef', 32)
|
|
4
|
+
|
|
5
|
+
export { uuid }
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 生成uid
|
|
9
|
+
*/
|
|
10
|
+
export function guid() {
|
|
11
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
12
|
+
var r = (Math.random() * 16) | 0,
|
|
13
|
+
v = c === 'x' ? r : (r & 0x3) | 0x8
|
|
14
|
+
return v.toString(16)
|
|
15
|
+
})
|
|
16
|
+
}
|