isdata-customer-sdk 0.1.47 → 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.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,7 +29551,10 @@ __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; },
|
|
@@ -29532,12 +29575,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29532
29575
|
getPortalAccessToken: function() { return /* reexport */ getPortalAccessToken; },
|
|
29533
29576
|
getPortalPageConfig: function() { return /* reexport */ getPortalPageConfig; },
|
|
29534
29577
|
getPortalPageMenuID: function() { return /* reexport */ getPortalPageMenuID; },
|
|
29578
|
+
getPortalUserInfo: function() { return /* reexport */ getPortalUserInfo; },
|
|
29535
29579
|
getPortalUserMappingInfos: function() { return /* reexport */ getPortalUserMappingInfos; },
|
|
29580
|
+
getPortalUserSig: function() { return /* reexport */ getPortalUserSig; },
|
|
29536
29581
|
getRoleIDsByUserAndGroupID: function() { return /* reexport */ getRoleIDsByUserAndGroupID; },
|
|
29537
29582
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
29538
29583
|
getUserAllMappngPortal: function() { return /* reexport */ getUserAllMappngPortal; },
|
|
29539
29584
|
hasListener: function() { return /* reexport */ hasListener; },
|
|
29540
29585
|
initEventCenter: function() { return /* reexport */ initEventCenter; },
|
|
29586
|
+
initFrameWindowListener: function() { return /* reexport */ initFrameWindowListener; },
|
|
29541
29587
|
loginAccount: function() { return /* reexport */ loginAccount; },
|
|
29542
29588
|
logoutAccount: function() { return /* reexport */ logoutAccount; },
|
|
29543
29589
|
queryAppVariable: function() { return /* reexport */ queryAppVariable; },
|
|
@@ -29546,7 +29592,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29546
29592
|
queryGroupInfosByOfficeId: function() { return /* reexport */ queryGroupInfosByOfficeId; },
|
|
29547
29593
|
queryOfficeInfosById: function() { return /* reexport */ queryOfficeInfosById; },
|
|
29548
29594
|
registerEventListener: function() { return /* reexport */ registerEventListener; },
|
|
29595
|
+
removeEventAction: function() { return /* reexport */ removeEventAction; },
|
|
29549
29596
|
removeEventListener: function() { return /* reexport */ removeEventListener; },
|
|
29597
|
+
removeWindowTrustedOrigin: function() { return /* reexport */ removeWindowTrustedOrigin; },
|
|
29598
|
+
sendWindowMessage: function() { return /* reexport */ sendWindowMessage; },
|
|
29550
29599
|
setPortalPageConfig: function() { return /* reexport */ setPortalPageConfig; },
|
|
29551
29600
|
switchPortalLogin: function() { return /* reexport */ switchPortalLogin; },
|
|
29552
29601
|
updateUserSelectPortal: function() { return /* reexport */ updateUserSelectPortal; },
|
|
@@ -29714,11 +29763,7 @@ let prefixPath = window.prefixPath || "";
|
|
|
29714
29763
|
|
|
29715
29764
|
|
|
29716
29765
|
|
|
29717
|
-
|
|
29718
|
-
let result = await request.get(`/sdata/rest/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
29719
|
-
console.log("getPortalAccessToken", result);
|
|
29720
|
-
return result;
|
|
29721
|
-
};
|
|
29766
|
+
|
|
29722
29767
|
/**
|
|
29723
29768
|
* 获取门户应用ID
|
|
29724
29769
|
* @param {*} isPortalAction 是否是门户操作
|
|
@@ -30132,6 +30177,11 @@ const getMappingAppInfoByID = async (appID, groupID) => {
|
|
|
30132
30177
|
let appInfo = resultData.data.appInfo;
|
|
30133
30178
|
return appInfo;
|
|
30134
30179
|
};
|
|
30180
|
+
|
|
30181
|
+
/**
|
|
30182
|
+
*
|
|
30183
|
+
* @returns 获取门户登录页面的公告信息
|
|
30184
|
+
*/
|
|
30135
30185
|
const getLoginPageNotices = async () => {
|
|
30136
30186
|
let queryData = {
|
|
30137
30187
|
"param": {
|
|
@@ -30142,6 +30192,69 @@ const getLoginPageNotices = async () => {
|
|
|
30142
30192
|
let noticeInfos = resultData.data.resultDatas;
|
|
30143
30193
|
return noticeInfos;
|
|
30144
30194
|
};
|
|
30195
|
+
|
|
30196
|
+
/**
|
|
30197
|
+
* 获取门户单点登录接入Token
|
|
30198
|
+
* @param {*} appKey
|
|
30199
|
+
* @param {*} appSecret
|
|
30200
|
+
* @returns
|
|
30201
|
+
*/
|
|
30202
|
+
const getPortalAccessToken = async (appKey, appSecret) => {
|
|
30203
|
+
let result = await request.get(`/appAuth/getAccessToken?appKey=${appKey}&appSecret=${appSecret}`);
|
|
30204
|
+
let token = result.data;
|
|
30205
|
+
return token;
|
|
30206
|
+
};
|
|
30207
|
+
|
|
30208
|
+
/**
|
|
30209
|
+
* 通过code和接入Token获取用户身份信息
|
|
30210
|
+
* @param {*} code
|
|
30211
|
+
* @param {*} access_token
|
|
30212
|
+
* @returns
|
|
30213
|
+
*/
|
|
30214
|
+
const getPortalUserInfo = async (code, access_token) => {
|
|
30215
|
+
let result = await request.get(`/systhirdapp/user/getUserByCode?code=${code}&access_token=${access_token}`);
|
|
30216
|
+
let data = result.data;
|
|
30217
|
+
return data;
|
|
30218
|
+
};
|
|
30219
|
+
|
|
30220
|
+
/**
|
|
30221
|
+
* 通过用户ID,平台类型,租户ID获取用户IM的签名ID
|
|
30222
|
+
* @param {*} userID
|
|
30223
|
+
* @param {*} platType
|
|
30224
|
+
* @param {*} groupID
|
|
30225
|
+
* @returns
|
|
30226
|
+
*/
|
|
30227
|
+
const getPortalUserSig = async (userID, platType, groupID) => {
|
|
30228
|
+
let queryData = {
|
|
30229
|
+
param: {
|
|
30230
|
+
userID: userID,
|
|
30231
|
+
im_type: platType,
|
|
30232
|
+
group_id: groupID
|
|
30233
|
+
}
|
|
30234
|
+
};
|
|
30235
|
+
let result = await request.post(`/dataservice/rest/orchestration/getIMUserSigByID`, queryData);
|
|
30236
|
+
let sigID = result.data.userSig;
|
|
30237
|
+
return sigID;
|
|
30238
|
+
};
|
|
30239
|
+
|
|
30240
|
+
/**
|
|
30241
|
+
* 添加IM签名ID映射关系
|
|
30242
|
+
*/
|
|
30243
|
+
const addIMMapping = async (userID, platType, groupID, sigID) => {
|
|
30244
|
+
let queryData = {
|
|
30245
|
+
param: {
|
|
30246
|
+
data: {
|
|
30247
|
+
userID: userID,
|
|
30248
|
+
im_type: platType,
|
|
30249
|
+
group_id: groupID,
|
|
30250
|
+
userSig: sigID
|
|
30251
|
+
}
|
|
30252
|
+
}
|
|
30253
|
+
};
|
|
30254
|
+
let result = await request.post(`/dataservice/rest/orchestration/addIMMapping`, queryData);
|
|
30255
|
+
let resultData = result.data;
|
|
30256
|
+
return resultData;
|
|
30257
|
+
};
|
|
30145
30258
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
30146
30259
|
var crypto_js = __webpack_require__(1396);
|
|
30147
30260
|
var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
|
|
@@ -30481,11 +30594,92 @@ const getAPPInfosByID = async id => {
|
|
|
30481
30594
|
let groupDptData = resultData.data.appInfo;
|
|
30482
30595
|
return groupDptData;
|
|
30483
30596
|
};
|
|
30597
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
30598
|
+
var es_iterator_some = __webpack_require__(3579);
|
|
30599
|
+
;// ./src/api/iframe.js
|
|
30600
|
+
|
|
30601
|
+
|
|
30602
|
+
|
|
30603
|
+
const addWindowTrustedOrigin = origin => {
|
|
30604
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30605
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30606
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS.includes(origin)) {
|
|
30607
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.push(origin);
|
|
30608
|
+
}
|
|
30609
|
+
};
|
|
30610
|
+
const removeWindowTrustedOrigin = origin => {
|
|
30611
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30612
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30613
|
+
let index = SDATA_WINDOW_TRUSTED_ORIGINS.indexOf(origin); // 查找元素在数组中的索引
|
|
30614
|
+
if (index > -1) {
|
|
30615
|
+
SDATA_WINDOW_TRUSTED_ORIGINS.splice(index, 1); // 删除元素
|
|
30616
|
+
}
|
|
30617
|
+
};
|
|
30618
|
+
const addEventAction = (eventKey, eventAction) => {
|
|
30619
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30620
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30621
|
+
window.sdataEventActions[eventKey] = eventAction;
|
|
30622
|
+
};
|
|
30623
|
+
const removeEventAction = eventKey => {
|
|
30624
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30625
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30626
|
+
delete window.sdataEventActions[eventKey];
|
|
30627
|
+
};
|
|
30628
|
+
const initFrameWindowListener = () => {
|
|
30629
|
+
let SDATA_WINDOW_TRUSTED_ORIGINS = window.SDATA_WINDOW_TRUSTED_ORIGINS;
|
|
30630
|
+
if (!SDATA_WINDOW_TRUSTED_ORIGINS) window.SDATA_WINDOW_TRUSTED_ORIGINS = [];
|
|
30631
|
+
let sdataEventActions = window.sdataEventActions;
|
|
30632
|
+
if (!sdataEventActions) window.sdataEventActions = {};
|
|
30633
|
+
// 监听主页面的消息
|
|
30634
|
+
window.addEventListener("message", async event => {
|
|
30635
|
+
// 步骤1:验证来源是否在白名单中
|
|
30636
|
+
const isTrusted = window.SDATA_WINDOW_TRUSTED_ORIGINS.some(origin => event.origin === origin || new RegExp(origin).test(event.origin));
|
|
30637
|
+
if (!isTrusted) {
|
|
30638
|
+
console.log("拒绝非可信源消息:", event.origin);
|
|
30639
|
+
return; // 直接终止处理
|
|
30640
|
+
}
|
|
30641
|
+
let eventKey = event.data?.eventKey;
|
|
30642
|
+
if (!eventKey) return;
|
|
30643
|
+
let eventSourceKey = event.origin;
|
|
30644
|
+
console.log(`收到${eventSourceKey}页面消息:`, event.data);
|
|
30645
|
+
if (eventKey === "sdata_alllife_event_response") {
|
|
30646
|
+
let eventOperateKey = event.data.eventOperateKey;
|
|
30647
|
+
let eventAction = window.sdataEventActions[eventOperateKey];
|
|
30648
|
+
//删除缓存方法
|
|
30649
|
+
delete window.sdataEventActions[eventOperateKey];
|
|
30650
|
+
if (eventAction) await eventAction(event.data.data);
|
|
30651
|
+
} else {
|
|
30652
|
+
let eventAction = window.sdataEventActions[eventKey];
|
|
30653
|
+
let responseData = {
|
|
30654
|
+
eventKey: "sdata_alllife_event_response",
|
|
30655
|
+
eventOperateKey: event.data.eventOperateKey,
|
|
30656
|
+
data: {}
|
|
30657
|
+
};
|
|
30658
|
+
if (eventAction) {
|
|
30659
|
+
let resultData = await eventAction(event.data.data);
|
|
30660
|
+
responseData.data = resultData;
|
|
30661
|
+
}
|
|
30662
|
+
event.source.postMessage(responseData, eventSourceKey);
|
|
30663
|
+
}
|
|
30664
|
+
});
|
|
30665
|
+
};
|
|
30666
|
+
const sendWindowMessage = async (targetWindow, originKey, eventKey, data, callback) => {
|
|
30667
|
+
let timestamp = new Date().getTime();
|
|
30668
|
+
let eventOperateKey = `${originKey}_${timestamp}`;
|
|
30669
|
+
addEventAction(eventOperateKey, callback);
|
|
30670
|
+
let postData = {
|
|
30671
|
+
eventOperateKey: eventOperateKey,
|
|
30672
|
+
eventKey: eventKey,
|
|
30673
|
+
data: data
|
|
30674
|
+
};
|
|
30675
|
+
targetWindow.postMessage(postData, originKey);
|
|
30676
|
+
};
|
|
30484
30677
|
;// ./src/main.js
|
|
30485
30678
|
|
|
30486
30679
|
|
|
30487
30680
|
|
|
30488
30681
|
|
|
30682
|
+
|
|
30489
30683
|
;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
|
|
30490
30684
|
|
|
30491
30685
|
|