isdata-customer-sdk 0.1.86 → 0.1.88
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/dist/index.common.js +38 -8
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +38 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +3 -3
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -29559,6 +29559,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29559
29559
|
createFileFromUrl: function() { return /* reexport */ createFileFromUrl; },
|
|
29560
29560
|
decrypt: function() { return /* reexport */ decrypt; },
|
|
29561
29561
|
destroyEventCenter: function() { return /* reexport */ destroyEventCenter; },
|
|
29562
|
+
encrypt: function() { return /* reexport */ encrypt; },
|
|
29562
29563
|
extractFilenameFromUrl: function() { return /* reexport */ extractFilenameFromUrl; },
|
|
29563
29564
|
fireEvent: function() { return /* reexport */ fireEvent; },
|
|
29564
29565
|
getAIRobotInfos: function() { return /* reexport */ getAIRobotInfos; },
|
|
@@ -29598,6 +29599,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29598
29599
|
getThirdAppPathByKey: function() { return /* reexport */ getThirdAppPathByKey; },
|
|
29599
29600
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
29600
29601
|
getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
|
|
29602
|
+
getUserID: function() { return /* reexport */ getUserID; },
|
|
29601
29603
|
hasListener: function() { return /* reexport */ hasListener; },
|
|
29602
29604
|
initEventCenter: function() { return /* reexport */ initEventCenter; },
|
|
29603
29605
|
initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
|
|
@@ -32240,6 +32242,15 @@ const decrypt = async decryptStr => {
|
|
|
32240
32242
|
return decrypted;
|
|
32241
32243
|
};
|
|
32242
32244
|
|
|
32245
|
+
/**
|
|
32246
|
+
* 解密
|
|
32247
|
+
*/
|
|
32248
|
+
const encrypt = async decryptStr => {
|
|
32249
|
+
let secretKey = await getKey();
|
|
32250
|
+
const encrypted = crypto_js_default().AES.encrypt(decryptStr, secretKey).toString();
|
|
32251
|
+
return encrypted;
|
|
32252
|
+
};
|
|
32253
|
+
|
|
32243
32254
|
/**
|
|
32244
32255
|
* 切换门户登录
|
|
32245
32256
|
*/
|
|
@@ -32261,6 +32272,18 @@ const switchPortalLogin = async (data, appid, endside_type) => {
|
|
|
32261
32272
|
};
|
|
32262
32273
|
}
|
|
32263
32274
|
};
|
|
32275
|
+
const getUserID = async (acccountName, old_key, group_id) => {
|
|
32276
|
+
let queryData = {
|
|
32277
|
+
param: {
|
|
32278
|
+
accountName: acccountName,
|
|
32279
|
+
group_id: group_id,
|
|
32280
|
+
account_key: old_key
|
|
32281
|
+
}
|
|
32282
|
+
};
|
|
32283
|
+
let result = await request.post(`/dataservice/rest/orchestration/getUserID`, queryData);
|
|
32284
|
+
let persion_id = result.data.persion_id;
|
|
32285
|
+
return persion_id;
|
|
32286
|
+
};
|
|
32264
32287
|
|
|
32265
32288
|
/**
|
|
32266
32289
|
* 登录账号
|
|
@@ -32284,25 +32307,32 @@ const loginAccount = async (data, appid) => {
|
|
|
32284
32307
|
}
|
|
32285
32308
|
};
|
|
32286
32309
|
let result = await request.post(`/dataservice/rest/orchestration/getLoginPortalAccountKey`, queryData);
|
|
32310
|
+
//密码反向解析Key
|
|
32287
32311
|
let secretKey = await getKey();
|
|
32288
|
-
let
|
|
32289
|
-
let code = response.result.code;
|
|
32312
|
+
let code = result.data.code;
|
|
32290
32313
|
//获取key成功
|
|
32291
32314
|
if (code == 10001) {
|
|
32292
|
-
|
|
32315
|
+
//保存的真正一级密码
|
|
32316
|
+
let pwd_code = result.data.codeData.key;
|
|
32317
|
+
//缓存一级密码
|
|
32293
32318
|
let old_key = pwd_code;
|
|
32294
|
-
|
|
32319
|
+
//保存的正则2级密码
|
|
32320
|
+
let key_code = result.data.codeData.code;
|
|
32321
|
+
//反向解析一级密码
|
|
32295
32322
|
pwd_code = crypto_js_default().AES.decrypt(pwd_code, secretKey).toString((crypto_js_default()).enc.Utf8);
|
|
32323
|
+
//反向解析2级密码
|
|
32296
32324
|
key_code = crypto_js_default().AES.decrypt(key_code, secretKey).toString((crypto_js_default()).enc.Utf8);
|
|
32297
|
-
|
|
32298
|
-
|
|
32325
|
+
//密码匹配
|
|
32326
|
+
if (pwd_code == data.password) {
|
|
32327
|
+
//平台正向加密2级密码
|
|
32328
|
+
pwd_code = window.appSdk.Encrypt(key_code);
|
|
32299
32329
|
data.password = pwd_code;
|
|
32300
32330
|
result = await request.post(`/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`, data);
|
|
32301
|
-
response = JSON.parse(result.request.response);
|
|
32331
|
+
let response = JSON.parse(result.request.response);
|
|
32302
32332
|
code = response.code;
|
|
32303
32333
|
//登录平台成功
|
|
32304
32334
|
if (code == 10110004) {
|
|
32305
|
-
let id =
|
|
32335
|
+
let id = await getUserID(data.account_view, old_key, data.groupid);
|
|
32306
32336
|
// 初始化解析器
|
|
32307
32337
|
const parser = new UAParser();
|
|
32308
32338
|
// 获取浏览器信息
|