isdata-customer-sdk 0.2.48 → 0.2.50
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 +99 -81
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +99 -81
- 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
|
@@ -29583,7 +29583,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29583
29583
|
getIntegrateAppInfoByID: function() { return /* reexport */ getIntegrateAppInfoByID; },
|
|
29584
29584
|
getLanguages: function() { return /* reexport */ getLanguages; },
|
|
29585
29585
|
getLoginPageNotices: function() { return /* reexport */ getLoginPageNotices; },
|
|
29586
|
-
getLoginPortalAccountKey: function() { return /* reexport */ getLoginPortalAccountKey; },
|
|
29587
29586
|
getMappingAppInfoByID: function() { return /* reexport */ getMappingAppInfoByID; },
|
|
29588
29587
|
getMenuDatasByGroupID: function() { return /* reexport */ getMenuDatasByGroupID; },
|
|
29589
29588
|
getMenuMappingDatasByRoleIDs: function() { return /* reexport */ getMenuMappingDatasByRoleIDs; },
|
|
@@ -29638,6 +29637,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29638
29637
|
sendPostToAIAgent: function() { return /* reexport */ sendPostToAIAgent; },
|
|
29639
29638
|
sendSms: function() { return /* reexport */ sendSms; },
|
|
29640
29639
|
sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
|
|
29640
|
+
serverDecrypt: function() { return /* reexport */ serverDecrypt; },
|
|
29641
|
+
serverEncrypt: function() { return /* reexport */ serverEncrypt; },
|
|
29641
29642
|
setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
|
|
29642
29643
|
switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
|
|
29643
29644
|
transformPortalQuickMenuDatas: function() { return /* reexport */ transformPortalQuickMenuDatas; },
|
|
@@ -30030,18 +30031,22 @@ const getPortalDocmentInfo = async kb_doc_id => {
|
|
|
30030
30031
|
let docInfo = result.data.docInfo;
|
|
30031
30032
|
return docInfo;
|
|
30032
30033
|
};
|
|
30033
|
-
|
|
30034
|
-
|
|
30035
|
-
|
|
30036
|
-
|
|
30037
|
-
|
|
30038
|
-
|
|
30039
|
-
|
|
30040
|
-
|
|
30041
|
-
|
|
30042
|
-
|
|
30043
|
-
|
|
30044
|
-
|
|
30034
|
+
|
|
30035
|
+
// export const getLoginPortalAccountKey = async (loginName,groupID) => {
|
|
30036
|
+
// let queryData = {
|
|
30037
|
+
// param: {
|
|
30038
|
+
// loginData: {
|
|
30039
|
+
// account: loginName,
|
|
30040
|
+
// group_id: groupID,
|
|
30041
|
+
// },
|
|
30042
|
+
// },
|
|
30043
|
+
// };
|
|
30044
|
+
// let result = await request.post(
|
|
30045
|
+
// `/dataservice/rest/orchestration/getLoginPortalAccountKey`,
|
|
30046
|
+
// queryData
|
|
30047
|
+
// );
|
|
30048
|
+
// return result;
|
|
30049
|
+
// };
|
|
30045
30050
|
|
|
30046
30051
|
/**
|
|
30047
30052
|
* 获取该平台菜单同祖先(直至根节点)得其他兄弟菜单
|
|
@@ -33671,7 +33676,6 @@ const getAllI18nTypes = async () => {
|
|
|
33671
33676
|
|
|
33672
33677
|
|
|
33673
33678
|
|
|
33674
|
-
|
|
33675
33679
|
/**
|
|
33676
33680
|
*
|
|
33677
33681
|
* @returns 获取登录验证码图片
|
|
@@ -33705,6 +33709,24 @@ const logoutAccount = async endside_type => {
|
|
|
33705
33709
|
}
|
|
33706
33710
|
};
|
|
33707
33711
|
|
|
33712
|
+
/**
|
|
33713
|
+
* 服务端解密
|
|
33714
|
+
*/
|
|
33715
|
+
const serverDecrypt = async decryptStr => {
|
|
33716
|
+
// let home_page = `http://${window.location.hostname}:8280`;
|
|
33717
|
+
let home_page = `http://127.0.0.1:8280`;
|
|
33718
|
+
let questUrl = `${home_page}/portal/serverDecrypt`;
|
|
33719
|
+
let queryData = {
|
|
33720
|
+
param: {
|
|
33721
|
+
decryptStr: decryptStr
|
|
33722
|
+
}
|
|
33723
|
+
};
|
|
33724
|
+
//保存的正则2级密码
|
|
33725
|
+
let resultData = await request.post(questUrl, JSON.stringify(queryData));
|
|
33726
|
+
decryptStr = resultData.data.decryptStr;
|
|
33727
|
+
return decryptStr;
|
|
33728
|
+
};
|
|
33729
|
+
|
|
33708
33730
|
/**
|
|
33709
33731
|
* 解密
|
|
33710
33732
|
*/
|
|
@@ -33723,6 +33745,24 @@ const viewEncrypt = async decryptStr => {
|
|
|
33723
33745
|
return encrypted;
|
|
33724
33746
|
};
|
|
33725
33747
|
|
|
33748
|
+
/**
|
|
33749
|
+
* 服务端加密
|
|
33750
|
+
*/
|
|
33751
|
+
const serverEncrypt = async encryptStr => {
|
|
33752
|
+
// let home_page = `http://${window.location.hostname}:8280`;
|
|
33753
|
+
let home_page = `http://127.0.0.1:8280`;
|
|
33754
|
+
let questUrl = `${home_page}/portal/serverEncrypt`;
|
|
33755
|
+
let queryData = {
|
|
33756
|
+
param: {
|
|
33757
|
+
encryptStr: encryptStr
|
|
33758
|
+
}
|
|
33759
|
+
};
|
|
33760
|
+
//保存的正则2级密码
|
|
33761
|
+
let resultData = await request.post(questUrl, JSON.stringify(queryData));
|
|
33762
|
+
encryptStr = resultData.data.encryptStr;
|
|
33763
|
+
return encryptStr;
|
|
33764
|
+
};
|
|
33765
|
+
|
|
33726
33766
|
/**
|
|
33727
33767
|
* 切换门户登录
|
|
33728
33768
|
*/
|
|
@@ -33745,22 +33785,6 @@ const switchPortalLogin = async (data, appid, endside_type) => {
|
|
|
33745
33785
|
}
|
|
33746
33786
|
};
|
|
33747
33787
|
|
|
33748
|
-
// export const getUserID = async (acccountName, old_key, group_id) => {
|
|
33749
|
-
// let queryData = {
|
|
33750
|
-
// param: {
|
|
33751
|
-
// accountName: acccountName,
|
|
33752
|
-
// group_id: group_id,
|
|
33753
|
-
// account_key: old_key,
|
|
33754
|
-
// },
|
|
33755
|
-
// };
|
|
33756
|
-
// let result = await request.post(
|
|
33757
|
-
// `/dataservice/rest/orchestration/getUserID`,
|
|
33758
|
-
// queryData
|
|
33759
|
-
// );
|
|
33760
|
-
// let persion_id = result.data.persion_id;
|
|
33761
|
-
// return persion_id;
|
|
33762
|
-
// };
|
|
33763
|
-
|
|
33764
33788
|
/**
|
|
33765
33789
|
* 是否是安全账号
|
|
33766
33790
|
* @param {*} acccountName
|
|
@@ -33791,62 +33815,56 @@ const isSecurityAccount = async (acccountName, group_id) => {
|
|
|
33791
33815
|
* @returns
|
|
33792
33816
|
*/
|
|
33793
33817
|
const loginAccount = async (data, appid) => {
|
|
33794
|
-
let
|
|
33795
|
-
let
|
|
33796
|
-
|
|
33797
|
-
|
|
33798
|
-
|
|
33799
|
-
|
|
33800
|
-
|
|
33801
|
-
|
|
33802
|
-
|
|
33803
|
-
|
|
33804
|
-
|
|
33805
|
-
|
|
33806
|
-
|
|
33818
|
+
let home_page = `http://${window.location.hostname}:8280`;
|
|
33819
|
+
// let home_page = `http://127.0.0.1:8280`;
|
|
33820
|
+
let questUrl = `${home_page}/portal/loginAccount`;
|
|
33821
|
+
let password = await viewEncrypt(data.password);
|
|
33822
|
+
let queryData = {
|
|
33823
|
+
param: {
|
|
33824
|
+
account_view: data.account_view,
|
|
33825
|
+
groupid: data.groupid,
|
|
33826
|
+
password: password,
|
|
33827
|
+
account: data.account,
|
|
33828
|
+
appid: appid
|
|
33829
|
+
}
|
|
33830
|
+
};
|
|
33831
|
+
//保存的正则2级密码
|
|
33832
|
+
let resultData = await request.post(questUrl, JSON.stringify(queryData));
|
|
33833
|
+
let code = resultData.data.code;
|
|
33834
|
+
let key_code = resultData.data.key_code;
|
|
33835
|
+
let old_code = resultData.data.old_code;
|
|
33836
|
+
let login_account_id = resultData.data.id;
|
|
33837
|
+
//登录平台成功
|
|
33838
|
+
if (code == 10110004) {
|
|
33807
33839
|
key_code = await viewDecrypt(key_code);
|
|
33808
|
-
|
|
33809
|
-
|
|
33810
|
-
|
|
33811
|
-
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
let
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
|
|
33818
|
-
|
|
33819
|
-
|
|
33820
|
-
|
|
33821
|
-
|
|
33822
|
-
|
|
33823
|
-
|
|
33824
|
-
|
|
33825
|
-
|
|
33826
|
-
window.sessionStorage.setItem("iportal_group_id", data.groupid);
|
|
33827
|
-
window.sessionStorage.setItem("iportal_login_user_key", old_key);
|
|
33828
|
-
window.sessionStorage.setItem("iportal_client_id", clientID);
|
|
33829
|
-
window.sessionStorage.setItem("iportal_app_id", appid);
|
|
33830
|
-
return {
|
|
33831
|
-
code: code
|
|
33832
|
-
};
|
|
33833
|
-
} else {
|
|
33834
|
-
return {
|
|
33835
|
-
code: code,
|
|
33836
|
-
message: i18nText(response.message)
|
|
33837
|
-
};
|
|
33838
|
-
}
|
|
33839
|
-
} else {
|
|
33840
|
+
key_code = window.appSdk.Encrypt(key_code);
|
|
33841
|
+
queryData.param.password = key_code;
|
|
33842
|
+
resultData = await request.post(`/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`, queryData.param);
|
|
33843
|
+
let response = JSON.parse(resultData.request.response);
|
|
33844
|
+
code = response.code;
|
|
33845
|
+
if (code == 10110004) {
|
|
33846
|
+
let id = login_account_id;
|
|
33847
|
+
// 初始化解析器
|
|
33848
|
+
const parser = new UAParser();
|
|
33849
|
+
// 获取浏览器信息
|
|
33850
|
+
const browser = parser.getBrowser();
|
|
33851
|
+
let timestamp = new Date().getTime();
|
|
33852
|
+
let clientID = browser.name + "_" + browser.version + "_" + timestamp;
|
|
33853
|
+
window.sessionStorage.setItem("iportal_login_user_id", id);
|
|
33854
|
+
window.sessionStorage.setItem("iportal_group_id", data.groupid);
|
|
33855
|
+
window.sessionStorage.setItem("iportal_login_user_key", old_code);
|
|
33856
|
+
window.sessionStorage.setItem("iportal_client_id", clientID);
|
|
33857
|
+
window.sessionStorage.setItem("iportal_app_id", appid);
|
|
33840
33858
|
return {
|
|
33841
|
-
code: code
|
|
33842
|
-
message: i18nText("账户密码错误")
|
|
33859
|
+
code: code
|
|
33843
33860
|
};
|
|
33844
33861
|
}
|
|
33862
|
+
} else {
|
|
33863
|
+
return {
|
|
33864
|
+
code: code,
|
|
33865
|
+
message: i18nText(response.message)
|
|
33866
|
+
};
|
|
33845
33867
|
}
|
|
33846
|
-
return {
|
|
33847
|
-
code: code,
|
|
33848
|
-
message: i18nText(result.data.message)
|
|
33849
|
-
};
|
|
33850
33868
|
};
|
|
33851
33869
|
|
|
33852
33870
|
/**
|