isdata-customer-sdk 0.2.50 → 0.2.52

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.umd.js CHANGED
@@ -29635,6 +29635,7 @@ __webpack_require__.d(__webpack_exports__, {
29635
29635
  initDomNodeViewObserver: function() { return /* reexport */ initDomNodeViewObserver; },
29636
29636
  initEventCenter: function() { return /* reexport */ initEventCenter; },
29637
29637
  initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
29638
+ isSMSCodeValidate: function() { return /* reexport */ isSMSCodeValidate; },
29638
29639
  isSecurityAccount: function() { return /* reexport */ isSecurityAccount; },
29639
29640
  loadi18nTexts: function() { return /* reexport */ loadi18nTexts; },
29640
29641
  loginAccount: function() { return /* reexport */ loginAccount; },
@@ -33731,8 +33732,8 @@ const logoutAccount = async endside_type => {
33731
33732
  * 服务端解密
33732
33733
  */
33733
33734
  const serverDecrypt = async decryptStr => {
33734
- // let home_page = `http://${window.location.hostname}:8280`;
33735
- let home_page = `http://127.0.0.1:8280`;
33735
+ let home_page = `http://${window.location.hostname}:8280`;
33736
+ // let home_page = `http://127.0.0.1:8280`;
33736
33737
  let questUrl = `${home_page}/portal/serverDecrypt`;
33737
33738
  let queryData = {
33738
33739
  param: {
@@ -33766,13 +33767,13 @@ const viewEncrypt = async decryptStr => {
33766
33767
  /**
33767
33768
  * 服务端加密
33768
33769
  */
33769
- const serverEncrypt = async encryptStr => {
33770
- // let home_page = `http://${window.location.hostname}:8280`;
33771
- let home_page = `http://127.0.0.1:8280`;
33772
- let questUrl = `${home_page}/portal/serverEncrypt`;
33770
+ const serverEncrypt = async smsCode => {
33771
+ let home_page = `http://${window.location.hostname}:8280`;
33772
+ // let home_page = `http://127.0.0.1:8280`;
33773
+ let questUrl = `${home_page}/sms/validateSMSCode`;
33773
33774
  let queryData = {
33774
33775
  param: {
33775
- encryptStr: encryptStr
33776
+ smsCode: smsCode
33776
33777
  }
33777
33778
  };
33778
33779
  //保存的正则2级密码
@@ -33852,6 +33853,7 @@ const loginAccount = async (data, appid) => {
33852
33853
  let key_code = resultData.data.key_code;
33853
33854
  let old_code = resultData.data.old_code;
33854
33855
  let login_account_id = resultData.data.id;
33856
+ let message = resultData.data.message;
33855
33857
  //登录平台成功
33856
33858
  if (code == 10110004) {
33857
33859
  key_code = await viewDecrypt(key_code);
@@ -33860,6 +33862,7 @@ const loginAccount = async (data, appid) => {
33860
33862
  resultData = await request.post(`/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`, queryData.param);
33861
33863
  let response = JSON.parse(resultData.request.response);
33862
33864
  code = response.code;
33865
+ message = response.message;
33863
33866
  if (code == 10110004) {
33864
33867
  let id = login_account_id;
33865
33868
  // 初始化解析器
@@ -33874,13 +33877,19 @@ const loginAccount = async (data, appid) => {
33874
33877
  window.sessionStorage.setItem("iportal_client_id", clientID);
33875
33878
  window.sessionStorage.setItem("iportal_app_id", appid);
33876
33879
  return {
33877
- code: code
33880
+ code: code,
33881
+ message: i18nText(message)
33882
+ };
33883
+ } else {
33884
+ return {
33885
+ code: code,
33886
+ message: i18nText(message)
33878
33887
  };
33879
33888
  }
33880
33889
  } else {
33881
33890
  return {
33882
33891
  code: code,
33883
- message: i18nText(response.message)
33892
+ message: i18nText(message)
33884
33893
  };
33885
33894
  }
33886
33895
  };
@@ -34618,12 +34627,9 @@ const dify_extractFilenameFromUrl = url => {
34618
34627
  };
34619
34628
  ;// ./src/api/sms.js
34620
34629
 
34621
- const sendSms = async (smsServerIP, queryData, successCallback, errorCallback) => {
34622
- if (!smsServerIP) {
34623
- console.error("没有配置短信服务地址,请联系管理员");
34624
- if (errorCallback) errorCallback("没有配置短信服务地址,请联系管理员");
34625
- return;
34626
- }
34630
+ const sendSms = async (queryData, successCallback, errorCallback) => {
34631
+ let smsServerIP = `http://${window.location.hostname}:8280/sms/sendSms`;
34632
+ // let smsServerIP = `http://127.0.0.1:8280/sms/sendSms`;
34627
34633
  let options = {
34628
34634
  param: queryData
34629
34635
  };
@@ -34635,6 +34641,34 @@ const sendSms = async (smsServerIP, queryData, successCallback, errorCallback) =
34635
34641
  if (errorCallback) errorCallback(error);
34636
34642
  });
34637
34643
  };
34644
+
34645
+ /**
34646
+ * 登录账号
34647
+ * @param data 登录数据
34648
+ * @param appid 应用ID
34649
+ *
34650
+ * @description
34651
+ * 登录时需要传入验证码(authPicCode)和应用ID(dataappId),
34652
+ * mobileOrWeb参数用于区分是移动端还是网页端登录。
34653
+ *
34654
+ * @returns
34655
+ */
34656
+ const isSMSCodeValidate = async (smsCode, sms_service_name_type, beyond_type_id, account_id) => {
34657
+ let questUrl = `http://${window.location.hostname}:8280/sms/validateSMSCode`;
34658
+ // let questUrl = `http://127.0.0.1:8280/sms/validateSMSCode`;
34659
+ let queryData = {
34660
+ param: {
34661
+ smsCode: smsCode,
34662
+ sms_service_name_type: sms_service_name_type,
34663
+ beyond_type_id: beyond_type_id,
34664
+ account_id: account_id
34665
+ }
34666
+ };
34667
+ //保存的正则2级密码
34668
+ let resultData = await request.post(questUrl, JSON.stringify(queryData));
34669
+ let data = resultData.data;
34670
+ return data;
34671
+ };
34638
34672
  ;// ./src/main.js
34639
34673
 
34640
34674