isdata-customer-sdk 0.1.83 → 0.1.85

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
@@ -29578,6 +29578,7 @@ __webpack_require__.d(__webpack_exports__, {
29578
29578
  getAppPortalMenuDatas: function() { return /* reexport */ getAppPortalMenuDatas; },
29579
29579
  getAuthPic: function() { return /* reexport */ getAuthPic; },
29580
29580
  getChildrenOfficeInfosByID: function() { return /* reexport */ getChildrenOfficeInfosByID; },
29581
+ getCurrentAppID: function() { return /* reexport */ getCurrentAppID; },
29581
29582
  getCurrentUserPortalPageID: function() { return /* reexport */ getCurrentUserPortalPageID; },
29582
29583
  getDifyFileType: function() { return /* reexport */ getDifyFileType; },
29583
29584
  getFileSize: function() { return /* reexport */ getFileSize; },
@@ -29810,28 +29811,17 @@ let prefixPath = window.prefixPath || "";
29810
29811
  * @param {*} isPortalAction
29811
29812
  * @returns
29812
29813
  */
29813
- const getPoratlAppID = (isPortalAction, appVariables) => {
29814
- let portal_app_id = "";
29815
- if (isPortalAction) {
29816
- portal_app_id = window.appSdk.getAppId();
29817
- } else {
29818
- portal_app_id = window.sessionStorage.getItem("iportal_app_id");
29819
- // 如果缓存中没有iportal_app_id,则从appVariables中获取
29820
- if (!portal_app_id) {
29821
- appVariables.forEach(item => {
29822
- if (item.name == "iPortal_app_id") {
29823
- portal_app_id = item.default_value;
29824
- }
29825
- });
29826
- }
29827
- // 如果appVariables中也没有,则从window.appSdk.getAppId()获取
29828
- // 这通常是因为在非门户应用中使用了门户相关的功能
29829
- if (!portal_app_id) {
29830
- portal_app_id = window.appSdk.getAppId();
29831
- }
29814
+ const getPoratlAppID = () => {
29815
+ let portal_app_id = window.sessionStorage.getItem("iportal_app_id");
29816
+ if (!portal_app_id) {
29817
+ portal_app_id = getCurrentAppID();
29832
29818
  }
29833
29819
  return portal_app_id;
29834
29820
  };
29821
+ const getCurrentAppID = () => {
29822
+ let app_id = window.appSdk.getAppId() || window.localStorage.MobileAppId;
29823
+ return app_id;
29824
+ };
29835
29825
 
29836
29826
  /**
29837
29827
  * 取门户应用菜单数据
@@ -29841,7 +29831,7 @@ const getPoratlAppID = (isPortalAction, appVariables) => {
29841
29831
  * @returns
29842
29832
  */
29843
29833
  const getAppPortalMenuDatas = async (user_id, group_id, isPortalAction, appVariables) => {
29844
- let portal_app_id = getPoratlAppID(isPortalAction, appVariables);
29834
+ let portal_app_id = getPoratlAppID();
29845
29835
  let roleList = await getRoleIDsByUserAndGroupID(user_id, portal_app_id, group_id);
29846
29836
  let portalMenuDatas = await getMenuDatasByGroupID(group_id, roleList);
29847
29837
  let app_id = window.appSdk.getAppId();
@@ -32333,6 +32323,7 @@ const loginAccount = async (data, appid) => {
32333
32323
  window.sessionStorage.setItem("iportal_group_id", data.groupid);
32334
32324
  window.sessionStorage.setItem("iportal_login_user_key", old_key);
32335
32325
  window.sessionStorage.setItem("iportal_client_id", clientID);
32326
+ window.sessionStorage.setItem("iportal_app_id", appid);
32336
32327
  return {
32337
32328
  code: code
32338
32329
  };
@@ -32964,7 +32955,7 @@ const getIMHanlder = customerHanlder => {
32964
32955
 
32965
32956
 
32966
32957
  const sendPostToAIAgent = async (queryData, successCallback, errorCallback) => {
32967
- let appid = getPoratlAppID(false, []);
32958
+ let appid = getPoratlAppID();
32968
32959
  let appCustomData = await getAppCustomData(appid);
32969
32960
  let aiAgentServerIP = appCustomData?.aiAgentServerIP || "";
32970
32961
  if (!aiAgentServerIP) {
@@ -33019,10 +33010,10 @@ const getDifyFileType = fileType => {
33019
33010
  return typeOptions[key] || "custom";
33020
33011
  };
33021
33012
 
33022
- /**
33023
- * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
33024
- * @param {string} url - 文件 URL
33025
- * @returns {string} - 提取的文件名
33013
+ /**
33014
+ * 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
33015
+ * @param {string} url - 文件 URL
33016
+ * @returns {string} - 提取的文件名
33026
33017
  */
33027
33018
  const dify_extractFilenameFromUrl = url => {
33028
33019
  try {