@indfnd/utils 0.1.18 → 0.1.21

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.21](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.20...v0.1.21) (2025-05-08)
6
+
7
+ ### [0.1.20](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.19...v0.1.20) (2025-01-06)
8
+
9
+
10
+ ### Features
11
+
12
+ * 登录逻辑修改 ([c5df0d1](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/c5df0d10739b35d9e515ad435d687fc9d1ae8b16))
13
+ * 山东待办 ([6bf8fa2](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/6bf8fa2725124a3cd0243c91ffdbb785af940806))
14
+ * 增加base64 ([61b40cd](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/61b40cd8f02885f64c4e4a3d1575242224e1e103))
15
+
16
+ ### [0.1.19](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.18...v0.1.19) (2025-01-06)
17
+
5
18
  ### [0.1.18](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.17...v0.1.18) (2024-12-07)
6
19
 
7
20
 
@@ -3188,6 +3188,7 @@ const TOKEN_KEY = "v8-token";
3188
3188
  const TOKEN_KEY_IBP = "lambo-token";
3189
3189
  function setToken(token) {
3190
3190
  setLocalStorage(TOKEN_KEY, token);
3191
+ setSessionStorage(TOKEN_KEY_IBP, token);
3191
3192
  Cookie.set("TOKEN_KEY", token, 1);
3192
3193
  }
3193
3194
  function getToken() {
@@ -3310,6 +3311,7 @@ function requestInterceptors(config2) {
3310
3311
  return config2;
3311
3312
  }
3312
3313
  function responseInterceptors(response) {
3314
+ var _a;
3313
3315
  let data = response.data;
3314
3316
  const contentType = getContentType(response.headers);
3315
3317
  if (contentType !== CONTENT_TYPE.json) {
@@ -3321,6 +3323,11 @@ function responseInterceptors(response) {
3321
3323
  const code = data.code;
3322
3324
  switch (code) {
3323
3325
  case SUCCESS_CODE: {
3326
+ if (sessionStorage.getItem("isFromIM") == "1" && ((_a = data == null ? void 0 : data.extInfo) == null ? void 0 : _a.handleTask)) {
3327
+ if (typeof window.native != "undefined") {
3328
+ window.native.goHome();
3329
+ }
3330
+ }
3324
3331
  return data;
3325
3332
  }
3326
3333
  case NO_SESSION_CODE: {
@@ -11135,12 +11142,98 @@ function getPreviewUrlApi(fileId) {
11135
11142
  axiosConfig
11136
11143
  );
11137
11144
  }
11145
+ let Base64 = {
11146
+ Base64Chars: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@*-",
11147
+ encode: function(s) {
11148
+ if (!s || s.length == 0)
11149
+ return s;
11150
+ var d = "";
11151
+ var b = this.ucs2_utf8(s);
11152
+ var b0, b1, b2, b3;
11153
+ var len = b.length;
11154
+ var i = 0;
11155
+ while (i < len) {
11156
+ var tmp = b[i++];
11157
+ b0 = (tmp & 252) >> 2;
11158
+ b1 = (tmp & 3) << 4;
11159
+ if (i < len) {
11160
+ tmp = b[i++];
11161
+ b1 |= (tmp & 240) >> 4;
11162
+ b2 = (tmp & 15) << 2;
11163
+ if (i < len) {
11164
+ tmp = b[i++];
11165
+ b2 |= (tmp & 192) >> 6;
11166
+ b3 = tmp & 63;
11167
+ } else {
11168
+ b3 = 64;
11169
+ }
11170
+ } else {
11171
+ b2 = b3 = 64;
11172
+ }
11173
+ d += this.Base64Chars.charAt(b0);
11174
+ d += this.Base64Chars.charAt(b1);
11175
+ d += this.Base64Chars.charAt(b2);
11176
+ d += this.Base64Chars.charAt(b3);
11177
+ }
11178
+ return d;
11179
+ },
11180
+ ucs2_utf8: function(s) {
11181
+ if (!s)
11182
+ return null;
11183
+ var d = new Array();
11184
+ if (s == "")
11185
+ return d;
11186
+ var c = 0, i = 0, j = 0;
11187
+ var len = s.length;
11188
+ while (i < len) {
11189
+ c = s.charCodeAt(i++);
11190
+ if (c <= 127) {
11191
+ d[j++] = c;
11192
+ } else if (c >= 128 && c <= 2047) {
11193
+ d[j++] = c >> 6 & 31 | 192;
11194
+ d[j++] = c & 63 | 128;
11195
+ } else {
11196
+ d[j++] = c >> 12 | 224;
11197
+ d[j++] = c >> 6 & 63 | 128;
11198
+ d[j++] = c & 63 | 128;
11199
+ }
11200
+ }
11201
+ return d;
11202
+ },
11203
+ utf8_ucs2: function(s) {
11204
+ if (!s)
11205
+ return null;
11206
+ var len = s.length;
11207
+ if (len == 0)
11208
+ return "";
11209
+ var d = "";
11210
+ var c = 0, i = 0, tmp = 0;
11211
+ while (i < len) {
11212
+ c = s[i++];
11213
+ if ((c & 224) == 224) {
11214
+ tmp = (c & 15) << 12;
11215
+ c = s[i++];
11216
+ tmp |= (c & 63) << 6;
11217
+ c = s[i++];
11218
+ tmp |= c & 63;
11219
+ } else if ((c & 192) == 192) {
11220
+ tmp = (c & 31) << 6;
11221
+ c = s[i++];
11222
+ tmp |= c & 63;
11223
+ } else {
11224
+ tmp = c;
11225
+ }
11226
+ d += String.fromCharCode(tmp);
11227
+ }
11228
+ return d;
11229
+ }
11230
+ };
11138
11231
  const CONTEXT$2 = config.authServerContext;
11139
11232
  function loginApi({ userName, password, validCodeId, validCodeInput }) {
11140
11233
  let publicKey = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD2iolFHi+6bUh+V6JPr2gFJQsC0QNsq2EwI0MAPlI5AaizBHRVMjX1H73ptuDSiT3QZh4kk74w+eDLyYj4JXo1SvvDw5w378SLhUIDzH0zrlt3oleT3kiPQxC17yM3Os/wrtHO7IC+KGo9qrg+LJFyR/fYYHcyH9i+JAejBEnJQIDAQAB`;
11141
11234
  let nodeRSA = new window.NodeRSA(publicKey, "pkcs8-public");
11142
11235
  let rsaPaswword = nodeRSA.encrypt(password, "base64");
11143
- let upw = window.Base64.encode(rsaPaswword);
11236
+ let upw = Base64.encode(rsaPaswword);
11144
11237
  const data = { usn: userName, upw, validCodeId, validCodeInput };
11145
11238
  return instance.formPost(CONTEXT$2 + "/sso/auth/login", data);
11146
11239
  }