@das-fed/upf-utils 6.4.0-dev.170 → 6.4.0-dev.172
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/api-services/es5.js +4661 -0
- package/api-services/i18n/es5.js +58 -0
- package/api-services/index.js +593 -611
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +847 -883
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +701 -715
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +882 -882
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +880 -880
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +473 -491
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +490 -508
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +4619 -0
- package/api-services/modules/file/index.js +942 -978
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +701 -715
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +651 -669
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +1104 -1140
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +492 -510
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +698 -712
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +880 -880
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +490 -508
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +463 -481
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +880 -880
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +487 -505
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +881 -881
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +483 -501
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +490 -508
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +880 -880
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +880 -880
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +865 -901
- package/api-services/src/create-service/index.js.gz +0 -0
- package/atob/es5.js +12 -0
- package/common-info/es5.js +219 -0
- package/common-info/getIframeUrl/es5.js +18 -0
- package/common-info/getInfoFromUrl/es5.js +94 -0
- package/common-info/index.js +18 -18
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/es5.js +2212 -0
- package/common-info/set-personal-info/index.js +172 -189
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/arr-tools/es5.js +14 -0
- package/common-tools/calc-text-width/es5.js +10 -0
- package/common-tools/date-format/es5.js +20 -0
- package/common-tools/es5.js +128 -0
- package/common-tools/extract-file-name/es5.js +2213 -0
- package/common-tools/extract-file-name/index.js +138 -155
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/get-file-extension/es5.js +7 -0
- package/common-tools/get-url-params/es5.js +109 -0
- package/common-tools/handle-data/es5.js +170 -0
- package/common-tools/handle-data/index.js +28 -28
- package/common-tools/handle-data/index.js.gz +0 -0
- package/common-tools/nest-tree-format/es5.js +58 -0
- package/common-tools/obj-tools/es5.js +15 -0
- package/common-tools/platform-tools/es5.js +24 -0
- package/common-tools/queue-promise/es5.js +15 -0
- package/common-tools/setHtmlMinWH/es5.js +8 -0
- package/common-tools/update-browser-title/es5.js +56 -0
- package/common-tools/update-fav-icon/es5.js +76 -0
- package/config/es5.js +17 -0
- package/create-api-service/check-token/es5.js +2307 -0
- package/create-api-service/check-token/index.js +158 -175
- package/create-api-service/check-token/index.js.gz +0 -0
- package/create-api-service/es5.js +3949 -0
- package/create-api-service/i18n/es5.js +38 -0
- package/create-api-service/index.js +503 -521
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/proxy-sso/es5.js +35 -0
- package/create-api-service/sso/es5.js +2823 -0
- package/create-api-service/sso/index.js +309 -327
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/es5.js +2915 -0
- package/curring-http/index.js +285 -303
- package/curring-http/index.js.gz +0 -0
- package/dimple-canvas/es5.js +15 -0
- package/directive/auth/es5.js +96 -0
- package/directive/clickOutside/es5.js +87 -0
- package/directive/es5.js +23 -0
- package/directive/hoverInside/es5.js +61 -0
- package/directive/utils/es5.js +38 -0
- package/dom-check-in/es5.js +13 -0
- package/dom-watcher/es5.js +15 -0
- package/hooks/use-get-auth/es5.js +201 -0
- package/hooks/use-get-auth/index.js +22 -22
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/load-js/es5.js +15 -0
- package/nextTiken/es5.js +70 -0
- package/oss/es5.js +13 -0
- package/package.json +17 -4
- package/pinyin-first-character/es5.js +9313 -0
- package/pinyin-first-character/index.js +24 -24
- package/pinyin-first-character/index.js.gz +0 -0
- package/process-engine-info/es5.js +20 -0
- package/pure-image-src/es5.js +30 -0
- package/size-watcher/es5.js +35 -0
- package/style/es5.js +143 -0
- package/token-tools/es5.js +26 -0
- package/use-low-code/es5.js +117 -0
- package/use-low-code/index.js +2 -2
- package/use-low-code/index.js.gz +0 -0
- package/vue/es5.js +9 -0
- package/webSocket-service/es5.js +122 -0
- package/with-install/es5.js +8 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
8
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
9
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
var config = require('@das-fed/upf-utils/config/es5');
|
|
13
|
+
var commonInfo = require('@das-fed/upf-utils/common-info/es5');
|
|
14
|
+
var commonTools = require('@das-fed/upf-utils/common-tools/es5');
|
|
15
|
+
var c = config.getConfig(),
|
|
16
|
+
h = function h() {
|
|
17
|
+
var s = "";
|
|
18
|
+
return c.baseURL ? s = c.baseURL : s = location.origin, s.replace("https://", "wss://").replace("http://", "ws://") || "";
|
|
19
|
+
},
|
|
20
|
+
w = function w(s) {
|
|
21
|
+
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
22
|
+
var e = commonTools.objectToUrlparams(t);
|
|
23
|
+
return e ? h() + s + "?".concat(e) : h() + s;
|
|
24
|
+
},
|
|
25
|
+
p = function p(s, t) {
|
|
26
|
+
return Math.floor(Math.random() * (t - s + 1)) + s;
|
|
27
|
+
};
|
|
28
|
+
var R = /*#__PURE__*/function () {
|
|
29
|
+
function R(_ref) {
|
|
30
|
+
var t = _ref.url,
|
|
31
|
+
_ref$params = _ref.params,
|
|
32
|
+
e = _ref$params === void 0 ? {} : _ref$params,
|
|
33
|
+
r = _ref.opened,
|
|
34
|
+
n = _ref.close,
|
|
35
|
+
i = _ref.error,
|
|
36
|
+
o = _ref.message,
|
|
37
|
+
a = _ref.ifReconnect,
|
|
38
|
+
l = _ref.reconnectNum,
|
|
39
|
+
u = _ref.reconnectWhenClose;
|
|
40
|
+
_classCallCheck(this, R);
|
|
41
|
+
if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = false, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = true, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = false, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = a !== null && a !== void 0 ? a : true, this.reconnectNum = l !== null && l !== void 0 ? l : 3, this.reconnectWhenClose = u !== null && u !== void 0 ? u : false, this.lockReturn = false, this.currentReconnectNum = 0, this.reconnectId = null, this.params = _objectSpread(_objectSpread({}, e), {}, {
|
|
42
|
+
access_token: commonInfo.getToken()
|
|
43
|
+
}), t) this.url = t;else throw new Error("url is required");
|
|
44
|
+
r && (this.opened = r), n && (this.close = n), i && (this.error = i), o && (this.afterMsg = o), this.initWebSocket();
|
|
45
|
+
}
|
|
46
|
+
return _createClass(R, [{
|
|
47
|
+
key: "initWebSocket",
|
|
48
|
+
value: function initWebSocket() {
|
|
49
|
+
var _this = this;
|
|
50
|
+
if ((typeof WebSocket === "undefined" ? "undefined" : _typeof(WebSocket)) > "u") throw new Error("您的浏览器不支持websocket");
|
|
51
|
+
var t = w(this.url, this.params);
|
|
52
|
+
this.$ws = new WebSocket(t), this.$ws.onopen = function () {
|
|
53
|
+
_this.open();
|
|
54
|
+
}, this.$ws.onclose = function (e) {
|
|
55
|
+
_this.close(e);
|
|
56
|
+
}, this.$ws.onmessage = function (e) {
|
|
57
|
+
_this.message(e);
|
|
58
|
+
}, this.$ws.onerror = function (e) {
|
|
59
|
+
_this.error(e);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "open",
|
|
64
|
+
value: function open() {
|
|
65
|
+
this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat();
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "opened",
|
|
69
|
+
value: function opened(t) {}
|
|
70
|
+
}, {
|
|
71
|
+
key: "close",
|
|
72
|
+
value: function close(t) {
|
|
73
|
+
this.$ws.readyState === WebSocket.CLOSED && ((/* @__PURE__ */new Date()).getTime(), this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval));
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "message",
|
|
77
|
+
value: function message(t) {
|
|
78
|
+
var e = _typeof(t.data) == "object" ? t.data : JSON.parse(t.data);
|
|
79
|
+
this.afterMsg(e);
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "afterMsg",
|
|
83
|
+
value: function afterMsg(t) {}
|
|
84
|
+
}, {
|
|
85
|
+
key: "error",
|
|
86
|
+
value: function error(t) {
|
|
87
|
+
return this.ifReconnect && this.reconnect(), t;
|
|
88
|
+
}
|
|
89
|
+
/** websocket重连 */
|
|
90
|
+
}, {
|
|
91
|
+
key: "reconnect",
|
|
92
|
+
value: function reconnect() {
|
|
93
|
+
var _this2 = this;
|
|
94
|
+
this.lockReturn || (this.lockReturn = true, this.currentReconnectNum++, !(this.currentReconnectNum > this.reconnectNum) && (this.reconnectId && clearTimeout(this.reconnectId), this.reconnectId = setTimeout(function () {
|
|
95
|
+
_this2.initWebSocket(), _this2.lockReturn = false;
|
|
96
|
+
}, 3e3)));
|
|
97
|
+
}
|
|
98
|
+
/** 发送消息给服务器 */
|
|
99
|
+
}, {
|
|
100
|
+
key: "send",
|
|
101
|
+
value: function send(t) {
|
|
102
|
+
var e;
|
|
103
|
+
((e = this.$ws) == null ? undefined : e.readyState) === WebSocket.OPEN && this.$ws.send(t);
|
|
104
|
+
}
|
|
105
|
+
// 启动心跳检测==>30s-5分钟内随机发一次心跳保持会话(时间区间内随机是为了降低突增流量的概率)
|
|
106
|
+
}, {
|
|
107
|
+
key: "startHeartbeat",
|
|
108
|
+
value: function startHeartbeat() {
|
|
109
|
+
var _this3 = this;
|
|
110
|
+
this.heartbeatInterval = setInterval(function () {
|
|
111
|
+
_this3.send("");
|
|
112
|
+
}, p(3e4, 3e5));
|
|
113
|
+
}
|
|
114
|
+
/** 断开连接 */
|
|
115
|
+
}, {
|
|
116
|
+
key: "disconnect",
|
|
117
|
+
value: function disconnect() {
|
|
118
|
+
this.$ws.close();
|
|
119
|
+
}
|
|
120
|
+
}]);
|
|
121
|
+
}();
|
|
122
|
+
exports.socketService = R;
|