isdata-customer-sdk 0.1.48 → 0.1.50
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.js +236 -5
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +236 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +4 -4
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -20880,6 +20880,46 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
20880
20880
|
module.exports = InterceptorManager;
|
|
20881
20881
|
|
|
20882
20882
|
|
|
20883
|
+
/***/ }),
|
|
20884
|
+
|
|
20885
|
+
/***/ 3579:
|
|
20886
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
20887
|
+
|
|
20888
|
+
"use strict";
|
|
20889
|
+
|
|
20890
|
+
var $ = __webpack_require__(6518);
|
|
20891
|
+
var call = __webpack_require__(9565);
|
|
20892
|
+
var iterate = __webpack_require__(2652);
|
|
20893
|
+
var aCallable = __webpack_require__(9306);
|
|
20894
|
+
var anObject = __webpack_require__(8551);
|
|
20895
|
+
var getIteratorDirect = __webpack_require__(1767);
|
|
20896
|
+
var iteratorClose = __webpack_require__(9539);
|
|
20897
|
+
var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(4549);
|
|
20898
|
+
|
|
20899
|
+
var someWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('some', TypeError);
|
|
20900
|
+
|
|
20901
|
+
// `Iterator.prototype.some` method
|
|
20902
|
+
// https://tc39.es/ecma262/#sec-iterator.prototype.some
|
|
20903
|
+
$({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEarlyError }, {
|
|
20904
|
+
some: function some(predicate) {
|
|
20905
|
+
anObject(this);
|
|
20906
|
+
try {
|
|
20907
|
+
aCallable(predicate);
|
|
20908
|
+
} catch (error) {
|
|
20909
|
+
iteratorClose(this, 'throw', error);
|
|
20910
|
+
}
|
|
20911
|
+
|
|
20912
|
+
if (someWithoutClosingOnEarlyError) return call(someWithoutClosingOnEarlyError, this, predicate);
|
|
20913
|
+
|
|
20914
|
+
var record = getIteratorDirect(this);
|
|
20915
|
+
var counter = 0;
|
|
20916
|
+
return iterate(record, function (value, stop) {
|
|
20917
|
+
if (predicate(value, counter++)) return stop();
|
|
20918
|
+
}, { IS_RECORD: true, INTERRUPTED: true }).stopped;
|
|
20919
|
+
}
|
|
20920
|
+
});
|
|
20921
|
+
|
|
20922
|
+
|
|
20883
20923
|
/***/ }),
|
|
20884
20924
|
|
|
20885
20925
|
/***/ 3706:
|
|
@@ -29521,13 +29561,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29521
29561
|
|
|
29522
29562
|
// EXPORTS
|
|
29523
29563
|
__webpack_require__.d(__webpack_exports__, {
|
|
29564
|
+
addEventAction: function() { return /* reexport */ addEventAction; },
|
|
29565
|
+
addIMMapping: function() { return /* reexport */ addIMMapping; },
|
|
29524
29566
|
addObjectUsedTimes: function() { return /* reexport */ addObjectUsedTimes; },
|
|
29567
|
+
addWindowTrustedOrigin: function() { return /* reexport */ addWindowTrustedOrigin; },
|
|
29525
29568
|
decrypt: function() { return /* reexport */ decrypt; },
|
|
29526
29569
|
destroyEventCenter: function() { return /* reexport */ destroyEventCenter; },
|
|
29527
29570
|
fireEvent: function() { return /* reexport */ fireEvent; },
|
|
29528
29571
|
getAPPInfosByID: function() { return /* reexport */ getAPPInfosByID; },
|
|
29572
|
+
getAllUserInfosByGroupID: function() { return /* reexport */ getAllUserInfosByGroupID; },
|
|
29529
29573
|
getAppPortalMenuDatas: function() { return /* reexport */ getAppPortalMenuDatas; },
|
|
29530
29574
|
getAuthPic: function() { return /* reexport */ getAuthPic; },
|
|
29575
|
+
getChildrenOfficeInfosByID: function() { return /* reexport */ getChildrenOfficeInfosByID; },
|
|
29531
29576
|
getCurrentUserPortalPageID: function() { return /* reexport */ getCurrentUserPortalPageID; },
|
|
29532
29577
|
getGroupMappingsByAccount: function() { return /* reexport */ getGroupMappingsByAccount; },
|
|
29533
29578
|
getKey: function() { return /* reexport */ getKey; },
|
|
@@ -29538,16 +29583,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29538
29583
|
getObjectUseTimes: function() { return /* reexport */ getObjectUseTimes; },
|
|
29539
29584
|
getOfficeInfosByIDs: function() { return /* reexport */ getOfficeInfosByIDs; },
|
|
29540
29585
|
getPageIDByComponentID: function() { return /* reexport */ getPageIDByComponentID; },
|
|
29586
|
+
getPojectDptsByUserAndGroupID: function() { return /* reexport */ getPojectDptsByUserAndGroupID; },
|
|
29541
29587
|
getPoratlAppID: function() { return /* reexport */ getPoratlAppID; },
|
|
29542
29588
|
getPortalAccessToken: function() { return /* reexport */ getPortalAccessToken; },
|
|
29543
29589
|
getPortalPageConfig: function() { return /* reexport */ getPortalPageConfig; },
|
|
29544
29590
|
getPortalPageMenuID: function() { return /* reexport */ getPortalPageMenuID; },
|
|
29591
|
+
getPortalUserInfo: function() { return /* reexport */ getPortalUserInfo; },
|
|
29545
29592
|
getPortalUserMappingInfos: function() { return /* reexport */ getPortalUserMappingInfos; },
|
|
29593
|
+
getPortalUserSig: function() { return /* reexport */ getPortalUserSig; },
|
|
29546
29594
|
getRoleIDsByUserAndGroupID: function() { return /* reexport */ getRoleIDsByUserAndGroupID; },
|
|
29547
29595
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
29548
29596
|
getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
|
|
29549
29597
|
hasListener: function() { return /* reexport */ hasListener; },
|
|
29550
29598
|
initEventCenter: function() { return /* reexport */ initEventCenter; },
|
|
29599
|
+
initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
|
|
29551
29600
|
loginAccount: function() { return /* reexport */ loginAccount; },
|
|
29552
29601
|
logoutAccount: function() { return /* reexport */ logoutAccount; },
|
|
29553
29602
|
queryAppVariable: function() { return /* reexport */ queryAppVariable; },
|
|
@@ -29556,7 +29605,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29556
29605
|
queryGroupInfosByOfficeId: function() { return /* reexport */ queryGroupInfosByOfficeId; },
|
|
29557
29606
|
queryOfficeInfosById: function() { return /* reexport */ queryOfficeInfosById; },
|
|
29558
29607
|
registerEventListener: function() { return /* reexport */ registerEventListener; },
|
|
29608
|
+
removeEventAction: function() { return /* reexport */ removeEventAction; },
|
|
29559
29609
|
removeEventListener: function() { return /* reexport */ removeEventListener; },
|
|
29610
|
+
removeWindowTrustedOrigin: function() { return /* reexport */ removeWindowTrustedOrigin; },
|
|
29611
|
+
sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
|
|
29560
29612
|
setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
|
|
29561
29613
|
switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
|
|
29562
29614
|
updateUserSelectPortal: function() { return /* reexport */ updateUserSelectPortal; },
|
|
@@ -29724,11 +29776,7 @@ let prefixPath = window.prefixPath || "";
|
|
|
29724
29776
|
|
|
29725
29777
|
|
|
29726
29778
|
|
|
29727
|
-
|
|
29728
|
-
let result = await request.get(`/sdata/rest/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
29729
|
-
console.log("getPortalAccessToken", result);
|
|
29730
|
-
return result;
|
|
29731
|
-
};
|
|
29779
|
+
|
|
29732
29780
|
/**
|
|
29733
29781
|
* 获取门户应用ID
|
|
29734
29782
|
* @param {*} isPortalAction 是否是门户操作
|
|
@@ -30142,6 +30190,11 @@ const getMappingAppInfoByID = async (appID, groupID) => {
|
|
|
30142
30190
|
let appInfo = resultData.data.appInfo;
|
|
30143
30191
|
return appInfo;
|
|
30144
30192
|
};
|
|
30193
|
+
|
|
30194
|
+
/**
|
|
30195
|
+
*
|
|
30196
|
+
* @returns 获取门户登录页面的公告信息
|
|
30197
|
+
*/
|
|
30145
30198
|
const getLoginPageNotices = async () => {
|
|
30146
30199
|
let queryData = {
|
|
30147
30200
|
"param": {
|
|
@@ -30152,6 +30205,69 @@ const getLoginPageNotices = async () => {
|
|
|
30152
30205
|
let noticeInfos = resultData.data.resultDatas;
|
|
30153
30206
|
return noticeInfos;
|
|
30154
30207
|
};
|
|
30208
|
+
|
|
30209
|
+
/**
|
|
30210
|
+
* 获取门户单点登录接入Token
|
|
30211
|
+
* @param {*} appKey
|
|
30212
|
+
* @param {*} appSecret
|
|
30213
|
+
* @returns
|
|
30214
|
+
*/
|
|
30215
|
+
const getPortalAccessToken = async (appKey, appSecret) => {
|
|
30216
|
+
let result = await request.get(`/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
30217
|
+
let token = result.data;
|
|
30218
|
+
return token;
|
|
30219
|
+
};
|
|
30220
|
+
|
|
30221
|
+
/**
|
|
30222
|
+
* 通过code和接入Token获取用户身份信息
|
|
30223
|
+
* @param {*} code
|
|
30224
|
+
* @param {*} access_token
|
|
30225
|
+
* @returns
|
|
30226
|
+
*/
|
|
30227
|
+
const getPortalUserInfo = async (code, access_token) => {
|
|
30228
|
+
let result = await request.get(`/systhirdapp/user/getUserByCode?code=${code}&access_token=${access_token}`);
|
|
30229
|
+
let data = result.data;
|
|
30230
|
+
return data;
|
|
30231
|
+
};
|
|
30232
|
+
|
|
30233
|
+
/**
|
|
30234
|
+
* 通过用户ID,平台类型,租户ID获取用户IM的签名ID
|
|
30235
|
+
* @param {*} userID
|
|
30236
|
+
* @param {*} platType
|
|
30237
|
+
* @param {*} groupID
|
|
30238
|
+
* @returns
|
|
30239
|
+
*/
|
|
30240
|
+
const getPortalUserSig = async (userID, platType, groupID) => {
|
|
30241
|
+
let queryData = {
|
|
30242
|
+
param: {
|
|
30243
|
+
userID: userID,
|
|
30244
|
+
im_type: platType,
|
|
30245
|
+
group_id: groupID
|
|
30246
|
+
}
|
|
30247
|
+
};
|
|
30248
|
+
let result = await request.post(`/dataservice/rest/orchestration/getIMUserSigByID`, queryData);
|
|
30249
|
+
let sigID = result.data.userSig;
|
|
30250
|
+
return sigID;
|
|
30251
|
+
};
|
|
30252
|
+
|
|
30253
|
+
/**
|
|
30254
|
+
* 添加IM签名ID映射关系
|
|
30255
|
+
*/
|
|
30256
|
+
const addIMMapping = async (userID, platType, groupID, sigID) => {
|
|
30257
|
+
let queryData = {
|
|
30258
|
+
param: {
|
|
30259
|
+
data: {
|
|
30260
|
+
userID: userID,
|
|
30261
|
+
im_type: platType,
|
|
30262
|
+
group_id: groupID,
|
|
30263
|
+
userSig: sigID
|
|
30264
|
+
}
|
|
30265
|
+
}
|
|
30266
|
+
};
|
|
30267
|
+
let result = await request.post(`/dataservice/rest/orchestration/addIMMapping`, queryData);
|
|
30268
|
+
let resultData = result.data;
|
|
30269
|
+
return resultData;
|
|
30270
|
+
};
|
|
30155
30271
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
30156
30272
|
var crypto_js = __webpack_require__(1396);
|
|
30157
30273
|
var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
|
|
@@ -30491,11 +30607,126 @@ const getAPPInfosByID = async id => {
|
|
|
30491
30607
|
let groupDptData = resultData.data.appInfo;
|
|
30492
30608
|
return groupDptData;
|
|
30493
30609
|
};
|
|
30610
|
+
const getAllUserInfosByGroupID = async groupID => {
|
|
30611
|
+
let requestData = {
|
|
30612
|
+
param: {
|
|
30613
|
+
groupID: groupID
|
|
30614
|
+
}
|
|
30615
|
+
};
|
|
30616
|
+
let result = await request.post(`/dataservice/rest/orchestration/getAllUserInfosByGroupID`, requestData);
|
|
30617
|
+
let data = result.data.resultDatas;
|
|
30618
|
+
return data;
|
|
30619
|
+
};
|
|
30620
|
+
const getChildrenOfficeInfosByID = async officeID => {
|
|
30621
|
+
let requestData = {
|
|
30622
|
+
param: {
|
|
30623
|
+
officeID: officeID
|
|
30624
|
+
}
|
|
30625
|
+
};
|
|
30626
|
+
let result = await request.post(`/dataservice/rest/orchestration/getChildrenOfficeInfosByID`, requestData);
|
|
30627
|
+
let data = result.data.resultDatas;
|
|
30628
|
+
return data;
|
|
30629
|
+
};
|
|
30630
|
+
const getPojectDptsByUserAndGroupID = async (userID, groupID) => {
|
|
30631
|
+
let requestData = {
|
|
30632
|
+
param: {
|
|
30633
|
+
userID: userID,
|
|
30634
|
+
groupID: groupID
|
|
30635
|
+
}
|
|
30636
|
+
};
|
|
30637
|
+
let result = await request.post(`/dataservice/rest/orchestration/getPojectDptsByUserAndGroupID`, requestData);
|
|
30638
|
+
let data = {
|
|
30639
|
+
dptDatas: result.data.officeDatas,
|
|
30640
|
+
userMappings: result.data.userMappings
|
|
30641
|
+
};
|
|
30642
|
+
return data;
|
|
30643
|
+
};
|
|
30644
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
30645
|
+
var es_iterator_some = __webpack_require__(3579);
|
|
30646
|
+
;// ./src/api/iframe.js
|
|
30647
|
+
|
|
30648
|
+
|
|
30649
|
+
|
|
30650
|
+
const addWindowTrustedOrigin = origin => {
|
|
30651
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30652
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30653
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS.includes(origin)) {
|
|
30654
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.push(origin);
|
|
30655
|
+
}
|
|
30656
|
+
};
|
|
30657
|
+
const removeWindowTrustedOrigin = origin => {
|
|
30658
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30659
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30660
|
+
let index = SDATA_WINDOW_TRUSTED_ORIGINS.indexOf(origin); // 查找元素在数组中的索引
|
|
30661
|
+
if (index > -1) {
|
|
30662
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.splice(index, 1); // 删除元素
|
|
30663
|
+
}
|
|
30664
|
+
};
|
|
30665
|
+
const addEventAction = (eventKey, eventAction) => {
|
|
30666
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30667
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30668
|
+
window.sdataEventActions[eventKey] = eventAction;
|
|
30669
|
+
};
|
|
30670
|
+
const removeEventAction = eventKey => {
|
|
30671
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30672
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30673
|
+
delete window.sdataEventActions[eventKey];
|
|
30674
|
+
};
|
|
30675
|
+
const initFrameWindowListener = () => {
|
|
30676
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30677
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30678
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30679
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30680
|
+
// 监听主页面的消息
|
|
30681
|
+
window.addEventListener("message", async event => {
|
|
30682
|
+
// 步骤1:验证来源是否在白名单中
|
|
30683
|
+
const isTrusted = window.SDATA_WINDOW_TRUSTED_ORIGINS.some(origin => event.origin === origin || new RegExp(origin).test(event.origin));
|
|
30684
|
+
if (!isTrusted) {
|
|
30685
|
+
console.log("拒绝非可信源消息:", event.origin);
|
|
30686
|
+
return; // 直接终止处理
|
|
30687
|
+
}
|
|
30688
|
+
let eventKey = event.data?.eventKey;
|
|
30689
|
+
if (!eventKey) return;
|
|
30690
|
+
let eventSourceKey = event.origin;
|
|
30691
|
+
console.log(`收到${eventSourceKey}页面消息:`, event.data);
|
|
30692
|
+
if (eventKey === "sdata_alllife_event_response") {
|
|
30693
|
+
let eventOperateKey = event.data.eventOperateKey;
|
|
30694
|
+
let eventAction = window.sdataEventActions[eventOperateKey];
|
|
30695
|
+
//删除缓存方法
|
|
30696
|
+
delete window.sdataEventActions[eventOperateKey];
|
|
30697
|
+
if (eventAction) await eventAction(event.data.data);
|
|
30698
|
+
} else {
|
|
30699
|
+
let eventAction = window.sdataEventActions[eventKey];
|
|
30700
|
+
let responseData = {
|
|
30701
|
+
eventKey: "sdata_alllife_event_response",
|
|
30702
|
+
eventOperateKey: event.data.eventOperateKey,
|
|
30703
|
+
data: {}
|
|
30704
|
+
};
|
|
30705
|
+
if (eventAction) {
|
|
30706
|
+
let resultData = await eventAction(event.data.data);
|
|
30707
|
+
responseData.data = resultData;
|
|
30708
|
+
}
|
|
30709
|
+
event.source.postMessage(responseData, eventSourceKey);
|
|
30710
|
+
}
|
|
30711
|
+
});
|
|
30712
|
+
};
|
|
30713
|
+
const sendWindowMessage = async (targetWindow, originKey, eventKey, data, callback) => {
|
|
30714
|
+
let timestamp = new Date().getTime();
|
|
30715
|
+
let eventOperateKey = `${originKey}_${timestamp}`;
|
|
30716
|
+
addEventAction(eventOperateKey, callback);
|
|
30717
|
+
let postData = {
|
|
30718
|
+
eventOperateKey: eventOperateKey,
|
|
30719
|
+
eventKey: eventKey,
|
|
30720
|
+
data: data
|
|
30721
|
+
};
|
|
30722
|
+
targetWindow.postMessage(postData, originKey);
|
|
30723
|
+
};
|
|
30494
30724
|
;// ./src/main.js
|
|
30495
30725
|
|
|
30496
30726
|
|
|
30497
30727
|
|
|
30498
30728
|
|
|
30729
|
+
|
|
30499
30730
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
|
|
30500
30731
|
|
|
30501
30732
|
|