isdata-customer-sdk 0.1.83 → 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.
- package/dist/index.common.js +10 -24
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +10 -24
- 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
|
@@ -29800,25 +29800,10 @@ let prefixPath = window.prefixPath || "";
|
|
|
29800
29800
|
* @param {*} isPortalAction
|
|
29801
29801
|
* @returns
|
|
29802
29802
|
*/
|
|
29803
|
-
const getPoratlAppID = (
|
|
29804
|
-
let portal_app_id = "";
|
|
29805
|
-
if (
|
|
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(
|
|
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();
|
|
@@ -32323,6 +32308,7 @@ const loginAccount = async (data, appid) => {
|
|
|
32323
32308
|
window.sessionStorage.setItem("iportal_group_id", data.groupid);
|
|
32324
32309
|
window.sessionStorage.setItem("iportal_login_user_key", old_key);
|
|
32325
32310
|
window.sessionStorage.setItem("iportal_client_id", clientID);
|
|
32311
|
+
window.sessionStorage.setItem("iportal_app_id", appid);
|
|
32326
32312
|
return {
|
|
32327
32313
|
code: code
|
|
32328
32314
|
};
|
|
@@ -32954,7 +32940,7 @@ const getIMHanlder = customerHanlder => {
|
|
|
32954
32940
|
|
|
32955
32941
|
|
|
32956
32942
|
const sendPostToAIAgent = async (queryData, successCallback, errorCallback) => {
|
|
32957
|
-
let appid = getPoratlAppID(
|
|
32943
|
+
let appid = getPoratlAppID();
|
|
32958
32944
|
let appCustomData = await getAppCustomData(appid);
|
|
32959
32945
|
let aiAgentServerIP = appCustomData?.aiAgentServerIP || "";
|
|
32960
32946
|
if (!aiAgentServerIP) {
|
|
@@ -33009,10 +32995,10 @@ const getDifyFileType = fileType => {
|
|
|
33009
32995
|
return typeOptions[key] || "custom";
|
|
33010
32996
|
};
|
|
33011
32997
|
|
|
33012
|
-
/**
|
|
33013
|
-
* 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
|
|
33014
|
-
* @param {string} url - 文件 URL
|
|
33015
|
-
* @returns {string} - 提取的文件名
|
|
32998
|
+
/**
|
|
32999
|
+
* 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
|
|
33000
|
+
* @param {string} url - 文件 URL
|
|
33001
|
+
* @returns {string} - 提取的文件名
|
|
33016
33002
|
*/
|
|
33017
33003
|
const dify_extractFilenameFromUrl = url => {
|
|
33018
33004
|
try {
|