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.common.js +16 -25
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +16 -25
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -29568,6 +29568,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29568
29568
|
getAppPortalMenuDatas: function() { return /* reexport */ getAppPortalMenuDatas; },
|
|
29569
29569
|
getAuthPic: function() { return /* reexport */ getAuthPic; },
|
|
29570
29570
|
getChildrenOfficeInfosByID: function() { return /* reexport */ getChildrenOfficeInfosByID; },
|
|
29571
|
+
getCurrentAppID: function() { return /* reexport */ getCurrentAppID; },
|
|
29571
29572
|
getCurrentUserPortalPageID: function() { return /* reexport */ getCurrentUserPortalPageID; },
|
|
29572
29573
|
getDifyFileType: function() { return /* reexport */ getDifyFileType; },
|
|
29573
29574
|
getFileSize: function() { return /* reexport */ getFileSize; },
|
|
@@ -29800,28 +29801,17 @@ let prefixPath = window.prefixPath || "";
|
|
|
29800
29801
|
* @param {*} isPortalAction
|
|
29801
29802
|
* @returns
|
|
29802
29803
|
*/
|
|
29803
|
-
const getPoratlAppID = (
|
|
29804
|
-
let portal_app_id = "";
|
|
29805
|
-
if (
|
|
29806
|
-
portal_app_id =
|
|
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
|
-
}
|
|
29804
|
+
const getPoratlAppID = () => {
|
|
29805
|
+
let portal_app_id = window.sessionStorage.getItem("iportal_app_id");
|
|
29806
|
+
if (!portal_app_id) {
|
|
29807
|
+
portal_app_id = getCurrentAppID();
|
|
29822
29808
|
}
|
|
29823
29809
|
return portal_app_id;
|
|
29824
29810
|
};
|
|
29811
|
+
const getCurrentAppID = () => {
|
|
29812
|
+
let app_id = window.appSdk.getAppId() || window.localStorage.MobileAppId;
|
|
29813
|
+
return app_id;
|
|
29814
|
+
};
|
|
29825
29815
|
|
|
29826
29816
|
/**
|
|
29827
29817
|
* 取门户应用菜单数据
|
|
@@ -29831,7 +29821,7 @@ const getPoratlAppID = (isPortalAction, appVariables) => {
|
|
|
29831
29821
|
* @returns
|
|
29832
29822
|
*/
|
|
29833
29823
|
const getAppPortalMenuDatas = async (user_id, group_id, isPortalAction, appVariables) => {
|
|
29834
|
-
let portal_app_id = getPoratlAppID(
|
|
29824
|
+
let portal_app_id = getPoratlAppID();
|
|
29835
29825
|
let roleList = await getRoleIDsByUserAndGroupID(user_id, portal_app_id, group_id);
|
|
29836
29826
|
let portalMenuDatas = await getMenuDatasByGroupID(group_id, roleList);
|
|
29837
29827
|
let app_id = window.appSdk.getAppId();
|
|
@@ -32323,6 +32313,7 @@ const loginAccount = async (data, appid) => {
|
|
|
32323
32313
|
window.sessionStorage.setItem("iportal_group_id", data.groupid);
|
|
32324
32314
|
window.sessionStorage.setItem("iportal_login_user_key", old_key);
|
|
32325
32315
|
window.sessionStorage.setItem("iportal_client_id", clientID);
|
|
32316
|
+
window.sessionStorage.setItem("iportal_app_id", appid);
|
|
32326
32317
|
return {
|
|
32327
32318
|
code: code
|
|
32328
32319
|
};
|
|
@@ -32954,7 +32945,7 @@ const getIMHanlder = customerHanlder => {
|
|
|
32954
32945
|
|
|
32955
32946
|
|
|
32956
32947
|
const sendPostToAIAgent = async (queryData, successCallback, errorCallback) => {
|
|
32957
|
-
let appid = getPoratlAppID(
|
|
32948
|
+
let appid = getPoratlAppID();
|
|
32958
32949
|
let appCustomData = await getAppCustomData(appid);
|
|
32959
32950
|
let aiAgentServerIP = appCustomData?.aiAgentServerIP || "";
|
|
32960
32951
|
if (!aiAgentServerIP) {
|
|
@@ -33009,10 +33000,10 @@ const getDifyFileType = fileType => {
|
|
|
33009
33000
|
return typeOptions[key] || "custom";
|
|
33010
33001
|
};
|
|
33011
33002
|
|
|
33012
|
-
/**
|
|
33013
|
-
* 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
|
|
33014
|
-
* @param {string} url - 文件 URL
|
|
33015
|
-
* @returns {string} - 提取的文件名
|
|
33003
|
+
/**
|
|
33004
|
+
* 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
|
|
33005
|
+
* @param {string} url - 文件 URL
|
|
33006
|
+
* @returns {string} - 提取的文件名
|
|
33016
33007
|
*/
|
|
33017
33008
|
const dify_extractFilenameFromUrl = url => {
|
|
33018
33009
|
try {
|