@lingxiteam/assets 0.8.30-alpha.4 → 0.8.30-alpha.6

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.
@@ -2,6 +2,7 @@ export declare const securityHeaderKey = "XA-TYPE";
2
2
  export declare const defaultSignKey = "X-SIGN";
3
3
  export declare const MODE: {
4
4
  SIGN_KEY: string;
5
+ SIGN: string;
5
6
  RSA: string;
6
7
  AES: string;
7
8
  DES: string;
@@ -4,6 +4,7 @@ export var securityHeaderKey = 'XA-TYPE';
4
4
  export var defaultSignKey = 'X-SIGN';
5
5
  export var MODE = {
6
6
  SIGN_KEY: 'signKey',
7
+ SIGN: '1.0',
7
8
  RSA: '2.0',
8
9
  AES: '3.0',
9
10
  DES: '4.0'
@@ -134,7 +134,8 @@ function encrypted(url, opts, type) {
134
134
  // // sessionStorage.setItem(id, JSON.stringify(value));
135
135
  // Object.defineProperty(LXREQ, id, {
136
136
  // get() {
137
- // return JSON.parse(value || '');
137
+ // // debugData.show(id)
138
+ // return '';
138
139
  // },
139
140
  // });
140
141
  // }
@@ -150,7 +151,7 @@ var fetch = function fetch(url) {
150
151
  var isDebug = (config === null || config === void 0 ? void 0 : config.debug) || window.lxDebug || !!window.localStorage.getItem('lxDebug') || true; // ------ 参数签名(默认) ------
151
152
 
152
153
  if ( // 配置开启加密
153
- (!config.mode || config.mode === MODE.SIGN_KEY) && (fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.disabledSignKey) !== true || // 请求头开启加密
154
+ (config.mode === MODE.SIGN_KEY || config.mode === MODE.SIGN) && (fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.disabledSignKey) !== true || // 请求头开启加密
154
155
  optSecurityHeaderKey === '1.0') {
155
156
  var _config$signKeyOption;
156
157
 
@@ -17,7 +17,7 @@ var originFetch = window.fetch;
17
17
 
18
18
  function start(_ref) {
19
19
  var _ref$mode = _ref.mode,
20
- mode = _ref$mode === void 0 ? '' : _ref$mode,
20
+ mode = _ref$mode === void 0 ? '1.0' : _ref$mode,
21
21
  _ref$signKeyOptions = _ref.signKeyOptions,
22
22
  signKeyOptions = _ref$signKeyOptions === void 0 ? {} : _ref$signKeyOptions,
23
23
  _ref$aesOptions = _ref.aesOptions,
@@ -35,7 +35,8 @@ function start(_ref) {
35
35
  if (isHttpEncryption) return true;
36
36
 
37
37
  switch (mode) {
38
- case 'signKey':
38
+ case 'signKey': // 兼容旧数据
39
+
39
40
  case '1.0':
40
41
  case '2.0':
41
42
  case '3.0':
@@ -1,5 +1,9 @@
1
1
  import httpEncryption from './httpEncryption';
2
2
  import sign from './encipher/sign';
3
+ window.lingxiSecurity = {
4
+ httpEncryption: httpEncryption,
5
+ sign: sign
6
+ };
3
7
  export default {
4
8
  httpEncryption: httpEncryption,
5
9
  sign: sign
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/assets",
3
- "version": "0.8.30-alpha.4",
3
+ "version": "0.8.30-alpha.6",
4
4
  "description": "灵犀低代码平台移动端 - 工具类",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "gitHead": "bcd338198e2c14459538542d10600ab03abc92f2",
37
37
  "dependencies": {
38
- "crypto-js": "^4.1.1",
38
+ "crypto-js": "^4.0.0",
39
39
  "js-sha256": "^0.9.0",
40
40
  "jsencrypt": "^3.1.0"
41
41
  }