isdata-customer-sdk 0.1.82 → 0.1.84

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.
@@ -29800,25 +29800,10 @@ let prefixPath = window.prefixPath || "";
29800
29800
  * @param {*} isPortalAction
29801
29801
  * @returns
29802
29802
  */
29803
- const getPoratlAppID = (isPortalAction, appVariables) => {
29804
- let portal_app_id = "";
29805
- if (isPortalAction) {
29803
+ const getPoratlAppID = () => {
29804
+ let portal_app_id = window.sessionStorage.getItem("iportal_app_id");
29805
+ if (!portal_app_id) {
29806
29806
  portal_app_id = window.appSdk.getAppId();
29807
- } else {
29808
- portal_app_id = window.sessionStorage.getItem("iportal_app_id");
29809
- // 如果缓存中没有iportal_app_id,则从appVariables中获取
29810
- if (!portal_app_id) {
29811
- appVariables.forEach(item => {
29812
- if (item.name == "iPortal_app_id") {
29813
- portal_app_id = item.default_value;
29814
- }
29815
- });
29816
- }
29817
- // 如果appVariables中也没有,则从window.appSdk.getAppId()获取
29818
- // 这通常是因为在非门户应用中使用了门户相关的功能
29819
- if (!portal_app_id) {
29820
- portal_app_id = window.appSdk.getAppId();
29821
- }
29822
29807
  }
29823
29808
  return portal_app_id;
29824
29809
  };
@@ -29831,7 +29816,7 @@ const getPoratlAppID = (isPortalAction, appVariables) => {
29831
29816
  * @returns
29832
29817
  */
29833
29818
  const getAppPortalMenuDatas = async (user_id, group_id, isPortalAction, appVariables) => {
29834
- let portal_app_id = getPoratlAppID(isPortalAction, appVariables);
29819
+ let portal_app_id = getPoratlAppID();
29835
29820
  let roleList = await getRoleIDsByUserAndGroupID(user_id, portal_app_id, group_id);
29836
29821
  let portalMenuDatas = await getMenuDatasByGroupID(group_id, roleList);
29837
29822
  let app_id = window.appSdk.getAppId();
@@ -32307,11 +32292,7 @@ const loginAccount = async (data, appid) => {
32307
32292
  if (key_code == data.password) {
32308
32293
  pwd_code = window.appSdk.Encrypt(pwd_code);
32309
32294
  data.password = pwd_code;
32310
- // result = await request.post(
32311
- // `/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`,
32312
- // data
32313
- // );
32314
- result = await request.post(`/system/authority/loginAccount4Application?dataappId=${appid}&mobileOrWeb=web`, data);
32295
+ result = await request.post(`/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`, data);
32315
32296
  response = JSON.parse(result.request.response);
32316
32297
  code = response.code;
32317
32298
  //登录平台成功
@@ -32327,6 +32308,7 @@ const loginAccount = async (data, appid) => {
32327
32308
  window.sessionStorage.setItem("iportal_group_id", data.groupid);
32328
32309
  window.sessionStorage.setItem("iportal_login_user_key", old_key);
32329
32310
  window.sessionStorage.setItem("iportal_client_id", clientID);
32311
+ window.sessionStorage.setItem("iportal_app_id", appid);
32330
32312
  return {
32331
32313
  code: code
32332
32314
  };
@@ -32958,7 +32940,7 @@ const getIMHanlder = customerHanlder => {
32958
32940
 
32959
32941
 
32960
32942
  const sendPostToAIAgent = async (queryData, successCallback, errorCallback) => {
32961
- let appid = getPoratlAppID(false, []);
32943
+ let appid = getPoratlAppID();
32962
32944
  let appCustomData = await getAppCustomData(appid);
32963
32945
  let aiAgentServerIP = appCustomData?.aiAgentServerIP || "";
32964
32946
  if (!aiAgentServerIP) {
@@ -33013,10 +32995,10 @@ const getDifyFileType = fileType => {
33013
32995
  return typeOptions[key] || "custom";
33014
32996
  };
33015
32997
 
33016
- /**
33017
- * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
33018
- * @param {string} url - 文件 URL
33019
- * @returns {string} - 提取的文件名
32998
+ /**
32999
+ * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
33000
+ * @param {string} url - 文件 URL
33001
+ * @returns {string} - 提取的文件名
33020
33002
  */
33021
33003
  const dify_extractFilenameFromUrl = url => {
33022
33004
  try {