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.umd.js
CHANGED
|
@@ -29569,6 +29569,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29569
29569
|
createFileFromUrl: function() { return /* reexport */ createFileFromUrl; },
|
|
29570
29570
|
decrypt: function() { return /* reexport */ decrypt; },
|
|
29571
29571
|
destroyEventCenter: function() { return /* reexport */ destroyEventCenter; },
|
|
29572
|
+
encrypt: function() { return /* reexport */ encrypt; },
|
|
29572
29573
|
extractFilenameFromUrl: function() { return /* reexport */ extractFilenameFromUrl; },
|
|
29573
29574
|
fireEvent: function() { return /* reexport */ fireEvent; },
|
|
29574
29575
|
getAIRobotInfos: function() { return /* reexport */ getAIRobotInfos; },
|
|
@@ -29608,6 +29609,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29608
29609
|
getThirdAppPathByKey: function() { return /* reexport */ getThirdAppPathByKey; },
|
|
29609
29610
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
29610
29611
|
getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
|
|
29612
|
+
getUserID: function() { return /* reexport */ getUserID; },
|
|
29611
29613
|
hasListener: function() { return /* reexport */ hasListener; },
|
|
29612
29614
|
initEventCenter: function() { return /* reexport */ initEventCenter; },
|
|
29613
29615
|
initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
|
|
@@ -32250,6 +32252,15 @@ const decrypt = async decryptStr => {
|
|
|
32250
32252
|
return decrypted;
|
|
32251
32253
|
};
|
|
32252
32254
|
|
|
32255
|
+
/**
|
|
32256
|
+
* 解密
|
|
32257
|
+
*/
|
|
32258
|
+
const encrypt = async decryptStr => {
|
|
32259
|
+
let secretKey = await getKey();
|
|
32260
|
+
const encrypted = crypto_js_default().AES.encrypt(decryptStr, secretKey).toString();
|
|
32261
|
+
return encrypted;
|
|
32262
|
+
};
|
|
32263
|
+
|
|
32253
32264
|
/**
|
|
32254
32265
|
* 切换门户登录
|
|
32255
32266
|
*/
|
|
@@ -32271,6 +32282,18 @@ const switchPortalLogin = async (data, appid, endside_type) => {
|
|
|
32271
32282
|
};
|
|
32272
32283
|
}
|
|
32273
32284
|
};
|
|
32285
|
+
const getUserID = async (acccountName, old_key, group_id) => {
|
|
32286
|
+
let queryData = {
|
|
32287
|
+
param: {
|
|
32288
|
+
accountName: acccountName,
|
|
32289
|
+
group_id: group_id,
|
|
32290
|
+
account_key: old_key
|
|
32291
|
+
}
|
|
32292
|
+
};
|
|
32293
|
+
let result = await request.post(`/dataservice/rest/orchestration/getUserID`, queryData);
|
|
32294
|
+
let persion_id = result.data.persion_id;
|
|
32295
|
+
return persion_id;
|
|
32296
|
+
};
|
|
32274
32297
|
|
|
32275
32298
|
/**
|
|
32276
32299
|
* 登录账号
|
|
@@ -32294,25 +32317,32 @@ const loginAccount = async (data, appid) => {
|
|
|
32294
32317
|
}
|
|
32295
32318
|
};
|
|
32296
32319
|
let result = await request.post(`/dataservice/rest/orchestration/getLoginPortalAccountKey`, queryData);
|
|
32320
|
+
//密码反向解析Key
|
|
32297
32321
|
let secretKey = await getKey();
|
|
32298
|
-
let
|
|
32299
|
-
let code = response.result.code;
|
|
32322
|
+
let code = result.data.code;
|
|
32300
32323
|
//获取key成功
|
|
32301
32324
|
if (code == 10001) {
|
|
32302
|
-
|
|
32325
|
+
//保存的真正一级密码
|
|
32326
|
+
let pwd_code = result.data.codeData.key;
|
|
32327
|
+
//缓存一级密码
|
|
32303
32328
|
let old_key = pwd_code;
|
|
32304
|
-
|
|
32329
|
+
//保存的正则2级密码
|
|
32330
|
+
let key_code = result.data.codeData.code;
|
|
32331
|
+
//反向解析一级密码
|
|
32305
32332
|
pwd_code = crypto_js_default().AES.decrypt(pwd_code, secretKey).toString((crypto_js_default()).enc.Utf8);
|
|
32333
|
+
//反向解析2级密码
|
|
32306
32334
|
key_code = crypto_js_default().AES.decrypt(key_code, secretKey).toString((crypto_js_default()).enc.Utf8);
|
|
32307
|
-
|
|
32308
|
-
|
|
32335
|
+
//密码匹配
|
|
32336
|
+
if (pwd_code == data.password) {
|
|
32337
|
+
//平台正向加密2级密码
|
|
32338
|
+
pwd_code = window.appSdk.Encrypt(key_code);
|
|
32309
32339
|
data.password = pwd_code;
|
|
32310
32340
|
result = await request.post(`/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`, data);
|
|
32311
|
-
response = JSON.parse(result.request.response);
|
|
32341
|
+
let response = JSON.parse(result.request.response);
|
|
32312
32342
|
code = response.code;
|
|
32313
32343
|
//登录平台成功
|
|
32314
32344
|
if (code == 10110004) {
|
|
32315
|
-
let id =
|
|
32345
|
+
let id = await getUserID(data.account_view, old_key, data.groupid);
|
|
32316
32346
|
// 初始化解析器
|
|
32317
32347
|
const parser = new UAParser();
|
|
32318
32348
|
// 获取浏览器信息
|