gant-core 0.1.17 → 0.1.19
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/cli/index.js +1 -4
- package/lib/cli/index.js.map +1 -1
- package/lib/index.d.ts +18 -24
- package/lib/index.js +38 -365
- package/lib/index.js.map +1 -1
- package/package.json +1 -4
- package/rollup.config.js +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -997,6 +997,22 @@ interface StyleMapToken {
|
|
|
997
997
|
* @default 8
|
|
998
998
|
*/
|
|
999
999
|
borderRadiusLG: number;
|
|
1000
|
+
/**
|
|
1001
|
+
* @nameZH XL号圆角
|
|
1002
|
+
* @nameEN XL Border Radius
|
|
1003
|
+
* @desc XL号圆角,用于组件中的一些大圆角,如 Card、Modal 等一些组件样式。
|
|
1004
|
+
* @descEN XL size border radius, used in some large border radius components, such as Card, Modal and other components.
|
|
1005
|
+
* @default 12
|
|
1006
|
+
*/
|
|
1007
|
+
borderRadiusXL: number;
|
|
1008
|
+
/**
|
|
1009
|
+
* @nameZH XXL号圆角
|
|
1010
|
+
* @nameEN XXL Border Radius
|
|
1011
|
+
* @desc XXL号圆角,用于组件中的一些大圆角,如 Card、Modal 等一些组件样式。
|
|
1012
|
+
* @descEN XXL size border radius, used in some large border radius components, such as Card, Modal and other components.
|
|
1013
|
+
* @default 16
|
|
1014
|
+
*/
|
|
1015
|
+
borderRadiusXXL: number;
|
|
1000
1016
|
/**
|
|
1001
1017
|
* @nameZH 外部圆角
|
|
1002
1018
|
* @nameEN Outer Border Radius
|
|
@@ -2282,26 +2298,6 @@ declare const userStore: UserStore;
|
|
|
2282
2298
|
declare const loginStore: LoginStore;
|
|
2283
2299
|
declare const menuStore: MenuStore;
|
|
2284
2300
|
|
|
2285
|
-
declare function toBase64(key: string): string;
|
|
2286
|
-
declare function getMaskHeaderKey(): string;
|
|
2287
|
-
declare function getSecretKey(hexStr: string): string;
|
|
2288
|
-
/**
|
|
2289
|
-
* AES加密
|
|
2290
|
-
* @param plainText 明文
|
|
2291
|
-
* @param keyInBase64Str base64编码后的key
|
|
2292
|
-
* @param ivInBase64Str base64编码后的初始化向量(只有CBC模式下才支持)
|
|
2293
|
-
* @return base64编码后的密文
|
|
2294
|
-
*/
|
|
2295
|
-
declare function encryptByAES(plainText: any, keyInBase64Str: string, ivInBase64Str: string): string;
|
|
2296
|
-
/**
|
|
2297
|
-
* AES解密
|
|
2298
|
-
* @param cipherText 密文
|
|
2299
|
-
* @param keyInBase64Str base64编码后的key
|
|
2300
|
-
* @param ivInBase64Str base64编码后的初始化向量(只有CBC模式下才支持)
|
|
2301
|
-
* @return 明文
|
|
2302
|
-
*/
|
|
2303
|
-
declare function decryptByAES(cipherText: string, keyInBase64Str: string, ivInBase64Str: string): string;
|
|
2304
|
-
|
|
2305
2301
|
declare const initDynamicLang: (language: string, options?: {
|
|
2306
2302
|
i18n?: boolean;
|
|
2307
2303
|
i18nInitOptions?: InitOptions;
|
|
@@ -2319,13 +2315,11 @@ declare const getRoutes: (routesMaps: any) => any[];
|
|
|
2319
2315
|
|
|
2320
2316
|
declare const useRequestMicroSevices: (microServiceMap?: any) => (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
2321
2317
|
declare const useRequestHeader: (userLanguage: string) => (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
2322
|
-
declare const useResponsedecryptParse: (response: AxiosResponse) => AxiosResponse<any, any>;
|
|
2323
2318
|
interface MainOptions extends GlobalOptions {
|
|
2324
2319
|
microServiceMap?: any;
|
|
2325
|
-
secret?: boolean;
|
|
2326
2320
|
locale?: string;
|
|
2327
2321
|
dynamicLangCallback?: () => void;
|
|
2328
2322
|
}
|
|
2329
|
-
declare const _default: ({ microServiceMap,
|
|
2323
|
+
declare const _default: ({ microServiceMap, dynamicLangCallback, ...globalOptions }: MainOptions) => Promise<boolean>;
|
|
2330
2324
|
|
|
2331
|
-
export { type AliasToken, type BASE_CONFIG_TYPE, type CONFIG_TYPE, type ColorMapToken, type ColorNeutralMapToken, type ColorPalettes, type CommonMapToken, type DerivativeFunc, type FontMapToken, type GantAxiosRequestConfig, type GantServerOptions, type GlobalOptions, type GlobalToken, type HeightMapToken, type InternalAxiosRequestConfig, type LOGIN_CONFIG, type Language, type LegacyColorPalettes, type LoginResultData, type MAIN_CONFIG_TYPE, MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, type MainOptions, type MapToken, type MappingAlgorithm, PROGRESS_UPDEDATE, type Perferences, type PresetColorKey, type PresetColorType, PresetColors, type ProductInfo, type SSOConfigType, type SYSMGMT_CONFIG_TYPE, type SeedToken, type ServerMenu, type ServerMenuData, type ServerMenuMap, type SizeMapToken, type StyleMapToken, type THEME_TYPE, type ThemeType, type TokenType, type User, type UserAggregateInfo, type GantUserConfig as UserConfig, type UserIdentityType, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative as compactAlgorithm, _default$1 as companydataStore, derivative$1 as darkAlgorithm,
|
|
2325
|
+
export { type AliasToken, type BASE_CONFIG_TYPE, type CONFIG_TYPE, type ColorMapToken, type ColorNeutralMapToken, type ColorPalettes, type CommonMapToken, type DerivativeFunc, type FontMapToken, type GantAxiosRequestConfig, type GantServerOptions, type GlobalOptions, type GlobalToken, type HeightMapToken, type InternalAxiosRequestConfig, type LOGIN_CONFIG, type Language, type LegacyColorPalettes, type LoginResultData, type MAIN_CONFIG_TYPE, MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, type MainOptions, type MapToken, type MappingAlgorithm, PROGRESS_UPDEDATE, type Perferences, type PresetColorKey, type PresetColorType, PresetColors, type ProductInfo, type SSOConfigType, type SYSMGMT_CONFIG_TYPE, type SeedToken, type ServerMenu, type ServerMenuData, type ServerMenuMap, type SizeMapToken, type StyleMapToken, type THEME_TYPE, type ThemeType, type TokenType, type User, type UserAggregateInfo, type GantUserConfig as UserConfig, type UserIdentityType, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative as compactAlgorithm, _default$1 as companydataStore, derivative$1 as darkAlgorithm, derivative$2 as defaultAlgorithm, emitter, expireCache, formatToken as formatAliasToken, getAliasToken, getAlphaColor, getAntdLocaleKey, getBackgroundColor, getDarkenSolidColor, getLightenSolidColor, getLocaleKey, getRoutes, getTokenCssVar, getTraceId, globalStore, _default as init, initDynamicLang, lighten, loginStore, menuStore, parameterStore, Progress as progress, request, requestInstance, seedToken as seed, setLocaleKey, storage as storageStore, token, tr, useRequestHeader, useRequestMicroSevices, userStore, websocket };
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import axios__default from 'axios';
|
|
|
2
2
|
export * from 'axios';
|
|
3
3
|
import { forEach, groupBy, reduce, find, pick, get as get$1, uniqueId, omit, isEmpty, cloneDeep, mapValues, uniqBy, toLower, isObject, mergeWith, has, join } from 'lodash-es';
|
|
4
4
|
import mitt from 'mitt';
|
|
5
|
-
import CryptoJS from 'crypto-js';
|
|
6
5
|
|
|
7
6
|
class InterceptorManager {
|
|
8
7
|
handlers;
|
|
@@ -688,7 +687,7 @@ class UserStore {
|
|
|
688
687
|
return this.userSetting[key];
|
|
689
688
|
}
|
|
690
689
|
const res = await getUserDataApi({ dataType, dataId: userId });
|
|
691
|
-
const bigData = res
|
|
690
|
+
const bigData = res?.bigData ? JSON.parse(res.bigData) : undefined;
|
|
692
691
|
this.userSetting[key] = bigData;
|
|
693
692
|
return bigData;
|
|
694
693
|
};
|
|
@@ -1234,7 +1233,7 @@ class CompanyData {
|
|
|
1234
1233
|
return this.data[key];
|
|
1235
1234
|
}
|
|
1236
1235
|
const res = await getCompanyDataApi({ dataType, dataId: companyVersion });
|
|
1237
|
-
const bigData = res
|
|
1236
|
+
const bigData = res?.bigData ? JSON.parse(res.bigData) : undefined;
|
|
1238
1237
|
this.data[key] = bigData;
|
|
1239
1238
|
};
|
|
1240
1239
|
updateCompanyData = async (dataType, data) => {
|
|
@@ -1261,337 +1260,6 @@ const userStore = globalStore.userStore;
|
|
|
1261
1260
|
const loginStore = globalStore.loginStore;
|
|
1262
1261
|
const menuStore = globalStore.menuStore;
|
|
1263
1262
|
|
|
1264
|
-
/**
|
|
1265
|
-
* base64.ts
|
|
1266
|
-
*
|
|
1267
|
-
* Licensed under the BSD 3-Clause License.
|
|
1268
|
-
* http://opensource.org/licenses/BSD-3-Clause
|
|
1269
|
-
*
|
|
1270
|
-
* References:
|
|
1271
|
-
* http://en.wikipedia.org/wiki/Base64
|
|
1272
|
-
*
|
|
1273
|
-
* @author Dan Kogai (https://github.com/dankogai)
|
|
1274
|
-
*/
|
|
1275
|
-
const version = '3.7.7';
|
|
1276
|
-
/**
|
|
1277
|
-
* @deprecated use lowercase `version`.
|
|
1278
|
-
*/
|
|
1279
|
-
const VERSION = version;
|
|
1280
|
-
const _hasBuffer = typeof Buffer === 'function';
|
|
1281
|
-
const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
1282
|
-
const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
1283
|
-
const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
1284
|
-
const b64chs = Array.prototype.slice.call(b64ch);
|
|
1285
|
-
const b64tab = ((a) => {
|
|
1286
|
-
let tab = {};
|
|
1287
|
-
a.forEach((c, i) => tab[c] = i);
|
|
1288
|
-
return tab;
|
|
1289
|
-
})(b64chs);
|
|
1290
|
-
const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
1291
|
-
const _fromCC = String.fromCharCode.bind(String);
|
|
1292
|
-
const _U8Afrom = typeof Uint8Array.from === 'function'
|
|
1293
|
-
? Uint8Array.from.bind(Uint8Array)
|
|
1294
|
-
: (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
|
|
1295
|
-
const _mkUriSafe = (src) => src
|
|
1296
|
-
.replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
|
|
1297
|
-
const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
|
|
1298
|
-
/**
|
|
1299
|
-
* polyfill version of `btoa`
|
|
1300
|
-
*/
|
|
1301
|
-
const btoaPolyfill = (bin) => {
|
|
1302
|
-
// console.log('polyfilled');
|
|
1303
|
-
let u32, c0, c1, c2, asc = '';
|
|
1304
|
-
const pad = bin.length % 3;
|
|
1305
|
-
for (let i = 0; i < bin.length;) {
|
|
1306
|
-
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
1307
|
-
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
1308
|
-
(c2 = bin.charCodeAt(i++)) > 255)
|
|
1309
|
-
throw new TypeError('invalid character found');
|
|
1310
|
-
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
1311
|
-
asc += b64chs[u32 >> 18 & 63]
|
|
1312
|
-
+ b64chs[u32 >> 12 & 63]
|
|
1313
|
-
+ b64chs[u32 >> 6 & 63]
|
|
1314
|
-
+ b64chs[u32 & 63];
|
|
1315
|
-
}
|
|
1316
|
-
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
1317
|
-
};
|
|
1318
|
-
/**
|
|
1319
|
-
* does what `window.btoa` of web browsers do.
|
|
1320
|
-
* @param {String} bin binary string
|
|
1321
|
-
* @returns {string} Base64-encoded string
|
|
1322
|
-
*/
|
|
1323
|
-
const _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)
|
|
1324
|
-
: _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')
|
|
1325
|
-
: btoaPolyfill;
|
|
1326
|
-
const _fromUint8Array = _hasBuffer
|
|
1327
|
-
? (u8a) => Buffer.from(u8a).toString('base64')
|
|
1328
|
-
: (u8a) => {
|
|
1329
|
-
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
1330
|
-
const maxargs = 0x1000;
|
|
1331
|
-
let strs = [];
|
|
1332
|
-
for (let i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
1333
|
-
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
1334
|
-
}
|
|
1335
|
-
return _btoa(strs.join(''));
|
|
1336
|
-
};
|
|
1337
|
-
/**
|
|
1338
|
-
* converts a Uint8Array to a Base64 string.
|
|
1339
|
-
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
1340
|
-
* @returns {string} Base64 string
|
|
1341
|
-
*/
|
|
1342
|
-
const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
1343
|
-
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
1344
|
-
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
1345
|
-
// reverting good old fationed regexp
|
|
1346
|
-
const cb_utob = (c) => {
|
|
1347
|
-
if (c.length < 2) {
|
|
1348
|
-
var cc = c.charCodeAt(0);
|
|
1349
|
-
return cc < 0x80 ? c
|
|
1350
|
-
: cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
|
|
1351
|
-
+ _fromCC(0x80 | (cc & 0x3f)))
|
|
1352
|
-
: (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
|
|
1353
|
-
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
1354
|
-
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
1355
|
-
}
|
|
1356
|
-
else {
|
|
1357
|
-
var cc = 0x10000
|
|
1358
|
-
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
1359
|
-
+ (c.charCodeAt(1) - 0xDC00);
|
|
1360
|
-
return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
|
|
1361
|
-
+ _fromCC(0x80 | ((cc >>> 12) & 0x3f))
|
|
1362
|
-
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
1363
|
-
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
1364
|
-
}
|
|
1365
|
-
};
|
|
1366
|
-
const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
1367
|
-
/**
|
|
1368
|
-
* @deprecated should have been internal use only.
|
|
1369
|
-
* @param {string} src UTF-8 string
|
|
1370
|
-
* @returns {string} UTF-16 string
|
|
1371
|
-
*/
|
|
1372
|
-
const utob = (u) => u.replace(re_utob, cb_utob);
|
|
1373
|
-
//
|
|
1374
|
-
const _encode = _hasBuffer
|
|
1375
|
-
? (s) => Buffer.from(s, 'utf8').toString('base64')
|
|
1376
|
-
: _TE
|
|
1377
|
-
? (s) => _fromUint8Array(_TE.encode(s))
|
|
1378
|
-
: (s) => _btoa(utob(s));
|
|
1379
|
-
/**
|
|
1380
|
-
* converts a UTF-8-encoded string to a Base64 string.
|
|
1381
|
-
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
1382
|
-
* @returns {string} Base64 string
|
|
1383
|
-
*/
|
|
1384
|
-
const encode = (src, urlsafe = false) => urlsafe
|
|
1385
|
-
? _mkUriSafe(_encode(src))
|
|
1386
|
-
: _encode(src);
|
|
1387
|
-
/**
|
|
1388
|
-
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
1389
|
-
* @returns {string} Base64 string
|
|
1390
|
-
*/
|
|
1391
|
-
const encodeURI = (src) => encode(src, true);
|
|
1392
|
-
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
1393
|
-
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
1394
|
-
// reverting good old fationed regexp
|
|
1395
|
-
const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
1396
|
-
const cb_btou = (cccc) => {
|
|
1397
|
-
switch (cccc.length) {
|
|
1398
|
-
case 4:
|
|
1399
|
-
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
1400
|
-
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
1401
|
-
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
1402
|
-
| (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
|
|
1403
|
-
return (_fromCC((offset >>> 10) + 0xD800)
|
|
1404
|
-
+ _fromCC((offset & 0x3FF) + 0xDC00));
|
|
1405
|
-
case 3:
|
|
1406
|
-
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
|
|
1407
|
-
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
1408
|
-
| (0x3f & cccc.charCodeAt(2)));
|
|
1409
|
-
default:
|
|
1410
|
-
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
|
|
1411
|
-
| (0x3f & cccc.charCodeAt(1)));
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
/**
|
|
1415
|
-
* @deprecated should have been internal use only.
|
|
1416
|
-
* @param {string} src UTF-16 string
|
|
1417
|
-
* @returns {string} UTF-8 string
|
|
1418
|
-
*/
|
|
1419
|
-
const btou = (b) => b.replace(re_btou, cb_btou);
|
|
1420
|
-
/**
|
|
1421
|
-
* polyfill version of `atob`
|
|
1422
|
-
*/
|
|
1423
|
-
const atobPolyfill = (asc) => {
|
|
1424
|
-
// console.log('polyfilled');
|
|
1425
|
-
asc = asc.replace(/\s+/g, '');
|
|
1426
|
-
if (!b64re.test(asc))
|
|
1427
|
-
throw new TypeError('malformed base64.');
|
|
1428
|
-
asc += '=='.slice(2 - (asc.length & 3));
|
|
1429
|
-
let u24, bin = '', r1, r2;
|
|
1430
|
-
for (let i = 0; i < asc.length;) {
|
|
1431
|
-
u24 = b64tab[asc.charAt(i++)] << 18
|
|
1432
|
-
| b64tab[asc.charAt(i++)] << 12
|
|
1433
|
-
| (r1 = b64tab[asc.charAt(i++)]) << 6
|
|
1434
|
-
| (r2 = b64tab[asc.charAt(i++)]);
|
|
1435
|
-
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
|
|
1436
|
-
: r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
|
|
1437
|
-
: _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
|
|
1438
|
-
}
|
|
1439
|
-
return bin;
|
|
1440
|
-
};
|
|
1441
|
-
/**
|
|
1442
|
-
* does what `window.atob` of web browsers do.
|
|
1443
|
-
* @param {String} asc Base64-encoded string
|
|
1444
|
-
* @returns {string} binary string
|
|
1445
|
-
*/
|
|
1446
|
-
const _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))
|
|
1447
|
-
: _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')
|
|
1448
|
-
: atobPolyfill;
|
|
1449
|
-
//
|
|
1450
|
-
const _toUint8Array = _hasBuffer
|
|
1451
|
-
? (a) => _U8Afrom(Buffer.from(a, 'base64'))
|
|
1452
|
-
: (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
|
|
1453
|
-
/**
|
|
1454
|
-
* converts a Base64 string to a Uint8Array.
|
|
1455
|
-
*/
|
|
1456
|
-
const toUint8Array = (a) => _toUint8Array(_unURI(a));
|
|
1457
|
-
//
|
|
1458
|
-
const _decode = _hasBuffer
|
|
1459
|
-
? (a) => Buffer.from(a, 'base64').toString('utf8')
|
|
1460
|
-
: _TD
|
|
1461
|
-
? (a) => _TD.decode(_toUint8Array(a))
|
|
1462
|
-
: (a) => btou(_atob(a));
|
|
1463
|
-
const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));
|
|
1464
|
-
/**
|
|
1465
|
-
* converts a Base64 string to a UTF-8 string.
|
|
1466
|
-
* @param {String} src Base64 string. Both normal and URL-safe are supported
|
|
1467
|
-
* @returns {string} UTF-8 string
|
|
1468
|
-
*/
|
|
1469
|
-
const decode = (src) => _decode(_unURI(src));
|
|
1470
|
-
/**
|
|
1471
|
-
* check if a value is a valid Base64 string
|
|
1472
|
-
* @param {String} src a value to check
|
|
1473
|
-
*/
|
|
1474
|
-
const isValid = (src) => {
|
|
1475
|
-
if (typeof src !== 'string')
|
|
1476
|
-
return false;
|
|
1477
|
-
const s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
|
|
1478
|
-
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
|
|
1479
|
-
};
|
|
1480
|
-
//
|
|
1481
|
-
const _noEnum = (v) => {
|
|
1482
|
-
return {
|
|
1483
|
-
value: v, enumerable: false, writable: true, configurable: true
|
|
1484
|
-
};
|
|
1485
|
-
};
|
|
1486
|
-
/**
|
|
1487
|
-
* extend String.prototype with relevant methods
|
|
1488
|
-
*/
|
|
1489
|
-
const extendString = function () {
|
|
1490
|
-
const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
|
|
1491
|
-
_add('fromBase64', function () { return decode(this); });
|
|
1492
|
-
_add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
|
|
1493
|
-
_add('toBase64URI', function () { return encode(this, true); });
|
|
1494
|
-
_add('toBase64URL', function () { return encode(this, true); });
|
|
1495
|
-
_add('toUint8Array', function () { return toUint8Array(this); });
|
|
1496
|
-
};
|
|
1497
|
-
/**
|
|
1498
|
-
* extend Uint8Array.prototype with relevant methods
|
|
1499
|
-
*/
|
|
1500
|
-
const extendUint8Array = function () {
|
|
1501
|
-
const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
|
|
1502
|
-
_add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
|
|
1503
|
-
_add('toBase64URI', function () { return fromUint8Array(this, true); });
|
|
1504
|
-
_add('toBase64URL', function () { return fromUint8Array(this, true); });
|
|
1505
|
-
};
|
|
1506
|
-
/**
|
|
1507
|
-
* extend Builtin prototypes with relevant methods
|
|
1508
|
-
*/
|
|
1509
|
-
const extendBuiltins = () => {
|
|
1510
|
-
extendString();
|
|
1511
|
-
extendUint8Array();
|
|
1512
|
-
};
|
|
1513
|
-
const gBase64 = {
|
|
1514
|
-
version: version,
|
|
1515
|
-
VERSION: VERSION,
|
|
1516
|
-
atob: _atob,
|
|
1517
|
-
atobPolyfill: atobPolyfill,
|
|
1518
|
-
btoa: _btoa,
|
|
1519
|
-
btoaPolyfill: btoaPolyfill,
|
|
1520
|
-
fromBase64: decode,
|
|
1521
|
-
toBase64: encode,
|
|
1522
|
-
encode: encode,
|
|
1523
|
-
encodeURI: encodeURI,
|
|
1524
|
-
encodeURL: encodeURI,
|
|
1525
|
-
utob: utob,
|
|
1526
|
-
btou: btou,
|
|
1527
|
-
decode: decode,
|
|
1528
|
-
isValid: isValid,
|
|
1529
|
-
fromUint8Array: fromUint8Array,
|
|
1530
|
-
toUint8Array: toUint8Array,
|
|
1531
|
-
extendString: extendString,
|
|
1532
|
-
extendUint8Array: extendUint8Array,
|
|
1533
|
-
extendBuiltins: extendBuiltins
|
|
1534
|
-
};
|
|
1535
|
-
|
|
1536
|
-
const secretKey1 = 'WC1HLURBVE';
|
|
1537
|
-
const secretKey2 = 'EtTUFTSw====';
|
|
1538
|
-
function toBase64(key) {
|
|
1539
|
-
return gBase64.decode(key);
|
|
1540
|
-
}
|
|
1541
|
-
function getMaskHeaderKey() {
|
|
1542
|
-
return toBase64(secretKey1.concat(secretKey2));
|
|
1543
|
-
}
|
|
1544
|
-
function getSecretKey(hexStr) {
|
|
1545
|
-
const SECRET_POOL_STR = 'ImGvtLt372I9971ScUZIL84dlniXcWPE';
|
|
1546
|
-
let secretStr = '';
|
|
1547
|
-
for (let i = 0; i < 8; i++) {
|
|
1548
|
-
let tmpHex = hexStr.substring(i, i + 1);
|
|
1549
|
-
let tmpStr = parseInt(tmpHex, 16).toString(2).padStart(4, '0');
|
|
1550
|
-
for (let j = 0; j < 4; j++) {
|
|
1551
|
-
if (tmpStr[j] == '1') {
|
|
1552
|
-
secretStr = secretStr.concat(SECRET_POOL_STR[i * 4 + j]);
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
return secretStr;
|
|
1557
|
-
}
|
|
1558
|
-
/**
|
|
1559
|
-
* AES加密
|
|
1560
|
-
* @param plainText 明文
|
|
1561
|
-
* @param keyInBase64Str base64编码后的key
|
|
1562
|
-
* @param ivInBase64Str base64编码后的初始化向量(只有CBC模式下才支持)
|
|
1563
|
-
* @return base64编码后的密文
|
|
1564
|
-
*/
|
|
1565
|
-
function encryptByAES(plainText, keyInBase64Str, ivInBase64Str) {
|
|
1566
|
-
let key = CryptoJS.enc.Base64.parse(keyInBase64Str);
|
|
1567
|
-
let iv = CryptoJS.enc.Base64.parse(ivInBase64Str);
|
|
1568
|
-
let encrypted = CryptoJS.AES.encrypt(plainText, key, {
|
|
1569
|
-
iv: iv,
|
|
1570
|
-
mode: CryptoJS.mode.CBC,
|
|
1571
|
-
padding: CryptoJS.pad.Pkcs7,
|
|
1572
|
-
});
|
|
1573
|
-
// 这里的encrypted不是字符串,而是一个CipherParams对象
|
|
1574
|
-
return encrypted.ciphertext.toString(CryptoJS.enc.Base64);
|
|
1575
|
-
}
|
|
1576
|
-
/**
|
|
1577
|
-
* AES解密
|
|
1578
|
-
* @param cipherText 密文
|
|
1579
|
-
* @param keyInBase64Str base64编码后的key
|
|
1580
|
-
* @param ivInBase64Str base64编码后的初始化向量(只有CBC模式下才支持)
|
|
1581
|
-
* @return 明文
|
|
1582
|
-
*/
|
|
1583
|
-
function decryptByAES(cipherText, keyInBase64Str, ivInBase64Str) {
|
|
1584
|
-
let key = CryptoJS.enc.Base64.parse(keyInBase64Str);
|
|
1585
|
-
let iv = CryptoJS.enc.Base64.parse(ivInBase64Str);
|
|
1586
|
-
// 返回的是一个Word Array Object,其实就是Java里的字节数组
|
|
1587
|
-
let decrypted = CryptoJS.AES.decrypt(cipherText, key, {
|
|
1588
|
-
iv: iv,
|
|
1589
|
-
mode: CryptoJS.mode.CBC,
|
|
1590
|
-
padding: CryptoJS.pad.Pkcs7,
|
|
1591
|
-
});
|
|
1592
|
-
return decrypted.toString(CryptoJS.enc.Utf8);
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
1263
|
const getFWPluginContentByPluginKeyApi = (value) => {
|
|
1596
1264
|
return request('/langPluginContent/getFWPluginContentByPluginKey', {
|
|
1597
1265
|
method: 'post',
|
|
@@ -5429,7 +5097,7 @@ const seedToken = {
|
|
|
5429
5097
|
layoutIconSize: 24,
|
|
5430
5098
|
layoutNavHeight: 40,
|
|
5431
5099
|
//渐变色
|
|
5432
|
-
gradientColors: ['
|
|
5100
|
+
gradientColors: ['rgba(0, 64, 237,0.3)', 'rgba(0, 229, 237,0.3)'],
|
|
5433
5101
|
};
|
|
5434
5102
|
|
|
5435
5103
|
/**
|
|
@@ -5566,6 +5234,8 @@ const genRadius = (radiusBase) => {
|
|
|
5566
5234
|
let radiusLG = radiusBase;
|
|
5567
5235
|
let radiusSM = radiusBase;
|
|
5568
5236
|
let radiusXS = radiusBase;
|
|
5237
|
+
let radiusXL = radiusBase;
|
|
5238
|
+
let radiusXXL = radiusBase;
|
|
5569
5239
|
let radiusOuter = radiusBase;
|
|
5570
5240
|
// radiusLG
|
|
5571
5241
|
if (radiusBase < 6 && radiusBase >= 5) {
|
|
@@ -5607,11 +5277,15 @@ const genRadius = (radiusBase) => {
|
|
|
5607
5277
|
else if (radiusBase >= 8) {
|
|
5608
5278
|
radiusOuter = 6;
|
|
5609
5279
|
}
|
|
5280
|
+
radiusXL = radiusLG > 0 ? radiusLG + 4 : radiusLG;
|
|
5281
|
+
radiusXXL = radiusLG > 0 ? radiusLG + 8 : radiusLG;
|
|
5610
5282
|
return {
|
|
5611
5283
|
borderRadius: radiusBase > 16 ? 16 : radiusBase,
|
|
5612
5284
|
borderRadiusXS: radiusXS,
|
|
5613
5285
|
borderRadiusSM: radiusSM,
|
|
5614
5286
|
borderRadiusLG: radiusLG,
|
|
5287
|
+
borderRadiusXL: radiusXL,
|
|
5288
|
+
borderRadiusXXL: radiusXXL,
|
|
5615
5289
|
borderRadiusOuter: radiusOuter,
|
|
5616
5290
|
};
|
|
5617
5291
|
};
|
|
@@ -5652,8 +5326,14 @@ const generateColorPalettes$1 = (baseColor) => {
|
|
|
5652
5326
|
};
|
|
5653
5327
|
};
|
|
5654
5328
|
const generateNeutralColorPalettes$1 = (bgBaseColor, textBaseColor) => {
|
|
5655
|
-
|
|
5656
|
-
|
|
5329
|
+
let colorBgBase = bgBaseColor || '#fff';
|
|
5330
|
+
let colorTextBase = textBaseColor || '#000';
|
|
5331
|
+
colorBgBase = new TinyColor(colorBgBase).lighten()
|
|
5332
|
+
? colorBgBase
|
|
5333
|
+
: new TinyColor(colorBgBase).lighten(100).toRgbString();
|
|
5334
|
+
colorTextBase = new TinyColor(colorTextBase).isDark()
|
|
5335
|
+
? colorTextBase
|
|
5336
|
+
: new TinyColor(colorTextBase).darken(100).toRgbString();
|
|
5657
5337
|
return {
|
|
5658
5338
|
colorBgBase,
|
|
5659
5339
|
colorTextBase,
|
|
@@ -5773,8 +5453,14 @@ const generateColorPalettes = (baseColor) => {
|
|
|
5773
5453
|
};
|
|
5774
5454
|
};
|
|
5775
5455
|
const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
|
|
5776
|
-
|
|
5777
|
-
|
|
5456
|
+
let colorBgBase = bgBaseColor || '#000';
|
|
5457
|
+
let colorTextBase = textBaseColor || '#fff';
|
|
5458
|
+
colorBgBase = new TinyColor(colorBgBase).isDark()
|
|
5459
|
+
? colorBgBase
|
|
5460
|
+
: new TinyColor(colorBgBase).darken(100).toRgbString();
|
|
5461
|
+
colorTextBase = new TinyColor(colorTextBase).isLight()
|
|
5462
|
+
? colorTextBase
|
|
5463
|
+
: new TinyColor(colorTextBase).lighten(100).toRgbString();
|
|
5778
5464
|
return {
|
|
5779
5465
|
colorBgBase,
|
|
5780
5466
|
colorTextBase,
|
|
@@ -5862,20 +5548,20 @@ const generateMettingNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
|
|
|
5862
5548
|
return {
|
|
5863
5549
|
colorBgBase,
|
|
5864
5550
|
colorTextBase,
|
|
5865
|
-
colorText: getAlphaColor$1(colorTextBase,
|
|
5866
|
-
colorTextSecondary: getAlphaColor$1(colorTextBase, 0.
|
|
5867
|
-
colorTextTertiary: getAlphaColor$1(colorTextBase, 0.
|
|
5868
|
-
colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.
|
|
5869
|
-
colorFill: getAlphaColor$1(colorTextBase, 0.
|
|
5870
|
-
colorFillSecondary: getAlphaColor$1(colorTextBase, 0.
|
|
5871
|
-
colorFillTertiary: getAlphaColor$1(colorTextBase, 0.
|
|
5872
|
-
colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.
|
|
5873
|
-
colorBgLayout: getDarkenSolidColor(colorBgBase,
|
|
5551
|
+
colorText: getAlphaColor$1(colorTextBase, 0.9),
|
|
5552
|
+
colorTextSecondary: getAlphaColor$1(colorTextBase, 0.8),
|
|
5553
|
+
colorTextTertiary: getAlphaColor$1(colorTextBase, 0.7),
|
|
5554
|
+
colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.6),
|
|
5555
|
+
colorFill: getAlphaColor$1(colorTextBase, 0.3),
|
|
5556
|
+
colorFillSecondary: getAlphaColor$1(colorTextBase, 0.2),
|
|
5557
|
+
colorFillTertiary: getAlphaColor$1(colorTextBase, 0.1),
|
|
5558
|
+
colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.06),
|
|
5559
|
+
colorBgLayout: getDarkenSolidColor(colorBgBase, 6),
|
|
5874
5560
|
colorBgContainer: getDarkenSolidColor(colorBgBase, 0),
|
|
5875
5561
|
colorBgElevated: getDarkenSolidColor(colorBgBase, 0),
|
|
5876
|
-
colorBgSpotlight: getAlphaColor$1(colorTextBase,
|
|
5562
|
+
colorBgSpotlight: getAlphaColor$1(colorTextBase, 1),
|
|
5877
5563
|
colorBorder: getDarkenSolidColor(colorBgBase, 30),
|
|
5878
|
-
colorBorderSecondary: getDarkenSolidColor(colorBgBase,
|
|
5564
|
+
colorBorderSecondary: getDarkenSolidColor(colorBgBase, 12),
|
|
5879
5565
|
};
|
|
5880
5566
|
};
|
|
5881
5567
|
|
|
@@ -6243,29 +5929,16 @@ const useRequestHeader = (userLanguage) => (config) => {
|
|
|
6243
5929
|
};
|
|
6244
5930
|
return config;
|
|
6245
5931
|
};
|
|
6246
|
-
|
|
6247
|
-
const { data, headers } = response;
|
|
6248
|
-
const DataMaskValue = get$1(headers, getMaskHeaderKey(), '');
|
|
6249
|
-
if (DataMaskValue) {
|
|
6250
|
-
const secretKey = getSecretKey(DataMaskValue);
|
|
6251
|
-
const base64Key = toBase64(secretKey);
|
|
6252
|
-
const decryption = decryptByAES(data, base64Key, base64Key);
|
|
6253
|
-
response.data = JSON.parse(decryption);
|
|
6254
|
-
}
|
|
6255
|
-
return response;
|
|
6256
|
-
};
|
|
6257
|
-
var main = async ({ microServiceMap, secret, dynamicLangCallback, ...globalOptions }) => {
|
|
5932
|
+
var main = async ({ microServiceMap, dynamicLangCallback, ...globalOptions }) => {
|
|
6258
5933
|
requestInstance.interceptors.request.use(useRequestMicroSevices(microServiceMap));
|
|
6259
5934
|
await globalStore.findPlantform();
|
|
6260
5935
|
const locale = getLocaleKey();
|
|
6261
5936
|
requestInstance.interceptors.request.use(useRequestHeader(locale));
|
|
6262
|
-
if (secret)
|
|
6263
|
-
requestInstance.interceptors.response.use(useResponsedecryptParse);
|
|
6264
5937
|
await initDynamicLang(locale);
|
|
6265
5938
|
await dynamicLangCallback?.();
|
|
6266
5939
|
const res = await globalStore.init(globalOptions);
|
|
6267
5940
|
return res;
|
|
6268
5941
|
};
|
|
6269
5942
|
|
|
6270
|
-
export { MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, PROGRESS_UPDEDATE, PresetColors, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative$1 as compactAlgorithm, index as companydataStore, derivative$2 as darkAlgorithm,
|
|
5943
|
+
export { MENU_BREADCRUMBS_UPDATE, MENU_HISTORY_UPDATE, PROGRESS_UPDEDATE, PresetColors, WS_CONTENT_CLOSE, WS_CONTENT_ERROR, WS_CONTENT_SUCCESS, codeListStore, derivative$1 as compactAlgorithm, index as companydataStore, derivative$2 as darkAlgorithm, derivative$3 as defaultAlgorithm, emitter, expireCache, formatToken as formatAliasToken, getAliasToken, getAlphaColor$1 as getAlphaColor, getAntdLocaleKey, getBackgroundColor, getDarkenSolidColor, getLightenSolidColor, getLocaleKey, getRoutes, getTokenCssVar, getTraceId, globalStore, main as init, initDynamicLang, lighten, loginStore, menuStore, parameterStore, Progress as progress, request, requestInstance, seedToken as seed, setLocaleKey, storage as storageStore, token, tr, useRequestHeader, useRequestMicroSevices, userStore, websocket };
|
|
6271
5944
|
//# sourceMappingURL=index.js.map
|