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.js
CHANGED
|
@@ -20870,6 +20870,46 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
20870
20870
|
module.exports = InterceptorManager;
|
|
20871
20871
|
|
|
20872
20872
|
|
|
20873
|
+
/***/ }),
|
|
20874
|
+
|
|
20875
|
+
/***/ 3579:
|
|
20876
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
20877
|
+
|
|
20878
|
+
"use strict";
|
|
20879
|
+
|
|
20880
|
+
var $ = __webpack_require__(6518);
|
|
20881
|
+
var call = __webpack_require__(9565);
|
|
20882
|
+
var iterate = __webpack_require__(2652);
|
|
20883
|
+
var aCallable = __webpack_require__(9306);
|
|
20884
|
+
var anObject = __webpack_require__(8551);
|
|
20885
|
+
var getIteratorDirect = __webpack_require__(1767);
|
|
20886
|
+
var iteratorClose = __webpack_require__(9539);
|
|
20887
|
+
var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(4549);
|
|
20888
|
+
|
|
20889
|
+
var someWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('some', TypeError);
|
|
20890
|
+
|
|
20891
|
+
// `Iterator.prototype.some` method
|
|
20892
|
+
// https://tc39.es/ecma262/#sec-iterator.prototype.some
|
|
20893
|
+
$({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEarlyError }, {
|
|
20894
|
+
some: function some(predicate) {
|
|
20895
|
+
anObject(this);
|
|
20896
|
+
try {
|
|
20897
|
+
aCallable(predicate);
|
|
20898
|
+
} catch (error) {
|
|
20899
|
+
iteratorClose(this, 'throw', error);
|
|
20900
|
+
}
|
|
20901
|
+
|
|
20902
|
+
if (someWithoutClosingOnEarlyError) return call(someWithoutClosingOnEarlyError, this, predicate);
|
|
20903
|
+
|
|
20904
|
+
var record = getIteratorDirect(this);
|
|
20905
|
+
var counter = 0;
|
|
20906
|
+
return iterate(record, function (value, stop) {
|
|
20907
|
+
if (predicate(value, counter++)) return stop();
|
|
20908
|
+
}, { IS_RECORD: true, INTERRUPTED: true }).stopped;
|
|
20909
|
+
}
|
|
20910
|
+
});
|
|
20911
|
+
|
|
20912
|
+
|
|
20873
20913
|
/***/ }),
|
|
20874
20914
|
|
|
20875
20915
|
/***/ 3706:
|
|
@@ -29511,13 +29551,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29511
29551
|
|
|
29512
29552
|
// EXPORTS
|
|
29513
29553
|
__webpack_require__.d(__webpack_exports__, {
|
|
29554
|
+
addEventAction: function() { return /* reexport */ addEventAction; },
|
|
29555
|
+
addIMMapping: function() { return /* reexport */ addIMMapping; },
|
|
29514
29556
|
addObjectUsedTimes: function() { return /* reexport */ addObjectUsedTimes; },
|
|
29557
|
+
addWindowTrustedOrigin: function() { return /* reexport */ addWindowTrustedOrigin; },
|
|
29515
29558
|
decrypt: function() { return /* reexport */ decrypt; },
|
|
29516
29559
|
destroyEventCenter: function() { return /* reexport */ destroyEventCenter; },
|
|
29517
29560
|
fireEvent: function() { return /* reexport */ fireEvent; },
|
|
29518
29561
|
getAPPInfosByID: function() { return /* reexport */ getAPPInfosByID; },
|
|
29562
|
+
getAllUserInfosByGroupID: function() { return /* reexport */ getAllUserInfosByGroupID; },
|
|
29519
29563
|
getAppPortalMenuDatas: function() { return /* reexport */ getAppPortalMenuDatas; },
|
|
29520
29564
|
getAuthPic: function() { return /* reexport */ getAuthPic; },
|
|
29565
|
+
getChildrenOfficeInfosByID: function() { return /* reexport */ getChildrenOfficeInfosByID; },
|
|
29521
29566
|
getCurrentUserPortalPageID: function() { return /* reexport */ getCurrentUserPortalPageID; },
|
|
29522
29567
|
getGroupMappingsByAccount: function() { return /* reexport */ getGroupMappingsByAccount; },
|
|
29523
29568
|
getKey: function() { return /* reexport */ getKey; },
|
|
@@ -29528,16 +29573,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29528
29573
|
getObjectUseTimes: function() { return /* reexport */ getObjectUseTimes; },
|
|
29529
29574
|
getOfficeInfosByIDs: function() { return /* reexport */ getOfficeInfosByIDs; },
|
|
29530
29575
|
getPageIDByComponentID: function() { return /* reexport */ getPageIDByComponentID; },
|
|
29576
|
+
getPojectDptsByUserAndGroupID: function() { return /* reexport */ getPojectDptsByUserAndGroupID; },
|
|
29531
29577
|
getPoratlAppID: function() { return /* reexport */ getPoratlAppID; },
|
|
29532
29578
|
getPortalAccessToken: function() { return /* reexport */ getPortalAccessToken; },
|
|
29533
29579
|
getPortalPageConfig: function() { return /* reexport */ getPortalPageConfig; },
|
|
29534
29580
|
getPortalPageMenuID: function() { return /* reexport */ getPortalPageMenuID; },
|
|
29581
|
+
getPortalUserInfo: function() { return /* reexport */ getPortalUserInfo; },
|
|
29535
29582
|
getPortalUserMappingInfos: function() { return /* reexport */ getPortalUserMappingInfos; },
|
|
29583
|
+
getPortalUserSig: function() { return /* reexport */ getPortalUserSig; },
|
|
29536
29584
|
getRoleIDsByUserAndGroupID: function() { return /* reexport */ getRoleIDsByUserAndGroupID; },
|
|
29537
29585
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
29538
29586
|
getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
|
|
29539
29587
|
hasListener: function() { return /* reexport */ hasListener; },
|
|
29540
29588
|
initEventCenter: function() { return /* reexport */ initEventCenter; },
|
|
29589
|
+
initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
|
|
29541
29590
|
loginAccount: function() { return /* reexport */ loginAccount; },
|
|
29542
29591
|
logoutAccount: function() { return /* reexport */ logoutAccount; },
|
|
29543
29592
|
queryAppVariable: function() { return /* reexport */ queryAppVariable; },
|
|
@@ -29546,7 +29595,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29546
29595
|
queryGroupInfosByOfficeId: function() { return /* reexport */ queryGroupInfosByOfficeId; },
|
|
29547
29596
|
queryOfficeInfosById: function() { return /* reexport */ queryOfficeInfosById; },
|
|
29548
29597
|
registerEventListener: function() { return /* reexport */ registerEventListener; },
|
|
29598
|
+
removeEventAction: function() { return /* reexport */ removeEventAction; },
|
|
29549
29599
|
removeEventListener: function() { return /* reexport */ removeEventListener; },
|
|
29600
|
+
removeWindowTrustedOrigin: function() { return /* reexport */ removeWindowTrustedOrigin; },
|
|
29601
|
+
sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
|
|
29550
29602
|
setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
|
|
29551
29603
|
switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
|
|
29552
29604
|
updateUserSelectPortal: function() { return /* reexport */ updateUserSelectPortal; },
|
|
@@ -29714,11 +29766,7 @@ let prefixPath = window.prefixPath || "";
|
|
|
29714
29766
|
|
|
29715
29767
|
|
|
29716
29768
|
|
|
29717
|
-
|
|
29718
|
-
let result = await request.get(`/sdata/rest/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
29719
|
-
console.log("getPortalAccessToken", result);
|
|
29720
|
-
return result;
|
|
29721
|
-
};
|
|
29769
|
+
|
|
29722
29770
|
/**
|
|
29723
29771
|
* 获取门户应用ID
|
|
29724
29772
|
* @param {*} isPortalAction 是否是门户操作
|
|
@@ -30132,6 +30180,11 @@ const getMappingAppInfoByID = async (appID, groupID) => {
|
|
|
30132
30180
|
let appInfo = resultData.data.appInfo;
|
|
30133
30181
|
return appInfo;
|
|
30134
30182
|
};
|
|
30183
|
+
|
|
30184
|
+
/**
|
|
30185
|
+
*
|
|
30186
|
+
* @returns 获取门户登录页面的公告信息
|
|
30187
|
+
*/
|
|
30135
30188
|
const getLoginPageNotices = async () => {
|
|
30136
30189
|
let queryData = {
|
|
30137
30190
|
"param": {
|
|
@@ -30142,6 +30195,69 @@ const getLoginPageNotices = async () => {
|
|
|
30142
30195
|
let noticeInfos = resultData.data.resultDatas;
|
|
30143
30196
|
return noticeInfos;
|
|
30144
30197
|
};
|
|
30198
|
+
|
|
30199
|
+
/**
|
|
30200
|
+
* 获取门户单点登录接入Token
|
|
30201
|
+
* @param {*} appKey
|
|
30202
|
+
* @param {*} appSecret
|
|
30203
|
+
* @returns
|
|
30204
|
+
*/
|
|
30205
|
+
const getPortalAccessToken = async (appKey, appSecret) => {
|
|
30206
|
+
let result = await request.get(`/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
30207
|
+
let token = result.data;
|
|
30208
|
+
return token;
|
|
30209
|
+
};
|
|
30210
|
+
|
|
30211
|
+
/**
|
|
30212
|
+
* 通过code和接入Token获取用户身份信息
|
|
30213
|
+
* @param {*} code
|
|
30214
|
+
* @param {*} access_token
|
|
30215
|
+
* @returns
|
|
30216
|
+
*/
|
|
30217
|
+
const getPortalUserInfo = async (code, access_token) => {
|
|
30218
|
+
let result = await request.get(`/systhirdapp/user/getUserByCode?code=${code}&access_token=${access_token}`);
|
|
30219
|
+
let data = result.data;
|
|
30220
|
+
return data;
|
|
30221
|
+
};
|
|
30222
|
+
|
|
30223
|
+
/**
|
|
30224
|
+
* 通过用户ID,平台类型,租户ID获取用户IM的签名ID
|
|
30225
|
+
* @param {*} userID
|
|
30226
|
+
* @param {*} platType
|
|
30227
|
+
* @param {*} groupID
|
|
30228
|
+
* @returns
|
|
30229
|
+
*/
|
|
30230
|
+
const getPortalUserSig = async (userID, platType, groupID) => {
|
|
30231
|
+
let queryData = {
|
|
30232
|
+
param: {
|
|
30233
|
+
userID: userID,
|
|
30234
|
+
im_type: platType,
|
|
30235
|
+
group_id: groupID
|
|
30236
|
+
}
|
|
30237
|
+
};
|
|
30238
|
+
let result = await request.post(`/dataservice/rest/orchestration/getIMUserSigByID`, queryData);
|
|
30239
|
+
let sigID = result.data.userSig;
|
|
30240
|
+
return sigID;
|
|
30241
|
+
};
|
|
30242
|
+
|
|
30243
|
+
/**
|
|
30244
|
+
* 添加IM签名ID映射关系
|
|
30245
|
+
*/
|
|
30246
|
+
const addIMMapping = async (userID, platType, groupID, sigID) => {
|
|
30247
|
+
let queryData = {
|
|
30248
|
+
param: {
|
|
30249
|
+
data: {
|
|
30250
|
+
userID: userID,
|
|
30251
|
+
im_type: platType,
|
|
30252
|
+
group_id: groupID,
|
|
30253
|
+
userSig: sigID
|
|
30254
|
+
}
|
|
30255
|
+
}
|
|
30256
|
+
};
|
|
30257
|
+
let result = await request.post(`/dataservice/rest/orchestration/addIMMapping`, queryData);
|
|
30258
|
+
let resultData = result.data;
|
|
30259
|
+
return resultData;
|
|
30260
|
+
};
|
|
30145
30261
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
30146
30262
|
var crypto_js = __webpack_require__(1396);
|
|
30147
30263
|
var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
|
|
@@ -30481,11 +30597,126 @@ const getAPPInfosByID = async id => {
|
|
|
30481
30597
|
let groupDptData = resultData.data.appInfo;
|
|
30482
30598
|
return groupDptData;
|
|
30483
30599
|
};
|
|
30600
|
+
const getAllUserInfosByGroupID = async groupID => {
|
|
30601
|
+
let requestData = {
|
|
30602
|
+
param: {
|
|
30603
|
+
groupID: groupID
|
|
30604
|
+
}
|
|
30605
|
+
};
|
|
30606
|
+
let result = await request.post(`/dataservice/rest/orchestration/getAllUserInfosByGroupID`, requestData);
|
|
30607
|
+
let data = result.data.resultDatas;
|
|
30608
|
+
return data;
|
|
30609
|
+
};
|
|
30610
|
+
const getChildrenOfficeInfosByID = async officeID => {
|
|
30611
|
+
let requestData = {
|
|
30612
|
+
param: {
|
|
30613
|
+
officeID: officeID
|
|
30614
|
+
}
|
|
30615
|
+
};
|
|
30616
|
+
let result = await request.post(`/dataservice/rest/orchestration/getChildrenOfficeInfosByID`, requestData);
|
|
30617
|
+
let data = result.data.resultDatas;
|
|
30618
|
+
return data;
|
|
30619
|
+
};
|
|
30620
|
+
const getPojectDptsByUserAndGroupID = async (userID, groupID) => {
|
|
30621
|
+
let requestData = {
|
|
30622
|
+
param: {
|
|
30623
|
+
userID: userID,
|
|
30624
|
+
groupID: groupID
|
|
30625
|
+
}
|
|
30626
|
+
};
|
|
30627
|
+
let result = await request.post(`/dataservice/rest/orchestration/getPojectDptsByUserAndGroupID`, requestData);
|
|
30628
|
+
let data = {
|
|
30629
|
+
dptDatas: result.data.officeDatas,
|
|
30630
|
+
userMappings: result.data.userMappings
|
|
30631
|
+
};
|
|
30632
|
+
return data;
|
|
30633
|
+
};
|
|
30634
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
30635
|
+
var es_iterator_some = __webpack_require__(3579);
|
|
30636
|
+
;// ./src/api/iframe.js
|
|
30637
|
+
|
|
30638
|
+
|
|
30639
|
+
|
|
30640
|
+
const addWindowTrustedOrigin = origin => {
|
|
30641
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30642
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30643
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS.includes(origin)) {
|
|
30644
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.push(origin);
|
|
30645
|
+
}
|
|
30646
|
+
};
|
|
30647
|
+
const removeWindowTrustedOrigin = origin => {
|
|
30648
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30649
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30650
|
+
let index = SDATA_WINDOW_TRUSTED_ORIGINS.indexOf(origin); // 查找元素在数组中的索引
|
|
30651
|
+
if (index > -1) {
|
|
30652
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.splice(index, 1); // 删除元素
|
|
30653
|
+
}
|
|
30654
|
+
};
|
|
30655
|
+
const addEventAction = (eventKey, eventAction) => {
|
|
30656
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30657
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30658
|
+
window.sdataEventActions[eventKey] = eventAction;
|
|
30659
|
+
};
|
|
30660
|
+
const removeEventAction = eventKey => {
|
|
30661
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30662
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30663
|
+
delete window.sdataEventActions[eventKey];
|
|
30664
|
+
};
|
|
30665
|
+
const initFrameWindowListener = () => {
|
|
30666
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30667
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30668
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30669
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30670
|
+
// 监听主页面的消息
|
|
30671
|
+
window.addEventListener("message", async event => {
|
|
30672
|
+
// 步骤1:验证来源是否在白名单中
|
|
30673
|
+
const isTrusted = window.SDATA_WINDOW_TRUSTED_ORIGINS.some(origin => event.origin === origin || new RegExp(origin).test(event.origin));
|
|
30674
|
+
if (!isTrusted) {
|
|
30675
|
+
console.log("拒绝非可信源消息:", event.origin);
|
|
30676
|
+
return; // 直接终止处理
|
|
30677
|
+
}
|
|
30678
|
+
let eventKey = event.data?.eventKey;
|
|
30679
|
+
if (!eventKey) return;
|
|
30680
|
+
let eventSourceKey = event.origin;
|
|
30681
|
+
console.log(`收到${eventSourceKey}页面消息:`, event.data);
|
|
30682
|
+
if (eventKey === "sdata_alllife_event_response") {
|
|
30683
|
+
let eventOperateKey = event.data.eventOperateKey;
|
|
30684
|
+
let eventAction = window.sdataEventActions[eventOperateKey];
|
|
30685
|
+
//删除缓存方法
|
|
30686
|
+
delete window.sdataEventActions[eventOperateKey];
|
|
30687
|
+
if (eventAction) await eventAction(event.data.data);
|
|
30688
|
+
} else {
|
|
30689
|
+
let eventAction = window.sdataEventActions[eventKey];
|
|
30690
|
+
let responseData = {
|
|
30691
|
+
eventKey: "sdata_alllife_event_response",
|
|
30692
|
+
eventOperateKey: event.data.eventOperateKey,
|
|
30693
|
+
data: {}
|
|
30694
|
+
};
|
|
30695
|
+
if (eventAction) {
|
|
30696
|
+
let resultData = await eventAction(event.data.data);
|
|
30697
|
+
responseData.data = resultData;
|
|
30698
|
+
}
|
|
30699
|
+
event.source.postMessage(responseData, eventSourceKey);
|
|
30700
|
+
}
|
|
30701
|
+
});
|
|
30702
|
+
};
|
|
30703
|
+
const sendWindowMessage = async (targetWindow, originKey, eventKey, data, callback) => {
|
|
30704
|
+
let timestamp = new Date().getTime();
|
|
30705
|
+
let eventOperateKey = `${originKey}_${timestamp}`;
|
|
30706
|
+
addEventAction(eventOperateKey, callback);
|
|
30707
|
+
let postData = {
|
|
30708
|
+
eventOperateKey: eventOperateKey,
|
|
30709
|
+
eventKey: eventKey,
|
|
30710
|
+
data: data
|
|
30711
|
+
};
|
|
30712
|
+
targetWindow.postMessage(postData, originKey);
|
|
30713
|
+
};
|
|
30484
30714
|
;// ./src/main.js
|
|
30485
30715
|
|
|
30486
30716
|
|
|
30487
30717
|
|
|
30488
30718
|
|
|
30719
|
+
|
|
30489
30720
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
|
|
30490
30721
|
|
|
30491
30722
|
|