isdata-customer-sdk 0.1.48 → 0.1.49
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 +199 -5
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +199 -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,7 +29561,10 @@ __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; },
|
|
@@ -29542,12 +29585,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29542
29585
|
getPortalAccessToken: function() { return /* reexport */ getPortalAccessToken; },
|
|
29543
29586
|
getPortalPageConfig: function() { return /* reexport */ getPortalPageConfig; },
|
|
29544
29587
|
getPortalPageMenuID: function() { return /* reexport */ getPortalPageMenuID; },
|
|
29588
|
+
getPortalUserInfo: function() { return /* reexport */ getPortalUserInfo; },
|
|
29545
29589
|
getPortalUserMappingInfos: function() { return /* reexport */ getPortalUserMappingInfos; },
|
|
29590
|
+
getPortalUserSig: function() { return /* reexport */ getPortalUserSig; },
|
|
29546
29591
|
getRoleIDsByUserAndGroupID: function() { return /* reexport */ getRoleIDsByUserAndGroupID; },
|
|
29547
29592
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
29548
29593
|
getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
|
|
29549
29594
|
hasListener: function() { return /* reexport */ hasListener; },
|
|
29550
29595
|
initEventCenter: function() { return /* reexport */ initEventCenter; },
|
|
29596
|
+
initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
|
|
29551
29597
|
loginAccount: function() { return /* reexport */ loginAccount; },
|
|
29552
29598
|
logoutAccount: function() { return /* reexport */ logoutAccount; },
|
|
29553
29599
|
queryAppVariable: function() { return /* reexport */ queryAppVariable; },
|
|
@@ -29556,7 +29602,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29556
29602
|
queryGroupInfosByOfficeId: function() { return /* reexport */ queryGroupInfosByOfficeId; },
|
|
29557
29603
|
queryOfficeInfosById: function() { return /* reexport */ queryOfficeInfosById; },
|
|
29558
29604
|
registerEventListener: function() { return /* reexport */ registerEventListener; },
|
|
29605
|
+
removeEventAction: function() { return /* reexport */ removeEventAction; },
|
|
29559
29606
|
removeEventListener: function() { return /* reexport */ removeEventListener; },
|
|
29607
|
+
removeWindowTrustedOrigin: function() { return /* reexport */ removeWindowTrustedOrigin; },
|
|
29608
|
+
sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
|
|
29560
29609
|
setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
|
|
29561
29610
|
switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
|
|
29562
29611
|
updateUserSelectPortal: function() { return /* reexport */ updateUserSelectPortal; },
|
|
@@ -29724,11 +29773,7 @@ let prefixPath = window.prefixPath || "";
|
|
|
29724
29773
|
|
|
29725
29774
|
|
|
29726
29775
|
|
|
29727
|
-
|
|
29728
|
-
let result = await request.get(`/sdata/rest/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
29729
|
-
console.log("getPortalAccessToken", result);
|
|
29730
|
-
return result;
|
|
29731
|
-
};
|
|
29776
|
+
|
|
29732
29777
|
/**
|
|
29733
29778
|
* 获取门户应用ID
|
|
29734
29779
|
* @param {*} isPortalAction 是否是门户操作
|
|
@@ -30142,6 +30187,11 @@ const getMappingAppInfoByID = async (appID, groupID) => {
|
|
|
30142
30187
|
let appInfo = resultData.data.appInfo;
|
|
30143
30188
|
return appInfo;
|
|
30144
30189
|
};
|
|
30190
|
+
|
|
30191
|
+
/**
|
|
30192
|
+
*
|
|
30193
|
+
* @returns 获取门户登录页面的公告信息
|
|
30194
|
+
*/
|
|
30145
30195
|
const getLoginPageNotices = async () => {
|
|
30146
30196
|
let queryData = {
|
|
30147
30197
|
"param": {
|
|
@@ -30152,6 +30202,69 @@ const getLoginPageNotices = async () => {
|
|
|
30152
30202
|
let noticeInfos = resultData.data.resultDatas;
|
|
30153
30203
|
return noticeInfos;
|
|
30154
30204
|
};
|
|
30205
|
+
|
|
30206
|
+
/**
|
|
30207
|
+
* 获取门户单点登录接入Token
|
|
30208
|
+
* @param {*} appKey
|
|
30209
|
+
* @param {*} appSecret
|
|
30210
|
+
* @returns
|
|
30211
|
+
*/
|
|
30212
|
+
const getPortalAccessToken = async (appKey, appSecret) => {
|
|
30213
|
+
let result = await request.get(`/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
30214
|
+
let token = result.data;
|
|
30215
|
+
return token;
|
|
30216
|
+
};
|
|
30217
|
+
|
|
30218
|
+
/**
|
|
30219
|
+
* 通过code和接入Token获取用户身份信息
|
|
30220
|
+
* @param {*} code
|
|
30221
|
+
* @param {*} access_token
|
|
30222
|
+
* @returns
|
|
30223
|
+
*/
|
|
30224
|
+
const getPortalUserInfo = async (code, access_token) => {
|
|
30225
|
+
let result = await request.get(`/systhirdapp/user/getUserByCode?code=${code}&access_token=${access_token}`);
|
|
30226
|
+
let data = result.data;
|
|
30227
|
+
return data;
|
|
30228
|
+
};
|
|
30229
|
+
|
|
30230
|
+
/**
|
|
30231
|
+
* 通过用户ID,平台类型,租户ID获取用户IM的签名ID
|
|
30232
|
+
* @param {*} userID
|
|
30233
|
+
* @param {*} platType
|
|
30234
|
+
* @param {*} groupID
|
|
30235
|
+
* @returns
|
|
30236
|
+
*/
|
|
30237
|
+
const getPortalUserSig = async (userID, platType, groupID) => {
|
|
30238
|
+
let queryData = {
|
|
30239
|
+
param: {
|
|
30240
|
+
userID: userID,
|
|
30241
|
+
im_type: platType,
|
|
30242
|
+
group_id: groupID
|
|
30243
|
+
}
|
|
30244
|
+
};
|
|
30245
|
+
let result = await request.post(`/dataservice/rest/orchestration/getIMUserSigByID`, queryData);
|
|
30246
|
+
let sigID = result.data.userSig;
|
|
30247
|
+
return sigID;
|
|
30248
|
+
};
|
|
30249
|
+
|
|
30250
|
+
/**
|
|
30251
|
+
* 添加IM签名ID映射关系
|
|
30252
|
+
*/
|
|
30253
|
+
const addIMMapping = async (userID, platType, groupID, sigID) => {
|
|
30254
|
+
let queryData = {
|
|
30255
|
+
param: {
|
|
30256
|
+
data: {
|
|
30257
|
+
userID: userID,
|
|
30258
|
+
im_type: platType,
|
|
30259
|
+
group_id: groupID,
|
|
30260
|
+
userSig: sigID
|
|
30261
|
+
}
|
|
30262
|
+
}
|
|
30263
|
+
};
|
|
30264
|
+
let result = await request.post(`/dataservice/rest/orchestration/addIMMapping`, queryData);
|
|
30265
|
+
let resultData = result.data;
|
|
30266
|
+
return resultData;
|
|
30267
|
+
};
|
|
30155
30268
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
30156
30269
|
var crypto_js = __webpack_require__(1396);
|
|
30157
30270
|
var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
|
|
@@ -30491,11 +30604,92 @@ const getAPPInfosByID = async id => {
|
|
|
30491
30604
|
let groupDptData = resultData.data.appInfo;
|
|
30492
30605
|
return groupDptData;
|
|
30493
30606
|
};
|
|
30607
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
30608
|
+
var es_iterator_some = __webpack_require__(3579);
|
|
30609
|
+
;// ./src/api/iframe.js
|
|
30610
|
+
|
|
30611
|
+
|
|
30612
|
+
|
|
30613
|
+
const addWindowTrustedOrigin = origin => {
|
|
30614
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30615
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30616
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS.includes(origin)) {
|
|
30617
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.push(origin);
|
|
30618
|
+
}
|
|
30619
|
+
};
|
|
30620
|
+
const removeWindowTrustedOrigin = origin => {
|
|
30621
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30622
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30623
|
+
let index = SDATA_WINDOW_TRUSTED_ORIGINS.indexOf(origin); // 查找元素在数组中的索引
|
|
30624
|
+
if (index > -1) {
|
|
30625
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.splice(index, 1); // 删除元素
|
|
30626
|
+
}
|
|
30627
|
+
};
|
|
30628
|
+
const addEventAction = (eventKey, eventAction) => {
|
|
30629
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30630
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30631
|
+
window.sdataEventActions[eventKey] = eventAction;
|
|
30632
|
+
};
|
|
30633
|
+
const removeEventAction = eventKey => {
|
|
30634
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30635
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30636
|
+
delete window.sdataEventActions[eventKey];
|
|
30637
|
+
};
|
|
30638
|
+
const initFrameWindowListener = () => {
|
|
30639
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30640
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30641
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30642
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30643
|
+
// 监听主页面的消息
|
|
30644
|
+
window.addEventListener("message", async event => {
|
|
30645
|
+
// 步骤1:验证来源是否在白名单中
|
|
30646
|
+
const isTrusted = window.SDATA_WINDOW_TRUSTED_ORIGINS.some(origin => event.origin === origin || new RegExp(origin).test(event.origin));
|
|
30647
|
+
if (!isTrusted) {
|
|
30648
|
+
console.log("拒绝非可信源消息:", event.origin);
|
|
30649
|
+
return; // 直接终止处理
|
|
30650
|
+
}
|
|
30651
|
+
let eventKey = event.data?.eventKey;
|
|
30652
|
+
if (!eventKey) return;
|
|
30653
|
+
let eventSourceKey = event.origin;
|
|
30654
|
+
console.log(`收到${eventSourceKey}页面消息:`, event.data);
|
|
30655
|
+
if (eventKey === "sdata_alllife_event_response") {
|
|
30656
|
+
let eventOperateKey = event.data.eventOperateKey;
|
|
30657
|
+
let eventAction = window.sdataEventActions[eventOperateKey];
|
|
30658
|
+
//删除缓存方法
|
|
30659
|
+
delete window.sdataEventActions[eventOperateKey];
|
|
30660
|
+
if (eventAction) await eventAction(event.data.data);
|
|
30661
|
+
} else {
|
|
30662
|
+
let eventAction = window.sdataEventActions[eventKey];
|
|
30663
|
+
let responseData = {
|
|
30664
|
+
eventKey: "sdata_alllife_event_response",
|
|
30665
|
+
eventOperateKey: event.data.eventOperateKey,
|
|
30666
|
+
data: {}
|
|
30667
|
+
};
|
|
30668
|
+
if (eventAction) {
|
|
30669
|
+
let resultData = await eventAction(event.data.data);
|
|
30670
|
+
responseData.data = resultData;
|
|
30671
|
+
}
|
|
30672
|
+
event.source.postMessage(responseData, eventSourceKey);
|
|
30673
|
+
}
|
|
30674
|
+
});
|
|
30675
|
+
};
|
|
30676
|
+
const sendWindowMessage = async (targetWindow, originKey, eventKey, data, callback) => {
|
|
30677
|
+
let timestamp = new Date().getTime();
|
|
30678
|
+
let eventOperateKey = `${originKey}_${timestamp}`;
|
|
30679
|
+
addEventAction(eventOperateKey, callback);
|
|
30680
|
+
let postData = {
|
|
30681
|
+
eventOperateKey: eventOperateKey,
|
|
30682
|
+
eventKey: eventKey,
|
|
30683
|
+
data: data
|
|
30684
|
+
};
|
|
30685
|
+
targetWindow.postMessage(postData, originKey);
|
|
30686
|
+
};
|
|
30494
30687
|
;// ./src/main.js
|
|
30495
30688
|
|
|
30496
30689
|
|
|
30497
30690
|
|
|
30498
30691
|
|
|
30692
|
+
|
|
30499
30693
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
|
|
30500
30694
|
|
|
30501
30695
|
|