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.
- package/dist/index.common.js +11 -29
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +11 -29
- 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.umd.js
CHANGED
|
@@ -29810,25 +29810,10 @@ let prefixPath = window.prefixPath || "";
|
|
|
29810
29810
|
* @param {*} isPortalAction
|
|
29811
29811
|
* @returns
|
|
29812
29812
|
*/
|
|
29813
|
-
const getPoratlAppID = (
|
|
29814
|
-
let portal_app_id = "";
|
|
29815
|
-
if (
|
|
29813
|
+
const getPoratlAppID = () => {
|
|
29814
|
+
let portal_app_id = window.sessionStorage.getItem("iportal_app_id");
|
|
29815
|
+
if (!portal_app_id) {
|
|
29816
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
|
-
}
|
|
29832
29817
|
}
|
|
29833
29818
|
return portal_app_id;
|
|
29834
29819
|
};
|
|
@@ -29841,7 +29826,7 @@ const getPoratlAppID = (isPortalAction, appVariables) => {
|
|
|
29841
29826
|
* @returns
|
|
29842
29827
|
*/
|
|
29843
29828
|
const getAppPortalMenuDatas = async (user_id, group_id, isPortalAction, appVariables) => {
|
|
29844
|
-
let portal_app_id = getPoratlAppID(
|
|
29829
|
+
let portal_app_id = getPoratlAppID();
|
|
29845
29830
|
let roleList = await getRoleIDsByUserAndGroupID(user_id, portal_app_id, group_id);
|
|
29846
29831
|
let portalMenuDatas = await getMenuDatasByGroupID(group_id, roleList);
|
|
29847
29832
|
let app_id = window.appSdk.getAppId();
|
|
@@ -32317,11 +32302,7 @@ const loginAccount = async (data, appid) => {
|
|
|
32317
32302
|
if (key_code == data.password) {
|
|
32318
32303
|
pwd_code = window.appSdk.Encrypt(pwd_code);
|
|
32319
32304
|
data.password = pwd_code;
|
|
32320
|
-
|
|
32321
|
-
// `/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`,
|
|
32322
|
-
// data
|
|
32323
|
-
// );
|
|
32324
|
-
result = await request.post(`/system/authority/loginAccount4Application?dataappId=${appid}&mobileOrWeb=web`, data);
|
|
32305
|
+
result = await request.post(`/system/authority/loginAccount4Application?authPicCode=${data.imageCode}&dataappId=${appid}&mobileOrWeb=web`, data);
|
|
32325
32306
|
response = JSON.parse(result.request.response);
|
|
32326
32307
|
code = response.code;
|
|
32327
32308
|
//登录平台成功
|
|
@@ -32337,6 +32318,7 @@ const loginAccount = async (data, appid) => {
|
|
|
32337
32318
|
window.sessionStorage.setItem("iportal_group_id", data.groupid);
|
|
32338
32319
|
window.sessionStorage.setItem("iportal_login_user_key", old_key);
|
|
32339
32320
|
window.sessionStorage.setItem("iportal_client_id", clientID);
|
|
32321
|
+
window.sessionStorage.setItem("iportal_app_id", appid);
|
|
32340
32322
|
return {
|
|
32341
32323
|
code: code
|
|
32342
32324
|
};
|
|
@@ -32968,7 +32950,7 @@ const getIMHanlder = customerHanlder => {
|
|
|
32968
32950
|
|
|
32969
32951
|
|
|
32970
32952
|
const sendPostToAIAgent = async (queryData, successCallback, errorCallback) => {
|
|
32971
|
-
let appid = getPoratlAppID(
|
|
32953
|
+
let appid = getPoratlAppID();
|
|
32972
32954
|
let appCustomData = await getAppCustomData(appid);
|
|
32973
32955
|
let aiAgentServerIP = appCustomData?.aiAgentServerIP || "";
|
|
32974
32956
|
if (!aiAgentServerIP) {
|
|
@@ -33023,10 +33005,10 @@ const getDifyFileType = fileType => {
|
|
|
33023
33005
|
return typeOptions[key] || "custom";
|
|
33024
33006
|
};
|
|
33025
33007
|
|
|
33026
|
-
/**
|
|
33027
|
-
* 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
|
|
33028
|
-
* @param {string} url - 文件 URL
|
|
33029
|
-
* @returns {string} - 提取的文件名
|
|
33008
|
+
/**
|
|
33009
|
+
* 从 URL 中提取文件名(如 https://example.com/path/image.png → image.png)
|
|
33010
|
+
* @param {string} url - 文件 URL
|
|
33011
|
+
* @returns {string} - 提取的文件名
|
|
33030
33012
|
*/
|
|
33031
33013
|
const dify_extractFilenameFromUrl = url => {
|
|
33032
33014
|
try {
|