eoss 0.1.0-alpha.20 → 0.1.0-alpha.21
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/lib/account-login.js +1943 -1890
- package/lib/alert.js +4 -4
- package/lib/aside.js +4 -4
- package/lib/autocomplete.js +4936 -4834
- package/lib/avatar.js +4 -4
- package/lib/backtop.js +4 -4
- package/lib/badge.js +4 -4
- package/lib/breadcrumb-item.js +6 -6
- package/lib/breadcrumb.js +7 -7
- package/lib/button-group.js +11 -14
- package/lib/button.js +6 -6
- package/lib/ca-login.js +2480 -2382
- package/lib/calendar.js +798 -798
- package/lib/card.js +4 -4
- package/lib/carousel-item.js +911 -813
- package/lib/carousel.js +1646 -1548
- package/lib/cascader-panel.js +2556 -2458
- package/lib/cascader.js +4546 -4444
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +2894 -2841
- package/lib/checkbox.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +35159 -2572
- package/lib/collapse.js +35410 -2762
- package/lib/color-picker.js +494 -490
- package/lib/config/api.js +15 -1
- package/lib/container.js +4 -4
- package/lib/cron.js +4 -4
- package/lib/data-table.js +1895 -1842
- package/lib/date-picker.js +6422 -6320
- package/lib/dialog.js +2912 -2806
- package/lib/divider.js +4 -4
- package/lib/drawer.js +311 -299
- package/lib/dropdown-item.js +6 -6
- package/lib/dropdown-menu.js +539 -535
- package/lib/dropdown.js +2270 -2172
- package/lib/email-login.js +1783 -1730
- package/lib/empty.js +723 -0
- package/lib/eoss.common.js +63680 -56193
- package/lib/flip.js +4 -4
- package/lib/flow-group.js +2985 -2887
- package/lib/flow.js +28067 -28022
- package/lib/footer.js +4 -4
- package/lib/form-item.js +1935 -1837
- package/lib/form.js +9230 -9092
- package/lib/header.js +4 -4
- package/lib/icon.js +1708 -1590
- package/lib/icons.js +4 -4
- package/lib/image-viewer.js +1660 -1562
- package/lib/image.js +162 -162
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +76 -76
- package/lib/input-number.js +172 -172
- package/lib/input.js +1362 -1264
- package/lib/link.js +4 -4
- package/lib/loading.js +321 -317
- package/lib/login.js +3306 -3300
- package/lib/lowcode.js +13320 -0
- package/lib/main.js +14465 -14339
- package/lib/marquee.js +1237 -1139
- package/lib/menu-item-group.js +119 -119
- package/lib/menu-item.js +114 -114
- package/lib/menu.js +6193 -6091
- package/lib/message-box.js +3582 -3480
- package/lib/message.js +2265 -2163
- package/lib/notification.js +2430 -2328
- package/lib/option-group.js +4 -4
- package/lib/option.js +842 -744
- package/lib/page-header.js +4 -4
- package/lib/pagination.js +1916 -1815
- package/lib/phone-login.js +1788 -1735
- package/lib/popconfirm.js +8 -8
- package/lib/popover.js +4559 -4457
- package/lib/progress.js +4 -4
- package/lib/qr-code.js +9 -9
- package/lib/qrcode-login.js +1600 -1543
- package/lib/radio-button.js +6 -6
- package/lib/radio-group.js +2142 -2089
- package/lib/radio.js +6 -6
- package/lib/rate.js +1226 -1128
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +2695 -2597
- package/lib/select.js +5985 -5961
- package/lib/selector-panel.js +5239 -5186
- package/lib/selector.js +1712 -1659
- package/lib/slider.js +16 -16
- package/lib/step.js +35836 -2736
- package/lib/steps.js +1281 -1183
- package/lib/submenu.js +461 -457
- package/lib/switch.js +1010 -912
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +2595 -2497
- package/lib/table.js +9225 -9239
- package/lib/tabs.js +2414 -2320
- package/lib/tag.js +4 -4
- package/lib/theme-chalk/account-login.css +1 -1
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/empty.css +1 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -0
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/qrcode-login.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/time-picker.js +5823 -5819
- package/lib/time-select.js +3578 -3574
- package/lib/timeline-item.js +4 -4
- package/lib/timeline.js +4 -4
- package/lib/tips.js +1633 -1580
- package/lib/toolbar.js +213 -213
- package/lib/tooltip.js +4441 -4339
- package/lib/transfer.js +938 -840
- package/lib/tree-group.js +1875 -1757
- package/lib/tree.js +2626 -2573
- package/lib/upload.js +7209 -7156
- package/lib/utils/ajax.js +185 -243
- package/lib/utils/bus.js +2 -2
- package/lib/utils/popup/index.js +5 -1
- package/lib/utils/util.js +108 -11
- package/package.json +2 -2
- package/packages/button/src/button-group.vue +1 -4
- package/packages/collapse/src/collapse-item.vue +47 -33
- package/packages/dialog/src/dialog.vue +4 -1
- package/packages/drawer/src/drawer.vue +12 -4
- package/packages/empty/index.js +7 -0
- package/packages/empty/src/img-empty.vue +132 -0
- package/packages/empty/src/index.vue +49 -0
- package/packages/form/src/form-item-render.vue +16 -18
- package/packages/form/src/form.vue +27 -5
- package/packages/icons/src/icon.json +1 -1
- package/packages/login/src/login.vue +19 -21
- package/packages/login/src/mixins.js +2 -1
- package/packages/lowcode/index.js +5 -0
- package/packages/lowcode/src/aside.vue +331 -0
- package/packages/lowcode/src/attribute/bind.vue +441 -0
- package/packages/lowcode/src/attribute/dependency.vue +325 -0
- package/packages/lowcode/src/attribute/function.vue +112 -0
- package/packages/lowcode/src/attribute/property.vue +331 -0
- package/packages/lowcode/src/attribute/styles.vue +318 -0
- package/packages/lowcode/src/attribute.vue +135 -0
- package/packages/lowcode/src/canvas.vue +296 -0
- package/packages/lowcode/src/json.vue +32 -0
- package/packages/lowcode/src/lowcode.vue +539 -0
- package/packages/lowcode/src/modules.vue +93 -0
- package/packages/lowcode/src/pages.vue +91 -0
- package/packages/lowcode/src/render.vue +247 -0
- package/packages/lowcode/src/source.vue +32 -0
- package/packages/lowcode/src/toolbar.vue +162 -0
- package/packages/main/src/components/pages.vue +28 -2
- package/packages/main/src/components/set-menus.vue +3 -3
- package/packages/main/src/components/user.vue +6 -1
- package/packages/main/src/early.vue +2 -2
- package/packages/main/src/gzw.vue +55 -61
- package/packages/main/src/minxs.js +113 -36
- package/packages/pagination/src/pager.vue +2 -2
- package/packages/pagination/src/pagination.js +4 -1
- package/packages/qrcode-login/src/qrcode-login.vue +6 -2
- package/packages/select/src/select.vue +28 -6
- package/packages/steps/src/step.vue +7 -5
- package/packages/tabs/src/tab-nav.vue +1 -0
- package/packages/tabs/src/tabs.vue +0 -2
- package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/gulpfile.js +3 -0
- package/packages/theme-chalk/src/account-login.scss +1 -0
- package/packages/theme-chalk/src/base.scss +1 -1
- package/packages/theme-chalk/src/common/var.scss +16 -0
- package/packages/theme-chalk/src/empty.scss +45 -0
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/form.scss +1 -8
- package/packages/theme-chalk/src/icon.scss +30 -1
- package/packages/theme-chalk/src/index.scss +2 -0
- package/packages/theme-chalk/src/input-number.scss +0 -4
- package/packages/theme-chalk/src/input.scss +9 -0
- package/packages/theme-chalk/src/login.scss +32 -29
- package/packages/theme-chalk/src/lowcode.scss +461 -0
- package/packages/theme-chalk/src/main.scss +28 -65
- package/packages/theme-chalk/src/pagination.scss +4 -55
- package/packages/theme-chalk/src/qrcode-login.scss +3 -1
- package/packages/theme-chalk/src/tabs.scss +81 -50
- package/src/config/api.js +13 -0
- package/src/index.js +17 -4
- package/src/utils/ajax.js +61 -65
- package/src/utils/bus.js +2 -2
- package/src/utils/popup/index.js +5 -1
- package/src/utils/util.js +104 -7
- package/lib/index_/345/211/257/346/234/254.js +0 -583
- package/packages/dialog copy/index.js +0 -8
- package/packages/dialog copy/src/dialog.vue +0 -615
- package/src/index_/345/211/257/346/234/254.js +0 -359
- /package/{packages/form/src → src/components}/field-render.vue +0 -0
package/lib/ca-login.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 173);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -91,13 +91,13 @@ module.exports =
|
|
|
91
91
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
92
|
|
|
93
93
|
"use strict";
|
|
94
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
94
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return noop; });
|
|
95
95
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return hasOwn; });
|
|
96
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
96
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toObject; });
|
|
97
97
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getValueByPath; });
|
|
98
98
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return getPropByPath; });
|
|
99
99
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return generateId; });
|
|
100
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
100
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return valueEquals; });
|
|
101
101
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return escapeRegexpString; });
|
|
102
102
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return arrayFindIndex; });
|
|
103
103
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFind; });
|
|
@@ -111,12 +111,12 @@ module.exports =
|
|
|
111
111
|
/* unused harmony export looseEqual */
|
|
112
112
|
/* unused harmony export arrayEquals */
|
|
113
113
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEqual; });
|
|
114
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
114
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return rafThrottle; });
|
|
115
115
|
/* unused harmony export objToArray */
|
|
116
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
116
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return requestAnimationFrame; });
|
|
117
117
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return cancelAnimationFrame; });
|
|
118
118
|
/* unused harmony export debounce */
|
|
119
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
119
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return throttle; });
|
|
120
120
|
/* unused harmony export guid */
|
|
121
121
|
/* unused harmony export uid */
|
|
122
122
|
/* unused harmony export get */
|
|
@@ -150,7 +150,7 @@ module.exports =
|
|
|
150
150
|
/* unused harmony export getValues */
|
|
151
151
|
/* unused harmony export getZoom */
|
|
152
152
|
/* unused harmony export getLength */
|
|
153
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
153
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return timestampUrl; });
|
|
154
154
|
/* unused harmony export hasChars */
|
|
155
155
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return identical; });
|
|
156
156
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return indexOfObj; });
|
|
@@ -159,41 +159,42 @@ module.exports =
|
|
|
159
159
|
/* unused harmony export isFunction */
|
|
160
160
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isObjectEqual; });
|
|
161
161
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return joinUrl; });
|
|
162
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return layoutWaterfall; });
|
|
162
163
|
/* unused harmony export loadJs */
|
|
163
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
164
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return loading; });
|
|
164
165
|
/* unused harmony export lowerCase */
|
|
165
166
|
/* unused harmony export overbrim */
|
|
166
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
167
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return queryParams; });
|
|
167
168
|
/* unused harmony export receiveMessage */
|
|
168
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
169
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return renderIcon; });
|
|
169
170
|
/* unused harmony export replenish */
|
|
170
171
|
/* unused harmony export rmbToCapital */
|
|
171
172
|
/* unused harmony export setScale */
|
|
172
173
|
/* unused harmony export sendMessage */
|
|
173
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
174
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return setFavicon; });
|
|
174
175
|
/* unused harmony export sum */
|
|
175
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
176
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return startWith; });
|
|
176
177
|
/* unused harmony export takeLeft */
|
|
177
178
|
/* unused harmony export takeRight */
|
|
178
179
|
/* unused harmony export trimWhitespace */
|
|
179
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
180
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toFixed; });
|
|
180
181
|
/* unused harmony export toFunction */
|
|
181
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
182
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return updateTheme; });
|
|
182
183
|
/* unused harmony export upperType */
|
|
183
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
184
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
185
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
184
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return urlJoinParams; });
|
|
185
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return uuid; });
|
|
186
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return watermark; });
|
|
186
187
|
/* unused harmony export winTopOpen */
|
|
187
188
|
/* unused harmony export confirm */
|
|
188
189
|
/* unused harmony export success */
|
|
189
190
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return error; });
|
|
190
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
191
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
191
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return warning; });
|
|
192
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
192
193
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
193
|
-
/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
194
|
-
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
195
|
-
/* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
196
|
-
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
194
|
+
/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
|
|
195
|
+
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
|
|
196
|
+
/* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
|
|
197
|
+
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
|
|
197
198
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
198
199
|
|
|
199
200
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
@@ -203,9 +204,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
203
204
|
|
|
204
205
|
|
|
205
206
|
|
|
206
|
-
var _get = __webpack_require__(
|
|
207
|
-
var _set = __webpack_require__(
|
|
208
|
-
var _cloneDeep = __webpack_require__(
|
|
207
|
+
var _get = __webpack_require__(20);
|
|
208
|
+
var _set = __webpack_require__(21);
|
|
209
|
+
var _cloneDeep = __webpack_require__(22);
|
|
209
210
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
210
211
|
|
|
211
212
|
// 导入date中的formatDate函数
|
|
@@ -1404,7 +1405,9 @@ var getObjectType = function getObjectType(obj) {
|
|
|
1404
1405
|
* @return {Object|string} 参数对象或指定参数值
|
|
1405
1406
|
**/
|
|
1406
1407
|
var getParams = function getParams() {
|
|
1407
|
-
var
|
|
1408
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1409
|
+
|
|
1410
|
+
var _ref5 = typeof options === 'string' ? { name: options } : options,
|
|
1408
1411
|
url = _ref5.url,
|
|
1409
1412
|
name = _ref5.name;
|
|
1410
1413
|
|
|
@@ -1816,10 +1819,7 @@ var indexOfObj = function indexOfObj(arry, target, key) {
|
|
|
1816
1819
|
return _i3;
|
|
1817
1820
|
}
|
|
1818
1821
|
} else if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object') {
|
|
1819
|
-
if (currentItem[currentKey] ===
|
|
1820
|
-
throw new Error('\u5C5E\u6027' + currentKey + '\u4E0D\u5B58\u5728');
|
|
1821
|
-
}
|
|
1822
|
-
if (currentItem[currentKey] === target[currentKey]) {
|
|
1822
|
+
if (currentItem[currentKey] !== undefined && currentItem[currentKey] === target[currentKey]) {
|
|
1823
1823
|
return _i3;
|
|
1824
1824
|
}
|
|
1825
1825
|
}
|
|
@@ -2014,7 +2014,105 @@ var joinUrl = function joinUrl(_ref8) {
|
|
|
2014
2014
|
// 如果前缀类型无效,直接返回URL
|
|
2015
2015
|
return url;
|
|
2016
2016
|
};
|
|
2017
|
+
/**
|
|
2018
|
+
* layoutWaterfall
|
|
2019
|
+
* @desc 布布流布局计算
|
|
2020
|
+
* @author huangbo
|
|
2021
|
+
* @date 2022年5月7日
|
|
2022
|
+
* @param {String} url - JS文件地址
|
|
2023
|
+
* @param {Function} [callback] - 回调函数
|
|
2024
|
+
**/
|
|
2025
|
+
var layoutWaterfall = function layoutWaterfall(self, container, pages, columns, gap) {
|
|
2026
|
+
if (!container) return;
|
|
2027
|
+
|
|
2028
|
+
if (pages.length === 0) return;
|
|
2029
|
+
|
|
2030
|
+
// 获取容器实际内容宽度(减去 padding)
|
|
2031
|
+
var computedStyle = getComputedStyle(container);
|
|
2032
|
+
var paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
|
2033
|
+
var paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
|
2034
|
+
var paddingTop = parseFloat(computedStyle.paddingTop) || 0;
|
|
2035
|
+
var containerWidth = container.clientWidth - paddingLeft - paddingRight;
|
|
2036
|
+
if (containerWidth === 0) return;
|
|
2037
|
+
|
|
2038
|
+
// 计算每列宽度
|
|
2039
|
+
var columnWidth = (containerWidth - gap * (columns - 1)) / columns;
|
|
2040
|
+
|
|
2041
|
+
// 初始化每列高度数组(以 paddingTop 为起始偏移)
|
|
2042
|
+
var columnHeights = new Array(columns).fill(paddingTop);
|
|
2043
|
+
|
|
2044
|
+
// 遍历所有元素,分配到高度最小的列
|
|
2045
|
+
pages.forEach(function (item) {
|
|
2046
|
+
// 确保span在有效范围内
|
|
2047
|
+
var span = Math.max(1, Math.min(item.style ? item.style.span || item.span || 1 : item.span || 1, columns));
|
|
2048
|
+
|
|
2049
|
+
// 找到可以容纳当前元素span宽度的最小高度起始列
|
|
2050
|
+
var minHeight = Infinity;
|
|
2051
|
+
var startColumn = 0;
|
|
2052
|
+
|
|
2053
|
+
// 遍历所有可能的起始列,找到可以放置span列元素的位置
|
|
2054
|
+
for (var i = 0; i <= columns - span; i++) {
|
|
2055
|
+
// 计算当前连续span列的最大高度
|
|
2056
|
+
var currentMaxHeight = 0;
|
|
2057
|
+
for (var j = i; j < i + span; j++) {
|
|
2058
|
+
if (columnHeights[j] > currentMaxHeight) {
|
|
2059
|
+
currentMaxHeight = columnHeights[j];
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
// 找到最小的最大高度
|
|
2064
|
+
if (currentMaxHeight < minHeight) {
|
|
2065
|
+
minHeight = currentMaxHeight;
|
|
2066
|
+
startColumn = i;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
// 计算元素宽度和位置
|
|
2071
|
+
var existingWidth = item.style && item.style.width ? parseInt(item.style.width, 10) : null;
|
|
2072
|
+
var hasSpan = item.style && item.style.span || item.span;
|
|
2073
|
+
var calculatedWidth = columnWidth * span + gap * (span - 1);
|
|
2074
|
+
var useCustomWidth = !hasSpan && existingWidth;
|
|
2075
|
+
var elementWidth = useCustomWidth ? existingWidth : calculatedWidth;
|
|
2076
|
+
|
|
2077
|
+
// 根据是否使用自定义宽度计算 left(加上 padding 偏移)
|
|
2078
|
+
var left = void 0;
|
|
2079
|
+
if (useCustomWidth) {
|
|
2080
|
+
// 自定义宽度:在分配的列范围内居中(取整避免亚像素)
|
|
2081
|
+
var columnSpaceWidth = columnWidth * span + gap * (span - 1);
|
|
2082
|
+
left = Math.round(paddingLeft + startColumn * columnWidth + startColumn * gap + (columnSpaceWidth - elementWidth) / 2);
|
|
2083
|
+
} else {
|
|
2084
|
+
// 标准 span 宽度:正常计算位置
|
|
2085
|
+
left = paddingLeft + startColumn * columnWidth + startColumn * gap;
|
|
2086
|
+
}
|
|
2087
|
+
var top = minHeight;
|
|
2017
2088
|
|
|
2089
|
+
// 设置元素样式(使用Vue的$set确保响应式)
|
|
2090
|
+
if (!item.style) {
|
|
2091
|
+
self.$set(item, 'style', {});
|
|
2092
|
+
}
|
|
2093
|
+
var height = item.style.height ? parseInt(item.style.height, 10) : 30;
|
|
2094
|
+
self.$set(item.style, 'position', 'absolute');
|
|
2095
|
+
self.$set(item.style, 'width', elementWidth + 'px');
|
|
2096
|
+
self.$set(item.style, 'height', height + 'px');
|
|
2097
|
+
self.$set(item.style, 'left', left + 'px');
|
|
2098
|
+
self.$set(item.style, 'top', top + 'px');
|
|
2099
|
+
if (!useCustomWidth) {
|
|
2100
|
+
self.$set(item.style, 'span', span);
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
// 更新所有被占用列的高度
|
|
2104
|
+
var newHeight = top + height + gap;
|
|
2105
|
+
for (var _i5 = startColumn; _i5 < startColumn + span; _i5++) {
|
|
2106
|
+
columnHeights[_i5] = newHeight;
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
|
|
2110
|
+
// 设置容器高度
|
|
2111
|
+
var maxHeight = Math.max.apply(Math, columnHeights);
|
|
2112
|
+
container.style.position = 'relative';
|
|
2113
|
+
container.style.height = maxHeight - gap + 'px'; // 减去最后一个间隙
|
|
2114
|
+
return { columnWidth: columnWidth, width: containerWidth };
|
|
2115
|
+
};
|
|
2018
2116
|
/**
|
|
2019
2117
|
* loadJs
|
|
2020
2118
|
* @desc 加载JS文件
|
|
@@ -2045,7 +2143,7 @@ var loadJs = function loadJs(url, callback) {
|
|
|
2045
2143
|
var loading = function loading() {
|
|
2046
2144
|
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '请求中...';
|
|
2047
2145
|
|
|
2048
|
-
var Loading = __webpack_require__(
|
|
2146
|
+
var Loading = __webpack_require__(19).default;
|
|
2049
2147
|
return Loading.service({
|
|
2050
2148
|
text: text,
|
|
2051
2149
|
spinner: 'es-icon-jiazai',
|
|
@@ -2163,8 +2261,8 @@ var renderIcon = function renderIcon(data, node, icons) {
|
|
|
2163
2261
|
var _ref9 = data || {},
|
|
2164
2262
|
attributes = _ref9.attributes;
|
|
2165
2263
|
|
|
2166
|
-
var orgType = attributes.orgType
|
|
2167
|
-
var layerlevel = attributes.layerlevel
|
|
2264
|
+
var orgType = attributes ? attributes.orgType : data.orgType;
|
|
2265
|
+
var layerlevel = attributes ? attributes.layerlevel : data.layerlevel;
|
|
2168
2266
|
if (!orgType) return '';
|
|
2169
2267
|
var key = orgType === 'org' ? layerlevel ? 'bumen' : 'gongsi' : 'bumen';
|
|
2170
2268
|
if (node.level === 1 && (data.subNode || data.isParent || data.hasChildren)) {
|
|
@@ -2243,10 +2341,10 @@ var rmbToCapital = function rmbToCapital(num) {
|
|
|
2243
2341
|
// 处理小数部分
|
|
2244
2342
|
var decimalCapital = '';
|
|
2245
2343
|
if (parseInt(decimalPart, 10) > 0) {
|
|
2246
|
-
for (var
|
|
2247
|
-
var _digit = parseInt(decimalPart[
|
|
2344
|
+
for (var _i6 = 0; _i6 < decimalPart.length; _i6++) {
|
|
2345
|
+
var _digit = parseInt(decimalPart[_i6], 10);
|
|
2248
2346
|
if (_digit > 0) {
|
|
2249
|
-
decimalCapital += chineseNumbers[_digit] + decimalUnits[
|
|
2347
|
+
decimalCapital += chineseNumbers[_digit] + decimalUnits[_i6];
|
|
2250
2348
|
} else if (decimalCapital[decimalCapital.length - 1] !== chineseNumbers[0]) {
|
|
2251
2349
|
decimalCapital += chineseNumbers[_digit];
|
|
2252
2350
|
}
|
|
@@ -2912,2247 +3010,6 @@ var warning = function warning(content, _callback3) {
|
|
|
2912
3010
|
/***/ 1:
|
|
2913
3011
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2914
3012
|
|
|
2915
|
-
"use strict";
|
|
2916
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
|
|
2917
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
|
|
2918
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
|
|
2919
|
-
/* unused harmony export setCookie */
|
|
2920
|
-
/* unused harmony export getCookie */
|
|
2921
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2922
|
-
|
|
2923
|
-
/**
|
|
2924
|
-
* setStorage
|
|
2925
|
-
* @desc:设置本地储存数据
|
|
2926
|
-
* @author huangbo
|
|
2927
|
-
* @date 2022年5月7日
|
|
2928
|
-
* @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
|
|
2929
|
-
* @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
|
|
2930
|
-
**/
|
|
2931
|
-
var setStorage = function setStorage(key, value) {
|
|
2932
|
-
// 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
|
|
2933
|
-
var type = void 0,
|
|
2934
|
-
finalKey = void 0,
|
|
2935
|
-
finalValue = void 0;
|
|
2936
|
-
|
|
2937
|
-
if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
|
|
2938
|
-
// 对象调用方式:setStorage({type, key, value})
|
|
2939
|
-
type = key.type;
|
|
2940
|
-
finalKey = key.key;
|
|
2941
|
-
finalValue = key.value;
|
|
2942
|
-
} else {
|
|
2943
|
-
// 字符串调用方式:setStorage(key, value)
|
|
2944
|
-
type = getStorage('storageType');
|
|
2945
|
-
finalKey = key;
|
|
2946
|
-
finalValue = value;
|
|
2947
|
-
}
|
|
2948
|
-
|
|
2949
|
-
// 使用默认存储类型如果未指定
|
|
2950
|
-
type = type || getStorage('storageType');
|
|
2951
|
-
|
|
2952
|
-
// 获取存储对象
|
|
2953
|
-
var storage = type === 'localStorage' ? localStorage : sessionStorage;
|
|
2954
|
-
|
|
2955
|
-
// 处理不同类型的key
|
|
2956
|
-
if (typeof finalKey === 'string') {
|
|
2957
|
-
// 单个字符串key
|
|
2958
|
-
var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
|
|
2959
|
-
storage.setItem(finalKey, storedValue);
|
|
2960
|
-
if (finalKey === 'token') {
|
|
2961
|
-
setCookie('token', storedValue);
|
|
2962
|
-
}
|
|
2963
|
-
} else if (Array.isArray(finalKey)) {
|
|
2964
|
-
// 数组key,为多个key设置同一个value
|
|
2965
|
-
var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
|
|
2966
|
-
for (var i = 0; i < finalKey.length; i++) {
|
|
2967
|
-
storage.setItem(finalKey[i], _storedValue);
|
|
2968
|
-
if (finalKey[i] === 'token') {
|
|
2969
|
-
setCookie('token', _storedValue);
|
|
2970
|
-
}
|
|
2971
|
-
}
|
|
2972
|
-
} else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
|
|
2973
|
-
// 对象key,对象的属性名称作为key,属性值作为value
|
|
2974
|
-
for (var k in finalKey) {
|
|
2975
|
-
if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
|
|
2976
|
-
var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
|
|
2977
|
-
storage.setItem(k, _storedValue2);
|
|
2978
|
-
if (k === 'token') {
|
|
2979
|
-
setCookie('token', _storedValue2);
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
};
|
|
2985
|
-
|
|
2986
|
-
/**
|
|
2987
|
-
* getStorage
|
|
2988
|
-
* @desc:获取本地储存数据
|
|
2989
|
-
* @author huangbo
|
|
2990
|
-
* @date 2022年5月7日
|
|
2991
|
-
* @param {String} [key] - 获取的名称
|
|
2992
|
-
**/
|
|
2993
|
-
var getStorage = function getStorage(key) {
|
|
2994
|
-
if (key) {
|
|
2995
|
-
var res = sessionStorage.getItem(key) || localStorage.getItem(key);
|
|
2996
|
-
if (!res && key === 'token') {
|
|
2997
|
-
res = getCookie('token');
|
|
2998
|
-
}
|
|
2999
|
-
if (key === 'host' && !res) {
|
|
3000
|
-
res = '';
|
|
3001
|
-
}
|
|
3002
|
-
return res;
|
|
3003
|
-
}
|
|
3004
|
-
var defaults = {};
|
|
3005
|
-
var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
|
|
3006
|
-
var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
|
|
3007
|
-
|
|
3008
|
-
var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
|
|
3009
|
-
if (token) {
|
|
3010
|
-
defaults.Authorization = token;
|
|
3011
|
-
}
|
|
3012
|
-
if (ssId) {
|
|
3013
|
-
defaults.ssId = ssId;
|
|
3014
|
-
}
|
|
3015
|
-
if (deviceUnique) {
|
|
3016
|
-
defaults.deviceUnique = deviceUnique;
|
|
3017
|
-
}
|
|
3018
|
-
return defaults;
|
|
3019
|
-
};
|
|
3020
|
-
|
|
3021
|
-
/**
|
|
3022
|
-
* removeStorage
|
|
3023
|
-
* @desc:删除本地储存数据
|
|
3024
|
-
* @author huangbo
|
|
3025
|
-
* @date 2022年5月7日
|
|
3026
|
-
* @param {String, Array} [key] - 获取的名称
|
|
3027
|
-
**/
|
|
3028
|
-
var removeStorage = function removeStorage(key) {
|
|
3029
|
-
if (Array.isArray(key)) {
|
|
3030
|
-
for (var i = 0; i < key.length; i++) {
|
|
3031
|
-
sessionStorage.removeItem(key[i]);
|
|
3032
|
-
localStorage.removeItem(key[i]);
|
|
3033
|
-
if (key[i] === 'token') {
|
|
3034
|
-
removeCookie('token');
|
|
3035
|
-
}
|
|
3036
|
-
}
|
|
3037
|
-
} else if (key) {
|
|
3038
|
-
sessionStorage.removeItem(key);
|
|
3039
|
-
localStorage.removeItem(key);
|
|
3040
|
-
if (key === 'token') {
|
|
3041
|
-
removeCookie('token');
|
|
3042
|
-
}
|
|
3043
|
-
} else {
|
|
3044
|
-
sessionStorage.clear();
|
|
3045
|
-
localStorage.clear();
|
|
3046
|
-
removeCookie('token');
|
|
3047
|
-
}
|
|
3048
|
-
};
|
|
3049
|
-
|
|
3050
|
-
/**
|
|
3051
|
-
* setCookie
|
|
3052
|
-
* @desc 设置cookie
|
|
3053
|
-
* @author huangbo
|
|
3054
|
-
* @param {string} [name] cookie名称
|
|
3055
|
-
* @param {string} [value] cookie值
|
|
3056
|
-
* @param {boolean} [isSession] 是否是会话cookie
|
|
3057
|
-
**/
|
|
3058
|
-
var setCookie = function setCookie(name, value) {
|
|
3059
|
-
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3060
|
-
var time = arguments[3];
|
|
3061
|
-
|
|
3062
|
-
try {
|
|
3063
|
-
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3064
|
-
];
|
|
3065
|
-
// 会话/持久Cookie设置
|
|
3066
|
-
if (!isSession) {
|
|
3067
|
-
if (/MSIE|Trident/.test(navigator.userAgent)) {
|
|
3068
|
-
// IE使用expires
|
|
3069
|
-
var date = new Date();
|
|
3070
|
-
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3071
|
-
cookieParts.push('expires=' + date.toUTCString());
|
|
3072
|
-
} else {
|
|
3073
|
-
// 其他浏览器使用max-age
|
|
3074
|
-
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
// 内核兼容处理
|
|
3078
|
-
if (/MSIE|Trident/.test(navigator.userAgent)) {
|
|
3079
|
-
// IE特殊处理:添加P3P协议头
|
|
3080
|
-
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3081
|
-
} else {
|
|
3082
|
-
// 现代浏览器设置
|
|
3083
|
-
cookieParts.push('samesite=lax');
|
|
3084
|
-
if (window.location.protocol === 'https:') {
|
|
3085
|
-
cookieParts.push('secure');
|
|
3086
|
-
}
|
|
3087
|
-
}
|
|
3088
|
-
|
|
3089
|
-
// 设置Cookie
|
|
3090
|
-
document.cookie = cookieParts.join('; ');
|
|
3091
|
-
return true;
|
|
3092
|
-
} catch (e) {
|
|
3093
|
-
console.error('Cookie设置失败:', e);
|
|
3094
|
-
return false;
|
|
3095
|
-
}
|
|
3096
|
-
};
|
|
3097
|
-
|
|
3098
|
-
/**
|
|
3099
|
-
* getCookie
|
|
3100
|
-
* @desc 获取cookie中指定名称的值
|
|
3101
|
-
* @author huangbo
|
|
3102
|
-
* @param {string} [name] cookie名称
|
|
3103
|
-
**/
|
|
3104
|
-
var getCookie = function getCookie(name) {
|
|
3105
|
-
var cookies = document.cookie.split(';');
|
|
3106
|
-
for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
3107
|
-
var _ref;
|
|
3108
|
-
|
|
3109
|
-
if (_isArray) {
|
|
3110
|
-
if (_i >= _iterator.length) break;
|
|
3111
|
-
_ref = _iterator[_i++];
|
|
3112
|
-
} else {
|
|
3113
|
-
_i = _iterator.next();
|
|
3114
|
-
if (_i.done) break;
|
|
3115
|
-
_ref = _i.value;
|
|
3116
|
-
}
|
|
3117
|
-
|
|
3118
|
-
var cookie = _ref;
|
|
3119
|
-
|
|
3120
|
-
var _cookie$trim$split = cookie.trim().split('='),
|
|
3121
|
-
cookieName = _cookie$trim$split[0],
|
|
3122
|
-
cookieValue = _cookie$trim$split[1];
|
|
3123
|
-
|
|
3124
|
-
if (decodeURIComponent(cookieName) === name) {
|
|
3125
|
-
return decodeURIComponent(cookieValue);
|
|
3126
|
-
}
|
|
3127
|
-
}
|
|
3128
|
-
return null;
|
|
3129
|
-
};
|
|
3130
|
-
|
|
3131
|
-
/**
|
|
3132
|
-
* removeCookie
|
|
3133
|
-
* @desc:删除cookie
|
|
3134
|
-
* @author huangbo
|
|
3135
|
-
* @date 2022年5月7日
|
|
3136
|
-
* @param {String, Array} [key] - 获取的名称
|
|
3137
|
-
**/
|
|
3138
|
-
var removeCookie = function removeCookie(key) {
|
|
3139
|
-
if (Array.isArray(key)) {
|
|
3140
|
-
for (var i = 0; i < key.length; i++) {
|
|
3141
|
-
document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
|
|
3142
|
-
}
|
|
3143
|
-
} else {
|
|
3144
|
-
document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
|
|
3145
|
-
}
|
|
3146
|
-
};
|
|
3147
|
-
|
|
3148
|
-
/***/ }),
|
|
3149
|
-
|
|
3150
|
-
/***/ 12:
|
|
3151
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3152
|
-
|
|
3153
|
-
"use strict";
|
|
3154
|
-
/* unused harmony export getHue */
|
|
3155
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
|
|
3156
|
-
/* unused harmony export getLightness */
|
|
3157
|
-
/* unused harmony export getSaturation */
|
|
3158
|
-
/* unused harmony export rgbToHsv */
|
|
3159
|
-
/* unused harmony export hsvTorgb */
|
|
3160
|
-
/* unused harmony export mixColor */
|
|
3161
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
|
|
3162
|
-
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
3163
|
-
|
|
3164
|
-
var $hueStep = 2;
|
|
3165
|
-
var $saturationStep1 = 0.16;
|
|
3166
|
-
var $saturationStep2 = 0.05;
|
|
3167
|
-
var $brightnessStep1 = 0.05;
|
|
3168
|
-
var $brightnessStep2 = 0.15;
|
|
3169
|
-
var $lightColorCount = 5;
|
|
3170
|
-
var $darkColorCount = 4;
|
|
3171
|
-
/**
|
|
3172
|
-
* getHue
|
|
3173
|
-
* @desc:转换色相
|
|
3174
|
-
* @author huangbo
|
|
3175
|
-
* @date 2022年5月7日
|
|
3176
|
-
**/
|
|
3177
|
-
var getHue = function getHue($h, $i, $isLight) {
|
|
3178
|
-
var $hue = void 0;
|
|
3179
|
-
if ($h >= 60 && $h <= 240) {
|
|
3180
|
-
$hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
|
|
3181
|
-
} else {
|
|
3182
|
-
$hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
|
|
3183
|
-
}
|
|
3184
|
-
$hue = ($hue + 360) % 360;
|
|
3185
|
-
return Math.round($hue);
|
|
3186
|
-
};
|
|
3187
|
-
|
|
3188
|
-
/**
|
|
3189
|
-
* getColor
|
|
3190
|
-
* @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
|
|
3191
|
-
* @author huangbo
|
|
3192
|
-
* @date 2022年5月7日
|
|
3193
|
-
**/
|
|
3194
|
-
var getColor = function getColor($color, $n) {
|
|
3195
|
-
var $isLight = $n < 7;
|
|
3196
|
-
var $hsv = rgbToHsv($color);
|
|
3197
|
-
// 这里将i转换成以主色为中心,两侧的i值逐渐增大
|
|
3198
|
-
var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
|
|
3199
|
-
var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
|
|
3200
|
-
return color;
|
|
3201
|
-
};
|
|
3202
|
-
|
|
3203
|
-
/**
|
|
3204
|
-
* getLightness
|
|
3205
|
-
* @desc:转换明度
|
|
3206
|
-
* @author huangbo
|
|
3207
|
-
* @date 2022年5月7日
|
|
3208
|
-
* @return {string,array} 元素类名或者id
|
|
3209
|
-
**/
|
|
3210
|
-
var getLightness = function getLightness($v, $i, $isLight) {
|
|
3211
|
-
var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
|
|
3212
|
-
$value = $value < 1 ? $value : 1;
|
|
3213
|
-
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($value, 2);
|
|
3214
|
-
};
|
|
3215
|
-
|
|
3216
|
-
/**
|
|
3217
|
-
* getSaturation
|
|
3218
|
-
* @desc:转换饱和度
|
|
3219
|
-
* @author huangbo
|
|
3220
|
-
* @date 2022年5月7日
|
|
3221
|
-
**/
|
|
3222
|
-
var getSaturation = function getSaturation($s, $i, $isLight) {
|
|
3223
|
-
var $saturation = void 0;
|
|
3224
|
-
if ($isLight) {
|
|
3225
|
-
$saturation = $s - $saturationStep1 * $i;
|
|
3226
|
-
} else if ($i === $darkColorCount) {
|
|
3227
|
-
$saturation = $s + $saturationStep1;
|
|
3228
|
-
} else {
|
|
3229
|
-
$saturation = $s + $saturationStep2 * $i;
|
|
3230
|
-
}
|
|
3231
|
-
$saturation = $saturation < 1 ? $saturation : 1;
|
|
3232
|
-
|
|
3233
|
-
if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
|
|
3234
|
-
$saturation = 0.1;
|
|
3235
|
-
}
|
|
3236
|
-
$saturation = $saturation > 0.06 ? $saturation : 0.06;
|
|
3237
|
-
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($saturation, 2);
|
|
3238
|
-
};
|
|
3239
|
-
|
|
3240
|
-
/**
|
|
3241
|
-
* rgbToHsv
|
|
3242
|
-
* @desc:rgb转化成hsv
|
|
3243
|
-
* @author huangbo
|
|
3244
|
-
* @date 2022年5月7日
|
|
3245
|
-
* @param {string} [$color] - 颜色值
|
|
3246
|
-
**/
|
|
3247
|
-
var rgbToHsv = function rgbToHsv($color) {
|
|
3248
|
-
var rgb = getRgb($color);
|
|
3249
|
-
var $red = rgb[0];
|
|
3250
|
-
var $green = rgb[1];
|
|
3251
|
-
var $blue = rgb[2];
|
|
3252
|
-
var $max = Math.max($red, $green, $blue);
|
|
3253
|
-
var $min = Math.min($red, $green, $blue);
|
|
3254
|
-
var $diff = $max - $min;
|
|
3255
|
-
var $h = 0;
|
|
3256
|
-
if ($max === $min) {
|
|
3257
|
-
$h = 0;
|
|
3258
|
-
} else if ($max === $red) {
|
|
3259
|
-
$h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
|
|
3260
|
-
} else if ($max === $green) {
|
|
3261
|
-
$h = 60 * ($blue - $red) / $diff + 120;
|
|
3262
|
-
} else if ($max === $blue) {
|
|
3263
|
-
$h = 60 * ($red - $green) / $diff + 240;
|
|
3264
|
-
}
|
|
3265
|
-
var $s = $max === 0 ? 0 : $diff / $max;
|
|
3266
|
-
var $v = $max / 255;
|
|
3267
|
-
return [$h, $s, $v];
|
|
3268
|
-
};
|
|
3269
|
-
|
|
3270
|
-
/**
|
|
3271
|
-
* hsvTorgb
|
|
3272
|
-
* @desc:hsv转化成rgb
|
|
3273
|
-
* @author huangbo
|
|
3274
|
-
* @date 2022年5月7日
|
|
3275
|
-
* @param {string} [$color] - 颜色值
|
|
3276
|
-
**/
|
|
3277
|
-
var hsvTorgb = function hsvTorgb($h, $s, $v) {
|
|
3278
|
-
var $th = Math.floor($h / 60);
|
|
3279
|
-
var $t1 = $h / 60 - $th;
|
|
3280
|
-
var $t2 = $v * (1 - $s);
|
|
3281
|
-
var $t3 = $v * (1 - $t1 * $s);
|
|
3282
|
-
var $t4 = $v * (1 - (1 - $t1) * $s);
|
|
3283
|
-
var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
|
|
3284
|
-
var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
|
|
3285
|
-
var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
|
|
3286
|
-
// return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
|
|
3287
|
-
var red = Math.round($r * 255);
|
|
3288
|
-
var green = Math.round($g * 255);
|
|
3289
|
-
var blue = Math.round($b * 255);
|
|
3290
|
-
red = red.toString(16);
|
|
3291
|
-
green = green.toString(16);
|
|
3292
|
-
blue = blue.toString(16);
|
|
3293
|
-
red = red.length === 1 ? '0' + red : red;
|
|
3294
|
-
green = green.length === 1 ? '0' + green : green;
|
|
3295
|
-
blue = blue.length === 1 ? '0' + blue : blue;
|
|
3296
|
-
return '#' + red + green + blue;
|
|
3297
|
-
};
|
|
3298
|
-
|
|
3299
|
-
/**
|
|
3300
|
-
* mixColor
|
|
3301
|
-
* @desc:生成混合色
|
|
3302
|
-
* @author huangbo
|
|
3303
|
-
* @date 2022年5月7日
|
|
3304
|
-
* @param {string} [$color1] - 颜色值
|
|
3305
|
-
* @param {string} [$color2] - 颜色值
|
|
3306
|
-
* @param {string} [$n] - 百分比 0~1
|
|
3307
|
-
**/
|
|
3308
|
-
var mixColor = function mixColor($color1, $color2, $n) {
|
|
3309
|
-
var rgb1 = getRgb($color1);
|
|
3310
|
-
var rgb2 = getRgb($color2);
|
|
3311
|
-
var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
|
|
3312
|
-
var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
|
|
3313
|
-
var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
|
|
3314
|
-
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
3315
|
-
};
|
|
3316
|
-
|
|
3317
|
-
/**
|
|
3318
|
-
* getRgb
|
|
3319
|
-
* @desc:获取颜色值的rgb值
|
|
3320
|
-
* @author huangbo
|
|
3321
|
-
* @date 2022年5月7日
|
|
3322
|
-
* @param {string} [$color] - 颜色值
|
|
3323
|
-
**/
|
|
3324
|
-
var getRgb = function getRgb($color) {
|
|
3325
|
-
var rgb = [];
|
|
3326
|
-
// 16进制颜色值的正则
|
|
3327
|
-
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
3328
|
-
// 把颜色值变成小写
|
|
3329
|
-
$color = $color.toLowerCase();
|
|
3330
|
-
if (reg.test($color)) {
|
|
3331
|
-
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
|
|
3332
|
-
if ($color.length === 4) {
|
|
3333
|
-
var colorNew = '#';
|
|
3334
|
-
for (var i = 1; i < 4; i++) {
|
|
3335
|
-
colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
|
|
3336
|
-
}
|
|
3337
|
-
$color = colorNew;
|
|
3338
|
-
}
|
|
3339
|
-
// 处理六位的颜色值,转为RGB
|
|
3340
|
-
for (var _i = 1; _i < 7; _i += 2) {
|
|
3341
|
-
rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
|
|
3342
|
-
}
|
|
3343
|
-
} else {
|
|
3344
|
-
rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
|
|
3345
|
-
}
|
|
3346
|
-
return rgb;
|
|
3347
|
-
};
|
|
3348
|
-
|
|
3349
|
-
/***/ }),
|
|
3350
|
-
|
|
3351
|
-
/***/ 13:
|
|
3352
|
-
/***/ (function(module, exports) {
|
|
3353
|
-
|
|
3354
|
-
module.exports = require("eoss/lib/loading");
|
|
3355
|
-
|
|
3356
|
-
/***/ }),
|
|
3357
|
-
|
|
3358
|
-
/***/ 15:
|
|
3359
|
-
/***/ (function(module, exports) {
|
|
3360
|
-
|
|
3361
|
-
module.exports = require("lodash/get");
|
|
3362
|
-
|
|
3363
|
-
/***/ }),
|
|
3364
|
-
|
|
3365
|
-
/***/ 16:
|
|
3366
|
-
/***/ (function(module, exports) {
|
|
3367
|
-
|
|
3368
|
-
module.exports = require("lodash/set");
|
|
3369
|
-
|
|
3370
|
-
/***/ }),
|
|
3371
|
-
|
|
3372
|
-
/***/ 169:
|
|
3373
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3374
|
-
|
|
3375
|
-
"use strict";
|
|
3376
|
-
// ESM COMPAT FLAG
|
|
3377
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3378
|
-
|
|
3379
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/ca-login/src/ca-login.vue?vue&type=template&id=53eb9ede&
|
|
3380
|
-
var render = function () {
|
|
3381
|
-
var _vm = this
|
|
3382
|
-
var _h = _vm.$createElement
|
|
3383
|
-
var _c = _vm._self._c || _h
|
|
3384
|
-
return _c(
|
|
3385
|
-
"es-button",
|
|
3386
|
-
_vm._b(
|
|
3387
|
-
{
|
|
3388
|
-
directives: [
|
|
3389
|
-
{
|
|
3390
|
-
name: "show",
|
|
3391
|
-
rawName: "v-show",
|
|
3392
|
-
value: _vm.$slots.default,
|
|
3393
|
-
expression: "$slots.default",
|
|
3394
|
-
},
|
|
3395
|
-
],
|
|
3396
|
-
staticClass: "es-ca-login",
|
|
3397
|
-
on: { click: _vm.getCertificate },
|
|
3398
|
-
},
|
|
3399
|
-
"es-button",
|
|
3400
|
-
_vm.$attrs,
|
|
3401
|
-
false
|
|
3402
|
-
),
|
|
3403
|
-
[_vm._t("default")],
|
|
3404
|
-
2
|
|
3405
|
-
)
|
|
3406
|
-
}
|
|
3407
|
-
var staticRenderFns = []
|
|
3408
|
-
render._withStripped = true
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
// CONCATENATED MODULE: ./packages/ca-login/src/ca-login.vue?vue&type=template&id=53eb9ede&
|
|
3412
|
-
|
|
3413
|
-
// EXTERNAL MODULE: external "eoss/lib/message-box"
|
|
3414
|
-
var message_box_ = __webpack_require__(8);
|
|
3415
|
-
var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
3416
|
-
|
|
3417
|
-
// EXTERNAL MODULE: ./src/utils/util.js
|
|
3418
|
-
var util = __webpack_require__(0);
|
|
3419
|
-
|
|
3420
|
-
// CONCATENATED MODULE: ./packages/ca-login/src/plugin.js
|
|
3421
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
3422
|
-
|
|
3423
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3424
|
-
|
|
3425
|
-
/**
|
|
3426
|
-
* JIT_GW_ExtInterface 模块,提供与客户端交互的功能
|
|
3427
|
-
*/
|
|
3428
|
-
var CA_ExtInterface = function () {
|
|
3429
|
-
function CA_ExtInterface() {
|
|
3430
|
-
_classCallCheck(this, CA_ExtInterface);
|
|
3431
|
-
|
|
3432
|
-
this.currentSessionWSURL = '';
|
|
3433
|
-
this.useActioveX = false;
|
|
3434
|
-
this.options = {};
|
|
3435
|
-
this.webSocket = null;
|
|
3436
|
-
this.init();
|
|
3437
|
-
}
|
|
3438
|
-
|
|
3439
|
-
/**
|
|
3440
|
-
* 简单的 Object.assign 兼容 IE <= 11 的 polyfill
|
|
3441
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
3442
|
-
* @param {Object} target - 目标对象
|
|
3443
|
-
* @param {Object} options - 新的选项对象
|
|
3444
|
-
*/
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
CA_ExtInterface.prototype.extendOptions = function extendOptions(target, options) {
|
|
3448
|
-
if (typeof Object.assign === 'function') {
|
|
3449
|
-
Object.assign(target, options);
|
|
3450
|
-
} else {
|
|
3451
|
-
// 兼容 IE < 11
|
|
3452
|
-
for (var key in options) {
|
|
3453
|
-
target[key] = options[key];
|
|
3454
|
-
}
|
|
3455
|
-
}
|
|
3456
|
-
};
|
|
3457
|
-
|
|
3458
|
-
/**
|
|
3459
|
-
* 检查当前会话的 WebSocket URL
|
|
3460
|
-
*/
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
CA_ExtInterface.prototype.checkSessionWSURL = function checkSessionWSURL() {
|
|
3464
|
-
if (this.currentSessionWSURL === '') {
|
|
3465
|
-
if (document.location.protocol === 'https:') {
|
|
3466
|
-
this.currentSessionWSURL = this.sendAndWaitMessage('https://127.0.0.1:10087/', 'QueryService');
|
|
3467
|
-
} else {
|
|
3468
|
-
this.currentSessionWSURL = this.sendAndWaitMessage('http://127.0.0.1:10086/', 'QueryService');
|
|
3469
|
-
}
|
|
3470
|
-
}
|
|
3471
|
-
};
|
|
3472
|
-
|
|
3473
|
-
/**
|
|
3474
|
-
* 检查是否使用 ActiveX
|
|
3475
|
-
*/
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
CA_ExtInterface.prototype.isUseActioveX = function isUseActioveX() {
|
|
3479
|
-
if (!!window.ActiveXObject || 'ActiveXObject' in window) {
|
|
3480
|
-
this.useActioveX = true;
|
|
3481
|
-
} else {
|
|
3482
|
-
this.useActioveX = false;
|
|
3483
|
-
}
|
|
3484
|
-
};
|
|
3485
|
-
|
|
3486
|
-
/**
|
|
3487
|
-
* 扩展发送消息并等待响应
|
|
3488
|
-
* @param {string} operatorCmd - 操作命令
|
|
3489
|
-
* @param {string} sendMsg - 发送的消息
|
|
3490
|
-
* @returns {string} 响应消息
|
|
3491
|
-
*/
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
CA_ExtInterface.prototype.sendAndWaitMessageEx = function sendAndWaitMessageEx(operatorCmd, sendMsg) {
|
|
3495
|
-
this.checkSessionWSURL();
|
|
3496
|
-
var strSendMsg = operatorCmd + ':' + sendMsg;
|
|
3497
|
-
return this.sendAndWaitMessage(this.currentSessionWSURL, strSendMsg);
|
|
3498
|
-
};
|
|
3499
|
-
|
|
3500
|
-
/**
|
|
3501
|
-
* 发送消息并等待响应
|
|
3502
|
-
* @param {string} wsurl - WebSocket URL
|
|
3503
|
-
* @param {string} sendMsg - 发送的消息
|
|
3504
|
-
* @returns {string} 响应消息
|
|
3505
|
-
*/
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
CA_ExtInterface.prototype.sendAndWaitMessage = function sendAndWaitMessage(wsurl, sendMsg) {
|
|
3509
|
-
var ResultMsg = '{"value":""}';
|
|
3510
|
-
if (ResultMsg === wsurl) {
|
|
3511
|
-
return;
|
|
3512
|
-
}
|
|
3513
|
-
try {
|
|
3514
|
-
var globalXmlHttpRequest = new XMLHttpRequest();
|
|
3515
|
-
globalXmlHttpRequest.open('POST', wsurl, false);
|
|
3516
|
-
globalXmlHttpRequest.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
|
|
3517
|
-
globalXmlHttpRequest.send(sendMsg);
|
|
3518
|
-
ResultMsg = globalXmlHttpRequest.responseText;
|
|
3519
|
-
} catch (e) {
|
|
3520
|
-
this.currentSessionWSURL = '';
|
|
3521
|
-
if (this.options.onError) {
|
|
3522
|
-
this.options.onError.call(undefined, e);
|
|
3523
|
-
}
|
|
3524
|
-
}
|
|
3525
|
-
return ResultMsg;
|
|
3526
|
-
};
|
|
3527
|
-
|
|
3528
|
-
/**
|
|
3529
|
-
* 配置选项
|
|
3530
|
-
* @param {Object} extendOption - 扩展选项
|
|
3531
|
-
*/
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
CA_ExtInterface.prototype.config = function config(extendOption) {
|
|
3535
|
-
if (extendOption && (typeof extendOption === 'undefined' ? 'undefined' : _typeof(extendOption)) === 'object') {
|
|
3536
|
-
this.extendOptions(this.options, extendOption);
|
|
3537
|
-
}
|
|
3538
|
-
};
|
|
3539
|
-
|
|
3540
|
-
/**
|
|
3541
|
-
* 初始化
|
|
3542
|
-
*/
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
CA_ExtInterface.prototype.init = function init() {
|
|
3546
|
-
this.isUseActioveX();
|
|
3547
|
-
};
|
|
3548
|
-
|
|
3549
|
-
/**
|
|
3550
|
-
* 返回客户端的版本
|
|
3551
|
-
* @returns {string} 客户端版本
|
|
3552
|
-
*/
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
CA_ExtInterface.prototype.getClientVersion = function getClientVersion() {
|
|
3556
|
-
if (this.useActioveX) {
|
|
3557
|
-
return window.PNXClient.GetClientVersion();
|
|
3558
|
-
} else {
|
|
3559
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetClientVersion', ''));
|
|
3560
|
-
return result.value;
|
|
3561
|
-
}
|
|
3562
|
-
};
|
|
3563
|
-
|
|
3564
|
-
/**
|
|
3565
|
-
* 下载客户端程序并安装
|
|
3566
|
-
* @param {string} bstrURL - 下载地址
|
|
3567
|
-
* @param {string} bstrHashValue - 哈希值
|
|
3568
|
-
* @param {boolean} bSync - 是否同步安装
|
|
3569
|
-
* @param {boolean} bOnlySSO - 是否仅安装 SSO
|
|
3570
|
-
* @returns {number} 安装结果
|
|
3571
|
-
*/
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
CA_ExtInterface.prototype.setupClient = function setupClient(bstrURL, bstrHashValue, bSync, bOnlySSO) {
|
|
3575
|
-
if (this.useActioveX) {
|
|
3576
|
-
return window.PNXClient.SetupClient(bstrURL, bstrHashValue, bSync, bOnlySSO);
|
|
3577
|
-
} else {
|
|
3578
|
-
var jsonstr = { 'strURL': bstrURL, 'strHashValue': bstrHashValue, 'bSync': bSync, 'bOnlySSO': bOnlySSO };
|
|
3579
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('SetupClient', JSON.stringify(jsonstr)));
|
|
3580
|
-
return result.value;
|
|
3581
|
-
}
|
|
3582
|
-
};
|
|
3583
|
-
|
|
3584
|
-
/**
|
|
3585
|
-
* 获取硬件指纹信息
|
|
3586
|
-
* @param {number} dwSign - 签名
|
|
3587
|
-
* @param {string} strGateWayIP - 网关 IP
|
|
3588
|
-
* @returns {string} 硬件指纹信息
|
|
3589
|
-
*/
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
CA_ExtInterface.prototype.getFinger = function getFinger(dwSign, strGateWayIP) {
|
|
3593
|
-
if (this.useActioveX) {
|
|
3594
|
-
return window.PNXClient.GetFinger(dwSign, strGateWayIP);
|
|
3595
|
-
} else {
|
|
3596
|
-
var jsonstr = { 'dwSign': dwSign, 'strGateWayIP': strGateWayIP };
|
|
3597
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetFinger', JSON.stringify(jsonstr)));
|
|
3598
|
-
return result.value;
|
|
3599
|
-
}
|
|
3600
|
-
};
|
|
3601
|
-
|
|
3602
|
-
/**
|
|
3603
|
-
* 设置转发策略和代填策略
|
|
3604
|
-
* @param {string} strProxyPolicy - 转发策略
|
|
3605
|
-
* @param {string} strSSOPolicy - 代填策略
|
|
3606
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
3607
|
-
* @returns {number} 设置结果
|
|
3608
|
-
*/
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
CA_ExtInterface.prototype.setPolicy = function setPolicy(strProxyPolicy, strSSOPolicy, strGatewayAddress) {
|
|
3612
|
-
if (this.useActioveX) {
|
|
3613
|
-
return window.PNXClient.SetPolicy(strProxyPolicy, strSSOPolicy, strGatewayAddress);
|
|
3614
|
-
} else {
|
|
3615
|
-
var jsonstr = { 'strProxyPolicy': strProxyPolicy, 'strSSOPolicy': strSSOPolicy, 'strGatewayAddress': strGatewayAddress };
|
|
3616
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('SetPolicy', JSON.stringify(jsonstr)));
|
|
3617
|
-
return result.value;
|
|
3618
|
-
}
|
|
3619
|
-
};
|
|
3620
|
-
|
|
3621
|
-
/**
|
|
3622
|
-
* 启动认证信息模块
|
|
3623
|
-
* @param {string} strFileName - 文件名
|
|
3624
|
-
* @param {string} strXmlData - XML 数据
|
|
3625
|
-
* @returns {string} 认证信息
|
|
3626
|
-
*/
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
CA_ExtInterface.prototype.getAuthToken = function getAuthToken(strFileName, strXmlData) {
|
|
3630
|
-
if (this.useActioveX) {
|
|
3631
|
-
return window.PNXClient.GetAuthToken(strFileName, strXmlData);
|
|
3632
|
-
} else {
|
|
3633
|
-
var jsonstr = { 'strFileName': strFileName, 'strXmlData': strXmlData };
|
|
3634
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetAuthToken', JSON.stringify(jsonstr)));
|
|
3635
|
-
return result.value;
|
|
3636
|
-
}
|
|
3637
|
-
};
|
|
3638
|
-
|
|
3639
|
-
/**
|
|
3640
|
-
* 打开 BS 应用
|
|
3641
|
-
* @param {string} strUrl - 应用 URL
|
|
3642
|
-
* @returns {number} 打开结果
|
|
3643
|
-
*/
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
CA_ExtInterface.prototype.navigateURL = function navigateURL(strUrl) {
|
|
3647
|
-
if (this.useActioveX) {
|
|
3648
|
-
return window.PNXClient.NavigateURL(strUrl);
|
|
3649
|
-
} else {
|
|
3650
|
-
var jsonstr = { 'strUrl': strUrl };
|
|
3651
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('NavigateURL', JSON.stringify(jsonstr)));
|
|
3652
|
-
return result.value;
|
|
3653
|
-
}
|
|
3654
|
-
};
|
|
3655
|
-
|
|
3656
|
-
/**
|
|
3657
|
-
* 打开 CS 应用
|
|
3658
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
3659
|
-
* @param {string} strAppFlag - 应用标识
|
|
3660
|
-
* @param {string} strAppPath - 应用路径
|
|
3661
|
-
* @returns {number} 打开结果
|
|
3662
|
-
*/
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
CA_ExtInterface.prototype.executeCS = function executeCS(strGatewayAddress, strAppFlag, strAppPath) {
|
|
3666
|
-
if (this.useActioveX) {
|
|
3667
|
-
return window.PNXClient.ExecuteCS(strGatewayAddress, strAppFlag, strAppPath);
|
|
3668
|
-
} else {
|
|
3669
|
-
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'strAppFlag': strAppFlag, 'strAppPath': strAppPath };
|
|
3670
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('ExecuteCS', JSON.stringify(jsonstr)));
|
|
3671
|
-
return result.value;
|
|
3672
|
-
}
|
|
3673
|
-
};
|
|
3674
|
-
|
|
3675
|
-
/**
|
|
3676
|
-
* 设置自动更新策略
|
|
3677
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
3678
|
-
* @param {number} nGatewayPort - 网关端口
|
|
3679
|
-
* @param {string} strUserToken - 用户令牌
|
|
3680
|
-
* @param {number} updatedelay - 更新延迟
|
|
3681
|
-
* @returns {number} 设置结果
|
|
3682
|
-
*/
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
CA_ExtInterface.prototype.setUpdatePolicy = function setUpdatePolicy(strGatewayAddress, nGatewayPort, strUserToken, updatedelay) {
|
|
3686
|
-
if (this.useActioveX) {
|
|
3687
|
-
return window.PNXClient.SetUpdatePolicy(strGatewayAddress, nGatewayPort, strUserToken, updatedelay);
|
|
3688
|
-
} else {
|
|
3689
|
-
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'nGatewayPort': nGatewayPort, 'strUserToken': strUserToken, 'ulUpdateDelay': updatedelay };
|
|
3690
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('SetUpdatePolicy', JSON.stringify(jsonstr)));
|
|
3691
|
-
return result.value;
|
|
3692
|
-
}
|
|
3693
|
-
};
|
|
3694
|
-
|
|
3695
|
-
/**
|
|
3696
|
-
* 获取客户端 IP
|
|
3697
|
-
* @param {string} strGatewayIP - 网关 IP
|
|
3698
|
-
* @returns {string} 客户端 IP
|
|
3699
|
-
*/
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
CA_ExtInterface.prototype.getClientIP = function getClientIP(strGatewayIP) {
|
|
3703
|
-
if (this.useActioveX) {
|
|
3704
|
-
return window.PNXClient.GetClientIP(strGatewayIP);
|
|
3705
|
-
} else {
|
|
3706
|
-
var jsonstr = { 'strGatewayIP': strGatewayIP };
|
|
3707
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetClientIP', JSON.stringify(jsonstr)));
|
|
3708
|
-
return result.value;
|
|
3709
|
-
}
|
|
3710
|
-
};
|
|
3711
|
-
|
|
3712
|
-
/**
|
|
3713
|
-
* 登出网关
|
|
3714
|
-
* @param {string} strServerIP - 服务器 IP
|
|
3715
|
-
* @returns {number} 登出结果
|
|
3716
|
-
*/
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
CA_ExtInterface.prototype.gwLogout = function gwLogout(strServerIP) {
|
|
3720
|
-
if (this.useActioveX) {
|
|
3721
|
-
return window.PNXClient.GWLogout(strServerIP);
|
|
3722
|
-
} else {
|
|
3723
|
-
var jsonstr = { 'strServerIP': strServerIP };
|
|
3724
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GWLogout', JSON.stringify(jsonstr)));
|
|
3725
|
-
return result.value;
|
|
3726
|
-
}
|
|
3727
|
-
};
|
|
3728
|
-
|
|
3729
|
-
/**
|
|
3730
|
-
* 运行安装包
|
|
3731
|
-
* @param {number} lRunType - 运行类型
|
|
3732
|
-
* @param {boolean} bIsOnlySSO - 是否仅安装 SSO
|
|
3733
|
-
* @returns {number} 运行结果
|
|
3734
|
-
*/
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
CA_ExtInterface.prototype.runSetup = function runSetup(lRunType, bIsOnlySSO) {
|
|
3738
|
-
if (this.useActioveX) {
|
|
3739
|
-
return window.PNXClient.RunSetup(lRunType, bIsOnlySSO);
|
|
3740
|
-
} else {
|
|
3741
|
-
var jsonstr = { 'lRunType': lRunType, 'bIsOnlySSO': bIsOnlySSO };
|
|
3742
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('RunSetup', JSON.stringify(jsonstr)));
|
|
3743
|
-
return result.value;
|
|
3744
|
-
}
|
|
3745
|
-
};
|
|
3746
|
-
|
|
3747
|
-
/**
|
|
3748
|
-
* 获取下载进度
|
|
3749
|
-
* @returns {number} 下载进度
|
|
3750
|
-
*/
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
CA_ExtInterface.prototype.getDownloadProgress = function getDownloadProgress() {
|
|
3754
|
-
if (this.useActioveX) {
|
|
3755
|
-
return window.PNXClient.GetDownloadProgress();
|
|
3756
|
-
} else {
|
|
3757
|
-
var jsonstr = '';
|
|
3758
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetDownloadProgress', jsonstr));
|
|
3759
|
-
return result.value;
|
|
3760
|
-
}
|
|
3761
|
-
};
|
|
3762
|
-
|
|
3763
|
-
/**
|
|
3764
|
-
* 是否安装完成
|
|
3765
|
-
* @returns {boolean} 安装完成状态
|
|
3766
|
-
*/
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
CA_ExtInterface.prototype.isInstallComplete = function isInstallComplete() {
|
|
3770
|
-
if (this.useActioveX) {
|
|
3771
|
-
return window.PNXClient.IsInstallComplete();
|
|
3772
|
-
} else {
|
|
3773
|
-
var jsonstr = '';
|
|
3774
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('IsInstallComplete', jsonstr));
|
|
3775
|
-
return result.value;
|
|
3776
|
-
}
|
|
3777
|
-
};
|
|
3778
|
-
|
|
3779
|
-
/**
|
|
3780
|
-
* 初始化签包对象
|
|
3781
|
-
* @param {string} strAlgType - 算法类型
|
|
3782
|
-
* @param {string} strAuxParam - 辅助参数
|
|
3783
|
-
* @returns {number} 初始化结果
|
|
3784
|
-
*/
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
CA_ExtInterface.prototype.initialize = function initialize(strAlgType, strAuxParam) {
|
|
3788
|
-
if (this.useActioveX) {
|
|
3789
|
-
return window.PNXClient.Initialize(strAlgType, strAuxParam);
|
|
3790
|
-
} else {
|
|
3791
|
-
var jsonstr = { 'strAlgType': strAlgType, 'strAuxParam': strAuxParam };
|
|
3792
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('Initialize', JSON.stringify(jsonstr)));
|
|
3793
|
-
return result.value;
|
|
3794
|
-
}
|
|
3795
|
-
};
|
|
3796
|
-
|
|
3797
|
-
/**
|
|
3798
|
-
* 设置摘要算法
|
|
3799
|
-
* @param {string} strDigestAlg - 摘要算法
|
|
3800
|
-
* @returns {number} 设置结果
|
|
3801
|
-
*/
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
CA_ExtInterface.prototype.setDigestAlg = function setDigestAlg(strDigestAlg) {
|
|
3805
|
-
if (this.useActioveX) {
|
|
3806
|
-
return window.PNXClient.SetDigestAlg(strDigestAlg);
|
|
3807
|
-
} else {
|
|
3808
|
-
var jsonstr = { 'strDigestAlg': strDigestAlg };
|
|
3809
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('SetDigestAlg', JSON.stringify(jsonstr)));
|
|
3810
|
-
return result.value;
|
|
3811
|
-
}
|
|
3812
|
-
};
|
|
3813
|
-
|
|
3814
|
-
/**
|
|
3815
|
-
* 设置单证书是否弹出对话框
|
|
3816
|
-
* @param {number} isChoose - 是否弹出对话框
|
|
3817
|
-
* @returns {number} 设置结果
|
|
3818
|
-
*/
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
CA_ExtInterface.prototype.setChooseSingleCert = function setChooseSingleCert(isChoose) {
|
|
3822
|
-
if (this.useActioveX) {
|
|
3823
|
-
return window.PNXClient.SetChooseSingleCert(isChoose);
|
|
3824
|
-
} else {
|
|
3825
|
-
var jsonstr = { 'isChoose': isChoose };
|
|
3826
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('SetChooseSingleCert', JSON.stringify(jsonstr)));
|
|
3827
|
-
return result.value;
|
|
3828
|
-
}
|
|
3829
|
-
};
|
|
3830
|
-
|
|
3831
|
-
/**
|
|
3832
|
-
* 添加证书过滤条件
|
|
3833
|
-
* @param {number} ulType - 过滤类型
|
|
3834
|
-
* @param {string} strValue - 过滤值
|
|
3835
|
-
* @returns {number} 添加结果
|
|
3836
|
-
*/
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
CA_ExtInterface.prototype.addFilter = function addFilter(ulType, strValue) {
|
|
3840
|
-
if (this.useActioveX) {
|
|
3841
|
-
return window.PNXClient.AddFilter(ulType, strValue);
|
|
3842
|
-
} else {
|
|
3843
|
-
var jsonstr = { 'ulType': ulType, 'strValue': strValue };
|
|
3844
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('AddFilter', JSON.stringify(jsonstr)));
|
|
3845
|
-
return result.value;
|
|
3846
|
-
}
|
|
3847
|
-
};
|
|
3848
|
-
|
|
3849
|
-
/**
|
|
3850
|
-
* 清除所有过滤条件
|
|
3851
|
-
* @returns {number} 清除结果
|
|
3852
|
-
*/
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
CA_ExtInterface.prototype.clearFilter = function clearFilter() {
|
|
3856
|
-
if (this.useActioveX) {
|
|
3857
|
-
return window.PNXClient.ClearFilter();
|
|
3858
|
-
} else {
|
|
3859
|
-
var jsonstr = '';
|
|
3860
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('ClearFilter', jsonstr));
|
|
3861
|
-
return result.value;
|
|
3862
|
-
}
|
|
3863
|
-
};
|
|
3864
|
-
|
|
3865
|
-
/**
|
|
3866
|
-
* P1 签名
|
|
3867
|
-
* @param {string} strValueBase64 - 待签名的 Base64 字符串
|
|
3868
|
-
* @returns {string} 签名结果
|
|
3869
|
-
*/
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
CA_ExtInterface.prototype.p1Sign = function p1Sign(strValueBase64) {
|
|
3873
|
-
if (this.useActioveX) {
|
|
3874
|
-
return window.PNXClient.P1Sign(strValueBase64);
|
|
3875
|
-
} else {
|
|
3876
|
-
var jsonstr = { 'strValueBase64': strValueBase64 };
|
|
3877
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('P1Sign', JSON.stringify(jsonstr)));
|
|
3878
|
-
return result.value;
|
|
3879
|
-
}
|
|
3880
|
-
};
|
|
3881
|
-
|
|
3882
|
-
/**
|
|
3883
|
-
* P1 签名字符串
|
|
3884
|
-
* @param {string} strValue - 待签名的字符串
|
|
3885
|
-
* @returns {string} 签名结果
|
|
3886
|
-
*/
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
CA_ExtInterface.prototype.p1SignString = function p1SignString(strValue) {
|
|
3890
|
-
if (this.useActioveX) {
|
|
3891
|
-
return window.PNXClient.P1SignString(strValue);
|
|
3892
|
-
} else {
|
|
3893
|
-
var jsonstr = { 'strValue': strValue };
|
|
3894
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('P1SignString', JSON.stringify(jsonstr)));
|
|
3895
|
-
return result.value;
|
|
3896
|
-
}
|
|
3897
|
-
};
|
|
3898
|
-
|
|
3899
|
-
/**
|
|
3900
|
-
* P7 签名
|
|
3901
|
-
* @param {string} strValueBase64 - 待签名的 Base64 字符串
|
|
3902
|
-
* @param {boolean} isDetach - 是否分离签名
|
|
3903
|
-
* @param {boolean} isIncludeCert - 是否包含证书
|
|
3904
|
-
* @returns {string} 签名结果
|
|
3905
|
-
*/
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
CA_ExtInterface.prototype.p7Sign = function p7Sign(strValueBase64, isDetach, isIncludeCert) {
|
|
3909
|
-
if (this.useActioveX) {
|
|
3910
|
-
return window.PNXClient.P7Sign(strValueBase64, isDetach, isIncludeCert);
|
|
3911
|
-
} else {
|
|
3912
|
-
var jsonstr = { 'strValueBase64': strValueBase64, 'isDetach': isDetach, 'isIncludeCert': isIncludeCert };
|
|
3913
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('P7Sign', JSON.stringify(jsonstr)));
|
|
3914
|
-
return result.value;
|
|
3915
|
-
}
|
|
3916
|
-
};
|
|
3917
|
-
|
|
3918
|
-
/**
|
|
3919
|
-
* P7 签名字符串
|
|
3920
|
-
* @param {string} strValue - 待签名的字符串
|
|
3921
|
-
* @param {boolean} isDetach - 是否分离签名
|
|
3922
|
-
* @param {boolean} isIncludeCert - 是否包含证书
|
|
3923
|
-
* @returns {string} 签名结果
|
|
3924
|
-
*/
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
CA_ExtInterface.prototype.p7SignString = function p7SignString(strValue, isDetach, isIncludeCert) {
|
|
3928
|
-
if (this.useActioveX) {
|
|
3929
|
-
return window.PNXClient.P7SignString(strValue, isDetach, isIncludeCert);
|
|
3930
|
-
} else {
|
|
3931
|
-
var jsonstr = { 'strValue': strValue, 'isDetach': isDetach, 'isIncludeCert': isIncludeCert };
|
|
3932
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('P7SignString', JSON.stringify(jsonstr)));
|
|
3933
|
-
return result.value;
|
|
3934
|
-
}
|
|
3935
|
-
};
|
|
3936
|
-
|
|
3937
|
-
/**
|
|
3938
|
-
* 释放签名对象
|
|
3939
|
-
* @returns {number} 释放结果
|
|
3940
|
-
*/
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
CA_ExtInterface.prototype.finalize = function finalize() {
|
|
3944
|
-
if (this.useActioveX) {
|
|
3945
|
-
return window.PNXClient.Finalize();
|
|
3946
|
-
} else {
|
|
3947
|
-
var jsonstr = '';
|
|
3948
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('Finalize', jsonstr));
|
|
3949
|
-
return result.value;
|
|
3950
|
-
}
|
|
3951
|
-
};
|
|
3952
|
-
|
|
3953
|
-
/**
|
|
3954
|
-
* 获取签名版本
|
|
3955
|
-
* @returns {string} 签名版本
|
|
3956
|
-
*/
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
CA_ExtInterface.prototype.getSignVersion = function getSignVersion() {
|
|
3960
|
-
if (this.useActioveX) {
|
|
3961
|
-
return window.PNXClient.GetSignVersion();
|
|
3962
|
-
} else {
|
|
3963
|
-
var jsonstr = '';
|
|
3964
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignVersion', jsonstr));
|
|
3965
|
-
return result.value;
|
|
3966
|
-
}
|
|
3967
|
-
};
|
|
3968
|
-
|
|
3969
|
-
/**
|
|
3970
|
-
* 获取签名证书
|
|
3971
|
-
* @returns {string} 签名证书
|
|
3972
|
-
*/
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
CA_ExtInterface.prototype.getSignCert = function getSignCert() {
|
|
3976
|
-
if (this.useActioveX) {
|
|
3977
|
-
return window.PNXClient.GetSignCert();
|
|
3978
|
-
} else {
|
|
3979
|
-
var jsonstr = '';
|
|
3980
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignCert', jsonstr));
|
|
3981
|
-
return result.value;
|
|
3982
|
-
}
|
|
3983
|
-
};
|
|
3984
|
-
|
|
3985
|
-
/**
|
|
3986
|
-
* 获取错误码
|
|
3987
|
-
* @returns {number} 错误码
|
|
3988
|
-
*/
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
CA_ExtInterface.prototype.getLastError = function getLastError() {
|
|
3992
|
-
if (this.useActioveX) {
|
|
3993
|
-
return window.PNXClient.GetLastError();
|
|
3994
|
-
} else {
|
|
3995
|
-
var jsonstr = '';
|
|
3996
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetLastError', jsonstr));
|
|
3997
|
-
return result.value;
|
|
3998
|
-
}
|
|
3999
|
-
};
|
|
4000
|
-
|
|
4001
|
-
/**
|
|
4002
|
-
* 获取错误信息
|
|
4003
|
-
* @returns {string} 错误信息
|
|
4004
|
-
*/
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
CA_ExtInterface.prototype.getLastErrorMessage = function getLastErrorMessage() {
|
|
4008
|
-
if (this.useActioveX) {
|
|
4009
|
-
return window.PNXClient.GetLastErrorMessage();
|
|
4010
|
-
} else {
|
|
4011
|
-
var jsonstr = '';
|
|
4012
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetLastErrorMessage', jsonstr));
|
|
4013
|
-
return result.value;
|
|
4014
|
-
}
|
|
4015
|
-
};
|
|
4016
|
-
|
|
4017
|
-
/**
|
|
4018
|
-
* 销毁认证对象
|
|
4019
|
-
* @returns {number} 销毁结果
|
|
4020
|
-
*/
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
CA_ExtInterface.prototype.destoryAuth = function destoryAuth() {
|
|
4024
|
-
if (this.useActioveX) {
|
|
4025
|
-
return window.PNXClient.DestoryAuth();
|
|
4026
|
-
} else {
|
|
4027
|
-
var jsonstr = '';
|
|
4028
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('DestoryAuth', jsonstr));
|
|
4029
|
-
return result.value;
|
|
4030
|
-
}
|
|
4031
|
-
};
|
|
4032
|
-
|
|
4033
|
-
/**
|
|
4034
|
-
* 获取证书类型
|
|
4035
|
-
* @returns {string} 证书类型
|
|
4036
|
-
*/
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
CA_ExtInterface.prototype.getSignCertType = function getSignCertType() {
|
|
4040
|
-
if (this.useActioveX) {
|
|
4041
|
-
return window.PNXClient.GetSignCertType();
|
|
4042
|
-
} else {
|
|
4043
|
-
var jsonstr = '';
|
|
4044
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignCertType', jsonstr));
|
|
4045
|
-
return result.value;
|
|
4046
|
-
}
|
|
4047
|
-
};
|
|
4048
|
-
|
|
4049
|
-
/**
|
|
4050
|
-
* 获取签名摘要算法
|
|
4051
|
-
* @returns {string} 签名摘要算法
|
|
4052
|
-
*/
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
CA_ExtInterface.prototype.getSignHash = function getSignHash() {
|
|
4056
|
-
if (this.useActioveX) {
|
|
4057
|
-
return window.PNXClient.GetSignHash();
|
|
4058
|
-
} else {
|
|
4059
|
-
var jsonstr = '';
|
|
4060
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignHash', jsonstr));
|
|
4061
|
-
return result.value;
|
|
4062
|
-
}
|
|
4063
|
-
};
|
|
4064
|
-
|
|
4065
|
-
/**
|
|
4066
|
-
* 使能调用序列
|
|
4067
|
-
* @param {boolean} bCallQueueEnable - 是否使能调用序列
|
|
4068
|
-
* @param {boolean} bHeadInfoEnable - 是否使能头部信息
|
|
4069
|
-
* @returns {number} 使能结果
|
|
4070
|
-
*/
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
CA_ExtInterface.prototype.callQueueEnable = function callQueueEnable(bCallQueueEnable, bHeadInfoEnable) {
|
|
4074
|
-
if (this.useActioveX) {
|
|
4075
|
-
return window.PNXClient.CallQueueEnable(bCallQueueEnable, bHeadInfoEnable);
|
|
4076
|
-
} else {
|
|
4077
|
-
var jsonstr = { 'bCallQueueEnable': bCallQueueEnable, 'bHeadInfoEnable': bHeadInfoEnable };
|
|
4078
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('CallQueueEnable', JSON.stringify(jsonstr)));
|
|
4079
|
-
return result.value;
|
|
4080
|
-
}
|
|
4081
|
-
};
|
|
4082
|
-
|
|
4083
|
-
/**
|
|
4084
|
-
* 清空调用序列结果
|
|
4085
|
-
* @returns {number} 清空调用序列结果
|
|
4086
|
-
*/
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
CA_ExtInterface.prototype.callQueueClear = function callQueueClear() {
|
|
4090
|
-
if (this.useActioveX) {
|
|
4091
|
-
return window.PNXClient.CallQueueClear();
|
|
4092
|
-
} else {
|
|
4093
|
-
var jsonstr = '';
|
|
4094
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('CallQueueClear', jsonstr));
|
|
4095
|
-
return result.value;
|
|
4096
|
-
}
|
|
4097
|
-
};
|
|
4098
|
-
|
|
4099
|
-
/**
|
|
4100
|
-
* 获取调用序列结果
|
|
4101
|
-
* @returns {string} 调用序列结果
|
|
4102
|
-
*/
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
CA_ExtInterface.prototype.callQueueGet = function callQueueGet() {
|
|
4106
|
-
if (this.useActioveX) {
|
|
4107
|
-
return window.PNXClient.CallQueueGet();
|
|
4108
|
-
} else {
|
|
4109
|
-
var jsonstr = '';
|
|
4110
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('CallQueueGet', jsonstr));
|
|
4111
|
-
return result.value;
|
|
4112
|
-
}
|
|
4113
|
-
};
|
|
4114
|
-
|
|
4115
|
-
/**
|
|
4116
|
-
* 客户端安全策略检查
|
|
4117
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
4118
|
-
* @param {number} usGatewayPort - 网关端口
|
|
4119
|
-
* @param {string} strSecurityPolicys - 安全策略
|
|
4120
|
-
* @returns {boolean} 检查结果
|
|
4121
|
-
*/
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
CA_ExtInterface.prototype.doClientSecurityCheck = function doClientSecurityCheck(strGatewayAddress, usGatewayPort, strSecurityPolicys) {
|
|
4125
|
-
if (this.useActioveX) {
|
|
4126
|
-
return window.PNXClient.DoClientSecurityCheck(strGatewayAddress, usGatewayPort, strSecurityPolicys);
|
|
4127
|
-
} else {
|
|
4128
|
-
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'usGatewayPort': usGatewayPort, 'strSecurityPolicys': strSecurityPolicys };
|
|
4129
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('DoClientSecurityCheck', JSON.stringify(jsonstr)));
|
|
4130
|
-
return result.value;
|
|
4131
|
-
}
|
|
4132
|
-
};
|
|
4133
|
-
|
|
4134
|
-
/**
|
|
4135
|
-
* 获取通讯协议版本
|
|
4136
|
-
* @returns {string} 通讯协议版本
|
|
4137
|
-
*/
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
CA_ExtInterface.prototype.getProtocolVersion = function getProtocolVersion() {
|
|
4141
|
-
if (this.useActioveX) {
|
|
4142
|
-
return window.PNXClient.GetProtocolVersion();
|
|
4143
|
-
} else {
|
|
4144
|
-
var jsonstr = '';
|
|
4145
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetProtocolVersion', jsonstr));
|
|
4146
|
-
return result.value;
|
|
4147
|
-
}
|
|
4148
|
-
};
|
|
4149
|
-
|
|
4150
|
-
/**
|
|
4151
|
-
* 修改 Key 的 Pin 码
|
|
4152
|
-
* @param {string} strCertSn - 证书序列号
|
|
4153
|
-
* @param {number} lPinCodeType - Pin 码类型
|
|
4154
|
-
* @param {string} strCurPinCode - 当前 Pin 码
|
|
4155
|
-
* @param {string} strNewPinCode - 新 Pin 码
|
|
4156
|
-
* @returns {number} 修改结果
|
|
4157
|
-
*/
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
CA_ExtInterface.prototype.changePinCode = function changePinCode(strCertSn, lPinCodeType, strCurPinCode, strNewPinCode) {
|
|
4161
|
-
if (this.useActioveX) {
|
|
4162
|
-
return window.PNXClient.ChangePinCode(strCertSn, lPinCodeType, strCurPinCode, strNewPinCode);
|
|
4163
|
-
} else {
|
|
4164
|
-
var jsonstr = { 'strCertSn': strCertSn, 'lPinCodeType': lPinCodeType, 'strCurPinCode': strCurPinCode, 'strNewPinCode': strNewPinCode };
|
|
4165
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('ChangePinCode', JSON.stringify(jsonstr)));
|
|
4166
|
-
return result.value;
|
|
4167
|
-
}
|
|
4168
|
-
};
|
|
4169
|
-
|
|
4170
|
-
/**
|
|
4171
|
-
* 等待策略设置完毕
|
|
4172
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
4173
|
-
* @returns {number} 等待结果
|
|
4174
|
-
*/
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
CA_ExtInterface.prototype.waitSetPolicyFinish = function waitSetPolicyFinish(strGatewayAddress) {
|
|
4178
|
-
if (this.useActioveX) {
|
|
4179
|
-
return window.PNXClient.WaitSetPolicyFinish(strGatewayAddress);
|
|
4180
|
-
} else {
|
|
4181
|
-
var jsonstr = { 'strGatewayAddress': strGatewayAddress };
|
|
4182
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('WaitSetPolicyFinish', JSON.stringify(jsonstr)));
|
|
4183
|
-
return result.value;
|
|
4184
|
-
}
|
|
4185
|
-
};
|
|
4186
|
-
|
|
4187
|
-
/**
|
|
4188
|
-
* 获取会话 Token
|
|
4189
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
4190
|
-
* @returns {string} 会话 Token
|
|
4191
|
-
*/
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
CA_ExtInterface.prototype.getSessionToken = function getSessionToken(strGatewayAddress) {
|
|
4195
|
-
if (this.useActioveX) {
|
|
4196
|
-
return window.PNXClient.GetSessionToken(strGatewayAddress);
|
|
4197
|
-
} else {
|
|
4198
|
-
var jsonstr = { 'strGatewayAddress': strGatewayAddress };
|
|
4199
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetSessionToken', JSON.stringify(jsonstr)));
|
|
4200
|
-
return result.value;
|
|
4201
|
-
}
|
|
4202
|
-
};
|
|
4203
|
-
|
|
4204
|
-
/**
|
|
4205
|
-
* 获取控件版本
|
|
4206
|
-
* @returns {string} 控件版本
|
|
4207
|
-
*/
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
CA_ExtInterface.prototype.getVersion = function getVersion() {
|
|
4211
|
-
if (this.useActioveX) {
|
|
4212
|
-
return window.PNXClient.GetVersion();
|
|
4213
|
-
} else {
|
|
4214
|
-
var jsonstr = '';
|
|
4215
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetVersion', jsonstr));
|
|
4216
|
-
return result.value;
|
|
4217
|
-
}
|
|
4218
|
-
};
|
|
4219
|
-
|
|
4220
|
-
/**
|
|
4221
|
-
* 设置语言资源
|
|
4222
|
-
* @param {string} strLanguage - 语言资源
|
|
4223
|
-
* @returns {number} 设置结果
|
|
4224
|
-
*/
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
CA_ExtInterface.prototype.setLanguage = function setLanguage(strLanguage) {
|
|
4228
|
-
if (this.useActioveX) {
|
|
4229
|
-
return window.PNXClient.SetLanguage(strLanguage);
|
|
4230
|
-
} else {
|
|
4231
|
-
var jsonstr = { 'strLanguage': strLanguage };
|
|
4232
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('SetLanguage', JSON.stringify(jsonstr)));
|
|
4233
|
-
return result.value;
|
|
4234
|
-
}
|
|
4235
|
-
};
|
|
4236
|
-
|
|
4237
|
-
/**
|
|
4238
|
-
* 获取用户属性
|
|
4239
|
-
* @param {string} strGatewayAddress - 网关地址
|
|
4240
|
-
* @param {string} strAppFlag - 应用标识
|
|
4241
|
-
* @param {string} strAttributeName - 属性名称
|
|
4242
|
-
* @returns {string} 用户属性值
|
|
4243
|
-
*/
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
CA_ExtInterface.prototype.getAttribute = function getAttribute(strGatewayAddress, strAppFlag, strAttributeName) {
|
|
4247
|
-
if (this.useActioveX) {
|
|
4248
|
-
return window.PNXClient.GetAttribute(strGatewayAddress, strAppFlag, strAttributeName);
|
|
4249
|
-
} else {
|
|
4250
|
-
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'strAppFlag': strAppFlag, 'strAttributeName': strAttributeName };
|
|
4251
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetAttribute', JSON.stringify(jsonstr)));
|
|
4252
|
-
return result.value;
|
|
4253
|
-
}
|
|
4254
|
-
};
|
|
4255
|
-
|
|
4256
|
-
/**
|
|
4257
|
-
* 获取签名加密 PIN 码
|
|
4258
|
-
* @returns {string} 签名加密 PIN 码
|
|
4259
|
-
*/
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
CA_ExtInterface.prototype.getPinCode = function getPinCode() {
|
|
4263
|
-
if (this.useActioveX) {
|
|
4264
|
-
return window.PNXClient.GetPinCode();
|
|
4265
|
-
} else {
|
|
4266
|
-
var jsonstr = '';
|
|
4267
|
-
var result = JSON.parse(this.sendAndWaitMessageEx('GetPinCode', jsonstr));
|
|
4268
|
-
return result.value;
|
|
4269
|
-
}
|
|
4270
|
-
};
|
|
4271
|
-
/*
|
|
4272
|
-
*曙光四川CA
|
|
4273
|
-
*'SOF_GetUserList' 证书列表
|
|
4274
|
-
*'SOF_ExportUserCert' 导出证书
|
|
4275
|
-
*'SOF_GetCertInfo': 获取证书信息
|
|
4276
|
-
*'SOF_GenRandom': 生成随机数
|
|
4277
|
-
*'SOF_SignData': 获取证书签名
|
|
4278
|
-
*'SOF_Login': 登录证书
|
|
4279
|
-
*'SOF_GetPinRetryCount': 剩余次数
|
|
4280
|
-
*/
|
|
4281
|
-
/**
|
|
4282
|
-
*
|
|
4283
|
-
* 获取webSocket消息
|
|
4284
|
-
* @returns {string}
|
|
4285
|
-
*/
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
CA_ExtInterface.prototype.getMessage = function getMessage(_ref) {
|
|
4289
|
-
var _this = this;
|
|
4290
|
-
|
|
4291
|
-
var action = _ref.action,
|
|
4292
|
-
_ref$params = _ref.params,
|
|
4293
|
-
params = _ref$params === undefined ? [] : _ref$params;
|
|
4294
|
-
|
|
4295
|
-
return new Promise(function (resolve, reject) {
|
|
4296
|
-
var obj = JSON.stringify({
|
|
4297
|
-
'action': action,
|
|
4298
|
-
'params': params
|
|
4299
|
-
});
|
|
4300
|
-
if (!_this.webSocket) {
|
|
4301
|
-
_this.webSocket = new WebSocket('wss://localhost:36171');
|
|
4302
|
-
_this.webSocket.onerror = function (event) {
|
|
4303
|
-
_this.webSocket = null;
|
|
4304
|
-
reject(event);
|
|
4305
|
-
};
|
|
4306
|
-
_this.webSocket.onopen = function () {
|
|
4307
|
-
_this.webSocket.send(obj);
|
|
4308
|
-
};
|
|
4309
|
-
} else {
|
|
4310
|
-
_this.webSocket.send(obj);
|
|
4311
|
-
}
|
|
4312
|
-
_this.webSocket.onclose = function () {
|
|
4313
|
-
_this.webSocket = null;
|
|
4314
|
-
};
|
|
4315
|
-
_this.webSocket.onmessage = function (event) {
|
|
4316
|
-
resolve(JSON.parse(event.data));
|
|
4317
|
-
};
|
|
4318
|
-
});
|
|
4319
|
-
};
|
|
4320
|
-
/**
|
|
4321
|
-
*
|
|
4322
|
-
* base64解码
|
|
4323
|
-
* @returns {string} base64解码后的字符串
|
|
4324
|
-
*/
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
CA_ExtInterface.prototype.base64Decode = function base64Decode(res) {
|
|
4328
|
-
var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
4329
|
-
var val = '';
|
|
4330
|
-
var chr1 = void 0;
|
|
4331
|
-
var chr2 = void 0;
|
|
4332
|
-
var chr3 = void 0;
|
|
4333
|
-
var enc1 = void 0;
|
|
4334
|
-
var enc2 = void 0;
|
|
4335
|
-
var enc3 = void 0;
|
|
4336
|
-
var enc4 = void 0;
|
|
4337
|
-
var i = 0;
|
|
4338
|
-
res = res.replace(/[^A-Za-z0-9\+\/\=]/g, '');
|
|
4339
|
-
while (i < res.length) {
|
|
4340
|
-
enc1 = _keyStr.indexOf(res.charAt(i++));
|
|
4341
|
-
enc2 = _keyStr.indexOf(res.charAt(i++));
|
|
4342
|
-
enc3 = _keyStr.indexOf(res.charAt(i++));
|
|
4343
|
-
enc4 = _keyStr.indexOf(res.charAt(i++));
|
|
4344
|
-
chr1 = enc1 << 2 | enc2 >> 4;
|
|
4345
|
-
chr2 = (enc2 & 15) << 4 | enc3 >> 2;
|
|
4346
|
-
chr3 = (enc3 & 3) << 6 | enc4;
|
|
4347
|
-
val = val + String.fromCharCode(chr1);
|
|
4348
|
-
if (enc3 !== 64) {
|
|
4349
|
-
val = val + String.fromCharCode(chr2);
|
|
4350
|
-
}
|
|
4351
|
-
if (enc4 !== 64) {
|
|
4352
|
-
val = val + String.fromCharCode(chr3);
|
|
4353
|
-
}
|
|
4354
|
-
}
|
|
4355
|
-
val = this.utf8_decode(val);
|
|
4356
|
-
return val;
|
|
4357
|
-
};
|
|
4358
|
-
/**
|
|
4359
|
-
*
|
|
4360
|
-
* base64编码
|
|
4361
|
-
* @returns {string} base64编码后的字符串
|
|
4362
|
-
*/
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
CA_ExtInterface.prototype.base64Encode = function base64Encode(res) {
|
|
4366
|
-
var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
4367
|
-
var val = '';
|
|
4368
|
-
var chr1 = void 0;
|
|
4369
|
-
var chr2 = void 0;
|
|
4370
|
-
var chr3 = void 0;
|
|
4371
|
-
var enc1 = void 0;
|
|
4372
|
-
var enc2 = void 0;
|
|
4373
|
-
var enc3 = void 0;
|
|
4374
|
-
var enc4 = void 0;
|
|
4375
|
-
var i = 0;
|
|
4376
|
-
res = this.utf8_encode(res);
|
|
4377
|
-
while (i < res.length) {
|
|
4378
|
-
chr1 = res.charCodeAt(i++);
|
|
4379
|
-
chr2 = res.charCodeAt(i++);
|
|
4380
|
-
chr3 = res.charCodeAt(i++);
|
|
4381
|
-
enc1 = chr1 >> 2;
|
|
4382
|
-
enc2 = (chr1 & 3) << 4 | chr2 >> 4;
|
|
4383
|
-
enc3 = (chr2 & 15) << 2 | chr3 >> 6;
|
|
4384
|
-
enc4 = chr3 & 63;
|
|
4385
|
-
if (isNaN(chr2)) {
|
|
4386
|
-
enc3 = enc4 = 64;
|
|
4387
|
-
} else if (isNaN(chr3)) {
|
|
4388
|
-
enc4 = 64;
|
|
4389
|
-
}
|
|
4390
|
-
val = val + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
|
|
4391
|
-
}
|
|
4392
|
-
return val;
|
|
4393
|
-
};
|
|
4394
|
-
/**
|
|
4395
|
-
*
|
|
4396
|
-
* utf8解码
|
|
4397
|
-
* @returns {string} utf8解码后的字符串
|
|
4398
|
-
*/
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
CA_ExtInterface.prototype.utf8_decode = function utf8_decode(utftext) {
|
|
4402
|
-
var string = '';
|
|
4403
|
-
var i = 0;
|
|
4404
|
-
var c = 0;
|
|
4405
|
-
// let c1 = 0;
|
|
4406
|
-
var c2 = 0;
|
|
4407
|
-
var c3 = 0;
|
|
4408
|
-
while (i < utftext.length) {
|
|
4409
|
-
c = utftext.charCodeAt(i);
|
|
4410
|
-
if (c < 128) {
|
|
4411
|
-
string += String.fromCharCode(c);
|
|
4412
|
-
i++;
|
|
4413
|
-
} else if (c > 191 && c < 224) {
|
|
4414
|
-
c2 = utftext.charCodeAt(i + 1);
|
|
4415
|
-
string += String.fromCharCode((c & 31) << 6 | c2 & 63);
|
|
4416
|
-
i += 2;
|
|
4417
|
-
} else {
|
|
4418
|
-
c2 = utftext.charCodeAt(i + 1);
|
|
4419
|
-
c3 = utftext.charCodeAt(i + 2);
|
|
4420
|
-
string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
|
4421
|
-
i += 3;
|
|
4422
|
-
}
|
|
4423
|
-
}
|
|
4424
|
-
return string;
|
|
4425
|
-
};
|
|
4426
|
-
/**
|
|
4427
|
-
*
|
|
4428
|
-
* utf8编码
|
|
4429
|
-
* @returns {string} utf8编码后的字符串
|
|
4430
|
-
*/
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
CA_ExtInterface.prototype.utf8_encode = function utf8_encode(string) {
|
|
4434
|
-
string = string.replace(/\r\n/g, '\n');
|
|
4435
|
-
var utftext = '';
|
|
4436
|
-
for (var n = 0; n < string.length; n++) {
|
|
4437
|
-
var c = string.charCodeAt(n);
|
|
4438
|
-
if (c < 128) {
|
|
4439
|
-
utftext += String.fromCharCode(c);
|
|
4440
|
-
} else if (c > 127 && c < 2048) {
|
|
4441
|
-
utftext += String.fromCharCode(c >> 6 | 192);
|
|
4442
|
-
utftext += String.fromCharCode(c & 63 | 128);
|
|
4443
|
-
} else {
|
|
4444
|
-
utftext += String.fromCharCode(c >> 12 | 224);
|
|
4445
|
-
utftext += String.fromCharCode(c >> 6 & 63 | 128);
|
|
4446
|
-
utftext += String.fromCharCode(c & 63 | 128);
|
|
4447
|
-
}
|
|
4448
|
-
}
|
|
4449
|
-
return utftext;
|
|
4450
|
-
};
|
|
4451
|
-
|
|
4452
|
-
return CA_ExtInterface;
|
|
4453
|
-
}();
|
|
4454
|
-
|
|
4455
|
-
var caPlugin = new CA_ExtInterface();
|
|
4456
|
-
/* harmony default export */ var src_plugin = (caPlugin);
|
|
4457
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/ca-login/src/ca-login.vue?vue&type=script&lang=js&
|
|
4458
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4459
|
-
|
|
4460
|
-
//
|
|
4461
|
-
//
|
|
4462
|
-
//
|
|
4463
|
-
//
|
|
4464
|
-
//
|
|
4465
|
-
//
|
|
4466
|
-
//
|
|
4467
|
-
//
|
|
4468
|
-
//
|
|
4469
|
-
//
|
|
4470
|
-
//
|
|
4471
|
-
//
|
|
4472
|
-
//
|
|
4473
|
-
//
|
|
4474
|
-
//
|
|
4475
|
-
//
|
|
4476
|
-
//
|
|
4477
|
-
//
|
|
4478
|
-
//
|
|
4479
|
-
//
|
|
4480
|
-
//
|
|
4481
|
-
//
|
|
4482
|
-
//
|
|
4483
|
-
//
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
/* harmony default export */ var ca_loginvue_type_script_lang_js_ = ({
|
|
4490
|
-
name: 'EsCaLogin',
|
|
4491
|
-
props: {
|
|
4492
|
-
//登录接口地址
|
|
4493
|
-
action: String,
|
|
4494
|
-
// 额外参数
|
|
4495
|
-
data: {
|
|
4496
|
-
type: Object,
|
|
4497
|
-
default: function _default() {
|
|
4498
|
-
return {};
|
|
4499
|
-
}
|
|
4500
|
-
},
|
|
4501
|
-
// 插件安装路径
|
|
4502
|
-
installPath: String,
|
|
4503
|
-
// CA类型JIDA-吉大正元,SHU_GUANG-曙光,SICHUAN-四川
|
|
4504
|
-
mode: {
|
|
4505
|
-
type: String,
|
|
4506
|
-
required: true
|
|
4507
|
-
},
|
|
4508
|
-
// 唯一标识ID
|
|
4509
|
-
identifyingId: {
|
|
4510
|
-
type: String,
|
|
4511
|
-
default: function _default() {
|
|
4512
|
-
return Object(util["X" /* uuid */])(12);
|
|
4513
|
-
}
|
|
4514
|
-
},
|
|
4515
|
-
// DLL 名称列表
|
|
4516
|
-
dllname: {
|
|
4517
|
-
type: Array,
|
|
4518
|
-
default: function _default() {
|
|
4519
|
-
return [];
|
|
4520
|
-
}
|
|
4521
|
-
},
|
|
4522
|
-
// 是否显示证书选择框
|
|
4523
|
-
showSelect: Boolean
|
|
4524
|
-
},
|
|
4525
|
-
data: function data() {
|
|
4526
|
-
return {
|
|
4527
|
-
userList: [],
|
|
4528
|
-
signedData: '', //证书原文
|
|
4529
|
-
b64originData: '', //签名原文
|
|
4530
|
-
b64SignData: '', //签名结果
|
|
4531
|
-
idCard: '',
|
|
4532
|
-
certId: '',
|
|
4533
|
-
loading: null
|
|
4534
|
-
};
|
|
4535
|
-
},
|
|
4536
|
-
|
|
4537
|
-
computed: {
|
|
4538
|
-
jida: function jida() {
|
|
4539
|
-
// 生成不重复的 DLL 名称列表
|
|
4540
|
-
var dllnames = Array.from(new Set(['L3Vzci9saWI2NC9saWJTS0ZBUEkuc28=', 'bGliU0tGQVBJLWFybTY0LnNv', 'L3Vzci9saWIvYWFyY2g2NC1saW51eC1nbnUvbGliU0tGQVBJLWFybTY0LnNv', 'L3Vzci9saWIvbGliU0tGQVBJLnNv', 'U0tGQVBJMzAwOTIuZGxs', 'bGliU0tGQVBJLnNv', 'L29wdC9oYWl0YWkvbGliL2xpYlNLRkFQSS5zbw==', 'U0tGQVBJNDAwOTcuZGxs'].concat(this.dllname)));
|
|
4541
|
-
|
|
4542
|
-
return '<?xml version="1.0" encoding="utf-8"?>\n <authinfo>\n <liblist>\n ' + dllnames.map(function (dllname) {
|
|
4543
|
-
return '<lib type="SKF" version="1.0" dllname="' + dllname + '"><algid val="SHA1" sm2_hashalg="SM3" /></lib>';
|
|
4544
|
-
}).join('') + '\n </liblist>\n </authinfo>';
|
|
4545
|
-
}
|
|
4546
|
-
},
|
|
4547
|
-
created: function created() {
|
|
4548
|
-
this.init();
|
|
4549
|
-
},
|
|
4550
|
-
mounted: function mounted() {},
|
|
4551
|
-
|
|
4552
|
-
methods: {
|
|
4553
|
-
init: function init() {
|
|
4554
|
-
if (!window.PNXClient) {
|
|
4555
|
-
// 创建 object 元素
|
|
4556
|
-
var pnxClientElement = document.createElement('object');
|
|
4557
|
-
pnxClientElement.classid = 'clsid:9DD991F7-6FB0-4004-95A4-0A55006A8C42';
|
|
4558
|
-
pnxClientElement.width = '0';
|
|
4559
|
-
pnxClientElement.height = '0';
|
|
4560
|
-
pnxClientElement.id = 'PNXClient';
|
|
4561
|
-
pnxClientElement.style.position = 'absolute';
|
|
4562
|
-
document.body.appendChild(pnxClientElement);
|
|
4563
|
-
}
|
|
4564
|
-
},
|
|
4565
|
-
getCertificate: function getCertificate() {
|
|
4566
|
-
var _this = this;
|
|
4567
|
-
|
|
4568
|
-
// 检查 PNXClient 是否存在
|
|
4569
|
-
if (!window.PNXClient) {
|
|
4570
|
-
Object(util["m" /* error */])('控件加载失败,请刷新页面重试!', function () {
|
|
4571
|
-
_this.$emit('error', {
|
|
4572
|
-
code: 0,
|
|
4573
|
-
msg: '控件加载失败,请刷新页面重试!'
|
|
4574
|
-
});
|
|
4575
|
-
});
|
|
4576
|
-
return;
|
|
4577
|
-
}
|
|
4578
|
-
switch (this.mode) {
|
|
4579
|
-
//吉大正元:
|
|
4580
|
-
case 'JIDA':
|
|
4581
|
-
try {
|
|
4582
|
-
src_plugin.getVersion();
|
|
4583
|
-
} catch (e) {
|
|
4584
|
-
if (this.installPath) {
|
|
4585
|
-
message_box_default.a.confirm('未安装控件,请进行安装控件!', '控件下载', {
|
|
4586
|
-
confirmButtonText: '下载',
|
|
4587
|
-
cancelButtonText: '取消',
|
|
4588
|
-
type: 'warning'
|
|
4589
|
-
}).then(function () {
|
|
4590
|
-
Object(util["k" /* downloadFile */])(_this.installPath);
|
|
4591
|
-
}).catch(function () {});
|
|
4592
|
-
} else {
|
|
4593
|
-
Object(util["m" /* error */])('未安装控件,请进行安装控件!', function () {
|
|
4594
|
-
_this.$emit('error', {
|
|
4595
|
-
type: 1,
|
|
4596
|
-
msg: '未安装控件,请进行安装控件!'
|
|
4597
|
-
});
|
|
4598
|
-
});
|
|
4599
|
-
}
|
|
4600
|
-
return;
|
|
4601
|
-
}
|
|
4602
|
-
try {
|
|
4603
|
-
// 清除之前的过滤器
|
|
4604
|
-
src_plugin.clearFilter();
|
|
4605
|
-
// 初始化vctk控件
|
|
4606
|
-
src_plugin.initialize('', this.jida);
|
|
4607
|
-
// 控制证书为一个时,并且不显示选择框时,不弹出证书选择框
|
|
4608
|
-
!this.showSelect && src_plugin.setChooseSingleCert(1);
|
|
4609
|
-
|
|
4610
|
-
// 生成签名信息
|
|
4611
|
-
this.signedData = src_plugin.p7SignString(this.identifyingId, true, true);
|
|
4612
|
-
|
|
4613
|
-
//获取错误码
|
|
4614
|
-
var errorCode = Number(src_plugin.getLastError());
|
|
4615
|
-
if (errorCode !== 0) {
|
|
4616
|
-
if (errorCode === 3758096386 || errorCode === 2148532334) {
|
|
4617
|
-
Object(util["m" /* error */])('用户取消操作!', function () {
|
|
4618
|
-
_this.$emit('error', { code: 52, msg: '用户取消操作!' });
|
|
4619
|
-
});
|
|
4620
|
-
return;
|
|
4621
|
-
} else if (errorCode === -536870815 || errorCode === 3758096481) {
|
|
4622
|
-
Object(util["m" /* error */])('没有找到有效的证书,如果使用的是KEY,请确认已经插入key!', function () {
|
|
4623
|
-
_this.$emit('error', {
|
|
4624
|
-
type: 2,
|
|
4625
|
-
msg: '没有找到有效的证书,如果使用的是KEY,请确认已经插入key!'
|
|
4626
|
-
});
|
|
4627
|
-
});
|
|
4628
|
-
return;
|
|
4629
|
-
} else {
|
|
4630
|
-
var msg = src_plugin.getLastErrorMessage();
|
|
4631
|
-
Object(util["m" /* error */])(msg, function () {
|
|
4632
|
-
_this.$emit('error', { code: 3, msg: msg });
|
|
4633
|
-
});
|
|
4634
|
-
return;
|
|
4635
|
-
}
|
|
4636
|
-
}
|
|
4637
|
-
this.$emit('success', this.signedData);
|
|
4638
|
-
return this.signedData;
|
|
4639
|
-
} catch (error) {
|
|
4640
|
-
// 捕获其他可能的异常
|
|
4641
|
-
error('\u64CD\u4F5C\u5931\u8D25: ' + error.message, function () {
|
|
4642
|
-
_this.$emit('error', { code: 4, msg: error.message });
|
|
4643
|
-
});
|
|
4644
|
-
}
|
|
4645
|
-
break;
|
|
4646
|
-
//曙光:
|
|
4647
|
-
case 'SHU_GUANG':
|
|
4648
|
-
src_plugin.getMessage({ action: 'SOF_GetUserList' }).then(function (res) {
|
|
4649
|
-
var retCode = res.retCode,
|
|
4650
|
-
retMsg = res.retMsg,
|
|
4651
|
-
retValue = res.retValue;
|
|
4652
|
-
|
|
4653
|
-
if (!retValue || retCode !== 0) {
|
|
4654
|
-
Object(util["m" /* error */])(retCode !== 0 ? retMsg : '未找到证书,请插入证书UKEY!', function () {
|
|
4655
|
-
_this.$emit('error', {
|
|
4656
|
-
type: 2,
|
|
4657
|
-
msg: retCode !== 0 ? retMsg : '未找到证书,请插入证书UKEY!'
|
|
4658
|
-
});
|
|
4659
|
-
});
|
|
4660
|
-
return;
|
|
4661
|
-
}
|
|
4662
|
-
var userList = retValue.split('&&&');
|
|
4663
|
-
if (userList.length === 1 && !_this.showSelect) {
|
|
4664
|
-
//如果只有一个证书,并且不显示选择框时,直接获取证书信息
|
|
4665
|
-
_this.certId = userList[0].split('||')[1];
|
|
4666
|
-
_this.getCertInfo(_this.certId);
|
|
4667
|
-
} else {
|
|
4668
|
-
// 如果有多个证书,弹出选择框
|
|
4669
|
-
_this.userList = userList.map(function (item) {
|
|
4670
|
-
var _item$split = item.split('||'),
|
|
4671
|
-
name = _item$split[0],
|
|
4672
|
-
certId = _item$split[1];
|
|
4673
|
-
|
|
4674
|
-
return { label: name, value: certId };
|
|
4675
|
-
});
|
|
4676
|
-
message_box_default.a.prompt('', '证书选择', {
|
|
4677
|
-
confirmButtonText: '确定',
|
|
4678
|
-
cancelButtonText: '取消',
|
|
4679
|
-
inputPattern: /^.+$/,
|
|
4680
|
-
inputErrorMessage: '请选择证书!',
|
|
4681
|
-
selectData: _this.userList
|
|
4682
|
-
}).then(function (res) {
|
|
4683
|
-
_this.certId = res.value;
|
|
4684
|
-
_this.getCertInfo(_this.certId);
|
|
4685
|
-
}).catch(function () {
|
|
4686
|
-
_this.$emit('error', { code: 52, msg: '用户取消操作!' });
|
|
4687
|
-
});
|
|
4688
|
-
}
|
|
4689
|
-
}).catch(function (err) {
|
|
4690
|
-
if (_this.installPath) {
|
|
4691
|
-
message_box_default.a.confirm('请检查是否安装并启用证书助手控件!', '控件下载', {
|
|
4692
|
-
confirmButtonText: '下载',
|
|
4693
|
-
cancelButtonText: '取消',
|
|
4694
|
-
type: 'warning'
|
|
4695
|
-
}).then(function () {
|
|
4696
|
-
Object(util["k" /* downloadFile */])(_this.installPath);
|
|
4697
|
-
}).catch(function () {
|
|
4698
|
-
_this.$emit('error', {
|
|
4699
|
-
type: 1,
|
|
4700
|
-
msg: '请检查是否安装并启用证书助手控件!'
|
|
4701
|
-
});
|
|
4702
|
-
});
|
|
4703
|
-
} else {
|
|
4704
|
-
Object(util["m" /* error */])('请检查是否安装并启用证书助手控件!', function () {
|
|
4705
|
-
_this.$emit('error', {
|
|
4706
|
-
type: 1,
|
|
4707
|
-
msg: '请检查是否安装并启用证书助手控件!'
|
|
4708
|
-
});
|
|
4709
|
-
});
|
|
4710
|
-
}
|
|
4711
|
-
});
|
|
4712
|
-
break;
|
|
4713
|
-
//四川:
|
|
4714
|
-
case 'SICHUAN':
|
|
4715
|
-
Object(util["Z" /* warning */])('四川CA登录方式对接中!', function () {
|
|
4716
|
-
_this.$emit('error', {
|
|
4717
|
-
type: 2,
|
|
4718
|
-
msg: '四川CA登录方式对接中!'
|
|
4719
|
-
});
|
|
4720
|
-
});
|
|
4721
|
-
break;
|
|
4722
|
-
}
|
|
4723
|
-
},
|
|
4724
|
-
getCertInfo: function getCertInfo(name) {
|
|
4725
|
-
var _this2 = this;
|
|
4726
|
-
|
|
4727
|
-
src_plugin.getMessage({ action: 'SOF_ExportUserCert', params: [name] }).then(function (res) {
|
|
4728
|
-
var retCode = res.retCode,
|
|
4729
|
-
retMsg = res.retMsg,
|
|
4730
|
-
retValue = res.retValue;
|
|
4731
|
-
|
|
4732
|
-
if (retCode !== 0) {
|
|
4733
|
-
Object(util["m" /* error */])(retMsg, function () {
|
|
4734
|
-
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
4735
|
-
});
|
|
4736
|
-
return;
|
|
4737
|
-
}
|
|
4738
|
-
//设置证书原文
|
|
4739
|
-
_this2.signedData = retValue.replace('-----BEGIN CERTIFICATE-----', '').replace('-----END CERTIFICATE-----', '');
|
|
4740
|
-
src_plugin.getMessage({
|
|
4741
|
-
action: 'SOF_GetCertInfo',
|
|
4742
|
-
params: [retValue, 'SGD_CERT_SUBJECT_SN']
|
|
4743
|
-
}).then(function (res) {
|
|
4744
|
-
var retCode = res.retCode,
|
|
4745
|
-
retMsg = res.retMsg,
|
|
4746
|
-
retValue = res.retValue;
|
|
4747
|
-
|
|
4748
|
-
if (retCode !== 0) {
|
|
4749
|
-
Object(util["m" /* error */])(retMsg, function () {
|
|
4750
|
-
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
4751
|
-
});
|
|
4752
|
-
return;
|
|
4753
|
-
}
|
|
4754
|
-
_this2.idCard = src_plugin.base64Decode(retValue);
|
|
4755
|
-
src_plugin.getMessage({
|
|
4756
|
-
action: 'SOF_GenRandom',
|
|
4757
|
-
params: [16]
|
|
4758
|
-
}).then(function (res) {
|
|
4759
|
-
var retCode = res.retCode,
|
|
4760
|
-
retMsg = res.retMsg,
|
|
4761
|
-
retValue = res.retValue;
|
|
4762
|
-
|
|
4763
|
-
if (retCode !== 0) {
|
|
4764
|
-
Object(util["m" /* error */])(retMsg, function () {
|
|
4765
|
-
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
4766
|
-
});
|
|
4767
|
-
return;
|
|
4768
|
-
}
|
|
4769
|
-
_this2.b64originData = retValue + _this2.identifyingId;
|
|
4770
|
-
src_plugin.getMessage({
|
|
4771
|
-
action: 'SOF_SignData',
|
|
4772
|
-
params: [_this2.certId, src_plugin.base64Encode(_this2.b64originData)]
|
|
4773
|
-
}).then(function (res) {
|
|
4774
|
-
var retCode = res.retCode,
|
|
4775
|
-
retMsg = res.retMsg,
|
|
4776
|
-
retValue = res.retValue;
|
|
4777
|
-
|
|
4778
|
-
if (retCode !== 0) {
|
|
4779
|
-
if (retCode === 184550659) {
|
|
4780
|
-
_this2.cerLogin();
|
|
4781
|
-
} else {
|
|
4782
|
-
Object(util["m" /* error */])(retMsg, function () {
|
|
4783
|
-
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
4784
|
-
});
|
|
4785
|
-
}
|
|
4786
|
-
return;
|
|
4787
|
-
}
|
|
4788
|
-
_this2.b64SignData = retValue;
|
|
4789
|
-
_this2.$emit('success', {
|
|
4790
|
-
identifyingId: _this2.identifyingId,
|
|
4791
|
-
signedData: _this2.signedData, //证书原文
|
|
4792
|
-
b64originData: _this2.b64originData, //签名原文
|
|
4793
|
-
b64SignData: _this2.b64SignData, //签名结果
|
|
4794
|
-
idCard: _this2.idCard,
|
|
4795
|
-
certId: _this2.certId
|
|
4796
|
-
});
|
|
4797
|
-
}).catch(function (err) {
|
|
4798
|
-
_this2.$emit('error', { code: 5, msg: err });
|
|
4799
|
-
});
|
|
4800
|
-
}).catch(function (err) {
|
|
4801
|
-
_this2.$emit('error', { code: 6, msg: err });
|
|
4802
|
-
});
|
|
4803
|
-
}).catch(function (err) {
|
|
4804
|
-
_this2.$emit('error', { code: 7, msg: err });
|
|
4805
|
-
});
|
|
4806
|
-
}).catch(function (err) {
|
|
4807
|
-
_this2.$emit('error', { code: 8, msg: err });
|
|
4808
|
-
});
|
|
4809
|
-
},
|
|
4810
|
-
cerLogin: function cerLogin() {
|
|
4811
|
-
var _this3 = this;
|
|
4812
|
-
|
|
4813
|
-
var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '提示';
|
|
4814
|
-
|
|
4815
|
-
message_box_default.a.prompt('输入密码', title, {
|
|
4816
|
-
confirmButtonText: '确定',
|
|
4817
|
-
cancelButtonText: '取消',
|
|
4818
|
-
inputPattern: /^[[\x21-\x7E]{6,16}$/,
|
|
4819
|
-
inputErrorMessage: '请输入密码'
|
|
4820
|
-
}).then(function (_ref) {
|
|
4821
|
-
var value = _ref.value;
|
|
4822
|
-
|
|
4823
|
-
src_plugin.getMessage({
|
|
4824
|
-
action: 'SOF_Login',
|
|
4825
|
-
params: [_this3.certId, value]
|
|
4826
|
-
}).then(function (res) {
|
|
4827
|
-
var retCode = res.retCode,
|
|
4828
|
-
retMsg = res.retMsg,
|
|
4829
|
-
retValue = res.retValue;
|
|
4830
|
-
|
|
4831
|
-
if (retCode !== 0 || retValue === false) {
|
|
4832
|
-
if (retValue === false) {
|
|
4833
|
-
src_plugin.getMessage({
|
|
4834
|
-
action: 'SOF_GetPinRetryCount',
|
|
4835
|
-
params: [_this3.certId]
|
|
4836
|
-
}).then(function (res) {
|
|
4837
|
-
var retValue = res.retValue;
|
|
4838
|
-
|
|
4839
|
-
_this3.cerLogin('\u767B\u5F55\u5931\u8D25\uFF01\u5269\u4F59\u53E3\u4EE4\u91CD\u8BD5\u6B21\u6570\uFF1A' + retValue + '\u6B21');
|
|
4840
|
-
});
|
|
4841
|
-
return;
|
|
4842
|
-
}
|
|
4843
|
-
Object(util["m" /* error */])(retMsg, function () {
|
|
4844
|
-
_this3.$emit('error', { code: retCode, msg: retMsg });
|
|
4845
|
-
});
|
|
4846
|
-
return;
|
|
4847
|
-
}
|
|
4848
|
-
src_plugin.getMessage({
|
|
4849
|
-
action: 'SOF_SignData',
|
|
4850
|
-
params: [_this3.certId, src_plugin.base64Encode(_this3.b64originData)]
|
|
4851
|
-
}).then(function (res) {
|
|
4852
|
-
var retCode = res.retCode,
|
|
4853
|
-
retMsg = res.retMsg,
|
|
4854
|
-
retValue = res.retValue;
|
|
4855
|
-
|
|
4856
|
-
if (retCode !== 0) {
|
|
4857
|
-
if (retCode === 184550659) {
|
|
4858
|
-
_this3.cerLogin();
|
|
4859
|
-
} else {
|
|
4860
|
-
Object(util["m" /* error */])(retMsg, function () {
|
|
4861
|
-
_this3.$emit('error', { code: retCode, msg: retMsg });
|
|
4862
|
-
});
|
|
4863
|
-
}
|
|
4864
|
-
return;
|
|
4865
|
-
}
|
|
4866
|
-
_this3.b64SignData = retValue;
|
|
4867
|
-
if (_this3.autoLogin) {
|
|
4868
|
-
_this3.doLogin();
|
|
4869
|
-
return;
|
|
4870
|
-
}
|
|
4871
|
-
_this3.$emit('success', {
|
|
4872
|
-
identifyingId: _this3.identifyingId,
|
|
4873
|
-
signedData: _this3.signedData, //证书原文
|
|
4874
|
-
b64originData: _this3.b64originData, //签名原文
|
|
4875
|
-
b64SignData: _this3.b64SignData, //签名结果
|
|
4876
|
-
idCard: _this3.idCard,
|
|
4877
|
-
certId: _this3.certId
|
|
4878
|
-
});
|
|
4879
|
-
}).catch(function (err) {
|
|
4880
|
-
_this3.$emit('error', { code: 9, msg: err });
|
|
4881
|
-
});
|
|
4882
|
-
}).catch(function () {
|
|
4883
|
-
_this3.$emit('error', { code: 10, msg: err });
|
|
4884
|
-
});
|
|
4885
|
-
}).catch(function () {
|
|
4886
|
-
_this3.$emit('error', { code: 11, msg: err });
|
|
4887
|
-
});
|
|
4888
|
-
},
|
|
4889
|
-
doLogin: function doLogin() {
|
|
4890
|
-
var _this4 = this;
|
|
4891
|
-
|
|
4892
|
-
var data = _extends({
|
|
4893
|
-
identifyingId: this.identifyingId,
|
|
4894
|
-
signedData: this.signedData, //证书原文
|
|
4895
|
-
b64originData: this.b64originData, //签名原文
|
|
4896
|
-
b64SignData: this.b64SignData, //签名结果
|
|
4897
|
-
idCard: this.idCard,
|
|
4898
|
-
certId: this.certId
|
|
4899
|
-
}, this.data);
|
|
4900
|
-
var loadingInstance = Object(util["J" /* loading */])('登录中...');
|
|
4901
|
-
ajax({
|
|
4902
|
-
method: 'post',
|
|
4903
|
-
url: this.action,
|
|
4904
|
-
data: data
|
|
4905
|
-
}).then(function (res) {
|
|
4906
|
-
if (res.rCode == 0) {
|
|
4907
|
-
var _results = results,
|
|
4908
|
-
statusCode = _results.statusCode,
|
|
4909
|
-
msg = _results.msg;
|
|
4910
|
-
|
|
4911
|
-
if (statusCode === 1) {
|
|
4912
|
-
Object(util["m" /* error */])(msg || '登录失败!', function () {
|
|
4913
|
-
_this4.$emit('error', res);
|
|
4914
|
-
});
|
|
4915
|
-
} else {
|
|
4916
|
-
_this4.$emit('success', results);
|
|
4917
|
-
}
|
|
4918
|
-
} else {
|
|
4919
|
-
var _msg = res.results && res.results.msg ? res.results.msg : res.msg;
|
|
4920
|
-
Object(util["m" /* error */])(_msg || '系统错误,请联系管理员!', function () {
|
|
4921
|
-
_this4.$emit('error', res);
|
|
4922
|
-
});
|
|
4923
|
-
}
|
|
4924
|
-
loadingInstance.close();
|
|
4925
|
-
}).catch(function (err) {
|
|
4926
|
-
loadingInstance.close();
|
|
4927
|
-
});
|
|
4928
|
-
}
|
|
4929
|
-
}
|
|
4930
|
-
});
|
|
4931
|
-
// CONCATENATED MODULE: ./packages/ca-login/src/ca-login.vue?vue&type=script&lang=js&
|
|
4932
|
-
/* harmony default export */ var src_ca_loginvue_type_script_lang_js_ = (ca_loginvue_type_script_lang_js_);
|
|
4933
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
4934
|
-
var componentNormalizer = __webpack_require__(5);
|
|
4935
|
-
|
|
4936
|
-
// CONCATENATED MODULE: ./packages/ca-login/src/ca-login.vue
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
/* normalize component */
|
|
4943
|
-
|
|
4944
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
4945
|
-
src_ca_loginvue_type_script_lang_js_,
|
|
4946
|
-
render,
|
|
4947
|
-
staticRenderFns,
|
|
4948
|
-
false,
|
|
4949
|
-
null,
|
|
4950
|
-
null,
|
|
4951
|
-
null
|
|
4952
|
-
|
|
4953
|
-
)
|
|
4954
|
-
|
|
4955
|
-
/* harmony default export */ var ca_login = (component.exports);
|
|
4956
|
-
// CONCATENATED MODULE: ./packages/ca-login/index.js
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
ca_login.install = function (Vue) {
|
|
4960
|
-
return Vue.component(ca_login.name, ca_login);
|
|
4961
|
-
};
|
|
4962
|
-
|
|
4963
|
-
/* harmony default export */ var packages_ca_login = __webpack_exports__["default"] = (ca_login);
|
|
4964
|
-
|
|
4965
|
-
/***/ }),
|
|
4966
|
-
|
|
4967
|
-
/***/ 17:
|
|
4968
|
-
/***/ (function(module, exports) {
|
|
4969
|
-
|
|
4970
|
-
module.exports = require("lodash/cloneDeep");
|
|
4971
|
-
|
|
4972
|
-
/***/ }),
|
|
4973
|
-
|
|
4974
|
-
/***/ 2:
|
|
4975
|
-
/***/ (function(module, exports) {
|
|
4976
|
-
|
|
4977
|
-
module.exports = require("vue");
|
|
4978
|
-
|
|
4979
|
-
/***/ }),
|
|
4980
|
-
|
|
4981
|
-
/***/ 3:
|
|
4982
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4983
|
-
|
|
4984
|
-
"use strict";
|
|
4985
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
|
|
4986
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
|
|
4987
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
|
|
4988
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
|
|
4989
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
|
|
4990
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
|
|
4991
|
-
/**
|
|
4992
|
-
* 检查一个值是否为字符串类型
|
|
4993
|
-
* @param {*} obj 要检查的值
|
|
4994
|
-
* @returns {boolean} 如果值为字符串则返回true,否则返回false
|
|
4995
|
-
*/
|
|
4996
|
-
function isString(obj) {
|
|
4997
|
-
return Object.prototype.toString.call(obj) === '[object String]';
|
|
4998
|
-
}
|
|
4999
|
-
|
|
5000
|
-
/**
|
|
5001
|
-
* 检查一个值是否为对象类型
|
|
5002
|
-
* @param {*} obj 要检查的值
|
|
5003
|
-
* @returns {boolean} 如果值为对象则返回true,否则返回false
|
|
5004
|
-
*/
|
|
5005
|
-
function isObject(obj) {
|
|
5006
|
-
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
5007
|
-
}
|
|
5008
|
-
|
|
5009
|
-
/**
|
|
5010
|
-
* 检查一个节点是否为HTML元素
|
|
5011
|
-
* @param {Node} node 要检查的节点
|
|
5012
|
-
* @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
|
|
5013
|
-
*/
|
|
5014
|
-
function isHtmlElement(node) {
|
|
5015
|
-
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
5016
|
-
}
|
|
5017
|
-
|
|
5018
|
-
/**
|
|
5019
|
-
* 检查一个值是否为函数类型
|
|
5020
|
-
* @param {*} functionToCheck 要检查的值
|
|
5021
|
-
* @returns {boolean} 如果值为函数则返回true,否则返回false
|
|
5022
|
-
*/
|
|
5023
|
-
function isFunction(functionToCheck) {
|
|
5024
|
-
var getType = {};
|
|
5025
|
-
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
5026
|
-
}
|
|
5027
|
-
|
|
5028
|
-
/**
|
|
5029
|
-
* 检查一个值是否为undefined
|
|
5030
|
-
* @param {*} val 要检查的值
|
|
5031
|
-
* @returns {boolean} 如果值为undefined则返回true,否则返回false
|
|
5032
|
-
*/
|
|
5033
|
-
function isUndefined(val) {
|
|
5034
|
-
return val === void 0;
|
|
5035
|
-
}
|
|
5036
|
-
|
|
5037
|
-
/**
|
|
5038
|
-
* 检查一个值是否已定义(不是undefined或null)
|
|
5039
|
-
* @param {*} val 要检查的值
|
|
5040
|
-
* @returns {boolean} 如果值已定义则返回true,否则返回false
|
|
5041
|
-
*/
|
|
5042
|
-
function isDefined(val) {
|
|
5043
|
-
return val !== undefined && val !== null;
|
|
5044
|
-
}
|
|
5045
|
-
|
|
5046
|
-
/***/ }),
|
|
5047
|
-
|
|
5048
|
-
/***/ 5:
|
|
5049
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5050
|
-
|
|
5051
|
-
"use strict";
|
|
5052
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
5053
|
-
/* globals __VUE_SSR_CONTEXT__ */
|
|
5054
|
-
|
|
5055
|
-
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
5056
|
-
// This module is a runtime utility for cleaner component module output and will
|
|
5057
|
-
// be included in the final webpack user bundle.
|
|
5058
|
-
|
|
5059
|
-
function normalizeComponent(
|
|
5060
|
-
scriptExports,
|
|
5061
|
-
render,
|
|
5062
|
-
staticRenderFns,
|
|
5063
|
-
functionalTemplate,
|
|
5064
|
-
injectStyles,
|
|
5065
|
-
scopeId,
|
|
5066
|
-
moduleIdentifier /* server only */,
|
|
5067
|
-
shadowMode /* vue-cli only */
|
|
5068
|
-
) {
|
|
5069
|
-
// Vue.extend constructor export interop
|
|
5070
|
-
var options =
|
|
5071
|
-
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
5072
|
-
|
|
5073
|
-
// render functions
|
|
5074
|
-
if (render) {
|
|
5075
|
-
options.render = render
|
|
5076
|
-
options.staticRenderFns = staticRenderFns
|
|
5077
|
-
options._compiled = true
|
|
5078
|
-
}
|
|
5079
|
-
|
|
5080
|
-
// functional template
|
|
5081
|
-
if (functionalTemplate) {
|
|
5082
|
-
options.functional = true
|
|
5083
|
-
}
|
|
5084
|
-
|
|
5085
|
-
// scopedId
|
|
5086
|
-
if (scopeId) {
|
|
5087
|
-
options._scopeId = 'data-v-' + scopeId
|
|
5088
|
-
}
|
|
5089
|
-
|
|
5090
|
-
var hook
|
|
5091
|
-
if (moduleIdentifier) {
|
|
5092
|
-
// server build
|
|
5093
|
-
hook = function (context) {
|
|
5094
|
-
// 2.3 injection
|
|
5095
|
-
context =
|
|
5096
|
-
context || // cached call
|
|
5097
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
5098
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
5099
|
-
// 2.2 with runInNewContext: true
|
|
5100
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
5101
|
-
context = __VUE_SSR_CONTEXT__
|
|
5102
|
-
}
|
|
5103
|
-
// inject component styles
|
|
5104
|
-
if (injectStyles) {
|
|
5105
|
-
injectStyles.call(this, context)
|
|
5106
|
-
}
|
|
5107
|
-
// register component module identifier for async chunk inferrence
|
|
5108
|
-
if (context && context._registeredComponents) {
|
|
5109
|
-
context._registeredComponents.add(moduleIdentifier)
|
|
5110
|
-
}
|
|
5111
|
-
}
|
|
5112
|
-
// used by ssr in case component is cached and beforeCreate
|
|
5113
|
-
// never gets called
|
|
5114
|
-
options._ssrRegister = hook
|
|
5115
|
-
} else if (injectStyles) {
|
|
5116
|
-
hook = shadowMode
|
|
5117
|
-
? function () {
|
|
5118
|
-
injectStyles.call(
|
|
5119
|
-
this,
|
|
5120
|
-
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
5121
|
-
)
|
|
5122
|
-
}
|
|
5123
|
-
: injectStyles
|
|
5124
|
-
}
|
|
5125
|
-
|
|
5126
|
-
if (hook) {
|
|
5127
|
-
if (options.functional) {
|
|
5128
|
-
// for template-only hot-reload because in that case the render fn doesn't
|
|
5129
|
-
// go through the normalizer
|
|
5130
|
-
options._injectStyles = hook
|
|
5131
|
-
// register for functional component in vue file
|
|
5132
|
-
var originalRender = options.render
|
|
5133
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
5134
|
-
hook.call(context)
|
|
5135
|
-
return originalRender(h, context)
|
|
5136
|
-
}
|
|
5137
|
-
} else {
|
|
5138
|
-
// inject component registration as beforeCreate hook
|
|
5139
|
-
var existing = options.beforeCreate
|
|
5140
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
5141
|
-
}
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
|
-
return {
|
|
5145
|
-
exports: scriptExports,
|
|
5146
|
-
options: options
|
|
5147
|
-
}
|
|
5148
|
-
}
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
/***/ }),
|
|
5152
|
-
|
|
5153
|
-
/***/ 6:
|
|
5154
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5155
|
-
|
|
5156
3013
|
"use strict";
|
|
5157
3014
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return fecha; });
|
|
5158
3015
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return getSettings; });
|
|
@@ -6029,114 +3886,2355 @@ const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
|
|
|
6029
3886
|
};
|
|
6030
3887
|
|
|
6031
3888
|
/**
|
|
6032
|
-
* 获取小时
|
|
6033
|
-
* @date 2022年5月7日
|
|
6034
|
-
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
6035
|
-
* @returns {number} 小时数(0-23)
|
|
6036
|
-
*/
|
|
6037
|
-
const getHour = function (date) {
|
|
6038
|
-
if (!date) {
|
|
6039
|
-
return new Date().getHours();
|
|
6040
|
-
}
|
|
6041
|
-
if (typeof date === 'string') {
|
|
6042
|
-
date = new Date(date);
|
|
6043
|
-
}
|
|
6044
|
-
return date.getHours();
|
|
6045
|
-
};
|
|
6046
|
-
|
|
3889
|
+
* 获取小时
|
|
3890
|
+
* @date 2022年5月7日
|
|
3891
|
+
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
3892
|
+
* @returns {number} 小时数(0-23)
|
|
3893
|
+
*/
|
|
3894
|
+
const getHour = function (date) {
|
|
3895
|
+
if (!date) {
|
|
3896
|
+
return new Date().getHours();
|
|
3897
|
+
}
|
|
3898
|
+
if (typeof date === 'string') {
|
|
3899
|
+
date = new Date(date);
|
|
3900
|
+
}
|
|
3901
|
+
return date.getHours();
|
|
3902
|
+
};
|
|
3903
|
+
|
|
3904
|
+
/**
|
|
3905
|
+
* 获取分钟
|
|
3906
|
+
* @date 2022年5月7日
|
|
3907
|
+
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
3908
|
+
* @returns {number} 分钟数(0-59)
|
|
3909
|
+
*/
|
|
3910
|
+
const getMinute = function (date) {
|
|
3911
|
+
if (!date) {
|
|
3912
|
+
return new Date().getMinutes();
|
|
3913
|
+
}
|
|
3914
|
+
if (typeof date === 'string') {
|
|
3915
|
+
date = new Date(date);
|
|
3916
|
+
}
|
|
3917
|
+
return date.getMinutes();
|
|
3918
|
+
};
|
|
3919
|
+
|
|
3920
|
+
/**
|
|
3921
|
+
* 获取月份
|
|
3922
|
+
* @date 2022年5月7日
|
|
3923
|
+
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
3924
|
+
* @returns {number} 月份数(1-12)
|
|
3925
|
+
*/
|
|
3926
|
+
const getMonth = function (date) {
|
|
3927
|
+
if (!date) {
|
|
3928
|
+
return new Date().getMonth() + 1;
|
|
3929
|
+
}
|
|
3930
|
+
if (typeof date === 'string') {
|
|
3931
|
+
date = new Date(date);
|
|
3932
|
+
}
|
|
3933
|
+
return date.getMonth() + 1;
|
|
3934
|
+
};
|
|
3935
|
+
|
|
3936
|
+
/**
|
|
3937
|
+
* 获取秒
|
|
3938
|
+
* @date 2022年5月7日
|
|
3939
|
+
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
3940
|
+
* @returns {number} 秒数(0-59)
|
|
3941
|
+
*/
|
|
3942
|
+
const getSecond = function (date) {
|
|
3943
|
+
if (!date) {
|
|
3944
|
+
return new Date().getSeconds();
|
|
3945
|
+
}
|
|
3946
|
+
if (typeof date === 'string') {
|
|
3947
|
+
date = new Date(date);
|
|
3948
|
+
}
|
|
3949
|
+
return date.getSeconds();
|
|
3950
|
+
};
|
|
3951
|
+
|
|
3952
|
+
/**
|
|
3953
|
+
* 获取星期几
|
|
3954
|
+
* @date 2022年5月7日
|
|
3955
|
+
* @param {Date|string} [date] - 日期对象或日期字符串
|
|
3956
|
+
* @returns {number} 星期几(0-6,0表示星期日)
|
|
3957
|
+
*/
|
|
3958
|
+
const getWeekday = function (date) {
|
|
3959
|
+
if (!date) {
|
|
3960
|
+
return new Date().getDay();
|
|
3961
|
+
}
|
|
3962
|
+
if (typeof date === 'string') {
|
|
3963
|
+
date = new Date(date);
|
|
3964
|
+
}
|
|
3965
|
+
return date.getDay();
|
|
3966
|
+
};
|
|
3967
|
+
|
|
3968
|
+
|
|
3969
|
+
/**
|
|
3970
|
+
* @desc 获取上午/下午/晚上
|
|
3971
|
+
* @author huangbo
|
|
3972
|
+
* @date 2022年5月7日
|
|
3973
|
+
* @param {String} [time] - 时间
|
|
3974
|
+
**/
|
|
3975
|
+
const timeCycle = function (time) {
|
|
3976
|
+
let hour = 0;
|
|
3977
|
+
if (!time) {
|
|
3978
|
+
hour = new Date().getHours();
|
|
3979
|
+
} else if (typeof time === 'string') {
|
|
3980
|
+
// 从时间字符串中提取小时
|
|
3981
|
+
const match = time.match(/^(\d{1,2})/);
|
|
3982
|
+
if (match) {
|
|
3983
|
+
hour = parseInt(match[1], 10);
|
|
3984
|
+
}
|
|
3985
|
+
} else if (typeof time === 'number') {
|
|
3986
|
+
hour = time;
|
|
3987
|
+
}
|
|
3988
|
+
// 判断时间段
|
|
3989
|
+
if (hour >= 5 && hour < 12) {
|
|
3990
|
+
return '上午';
|
|
3991
|
+
} else if (hour >= 12 && hour < 18) {
|
|
3992
|
+
return '下午';
|
|
3993
|
+
} else {
|
|
3994
|
+
return '晚上';
|
|
3995
|
+
}
|
|
3996
|
+
};
|
|
3997
|
+
|
|
3998
|
+
/***/ }),
|
|
3999
|
+
|
|
4000
|
+
/***/ 13:
|
|
4001
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4002
|
+
|
|
4003
|
+
"use strict";
|
|
4004
|
+
/* unused harmony export getHue */
|
|
4005
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
|
|
4006
|
+
/* unused harmony export getLightness */
|
|
4007
|
+
/* unused harmony export getSaturation */
|
|
4008
|
+
/* unused harmony export rgbToHsv */
|
|
4009
|
+
/* unused harmony export hsvTorgb */
|
|
4010
|
+
/* unused harmony export mixColor */
|
|
4011
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
|
|
4012
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
4013
|
+
|
|
4014
|
+
var $hueStep = 2;
|
|
4015
|
+
var $saturationStep1 = 0.16;
|
|
4016
|
+
var $saturationStep2 = 0.05;
|
|
4017
|
+
var $brightnessStep1 = 0.05;
|
|
4018
|
+
var $brightnessStep2 = 0.15;
|
|
4019
|
+
var $lightColorCount = 5;
|
|
4020
|
+
var $darkColorCount = 4;
|
|
4021
|
+
/**
|
|
4022
|
+
* getHue
|
|
4023
|
+
* @desc:转换色相
|
|
4024
|
+
* @author huangbo
|
|
4025
|
+
* @date 2022年5月7日
|
|
4026
|
+
**/
|
|
4027
|
+
var getHue = function getHue($h, $i, $isLight) {
|
|
4028
|
+
var $hue = void 0;
|
|
4029
|
+
if ($h >= 60 && $h <= 240) {
|
|
4030
|
+
$hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
|
|
4031
|
+
} else {
|
|
4032
|
+
$hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
|
|
4033
|
+
}
|
|
4034
|
+
$hue = ($hue + 360) % 360;
|
|
4035
|
+
return Math.round($hue);
|
|
4036
|
+
};
|
|
4037
|
+
|
|
4038
|
+
/**
|
|
4039
|
+
* getColor
|
|
4040
|
+
* @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
|
|
4041
|
+
* @author huangbo
|
|
4042
|
+
* @date 2022年5月7日
|
|
4043
|
+
**/
|
|
4044
|
+
var getColor = function getColor($color, $n) {
|
|
4045
|
+
var $isLight = $n < 7;
|
|
4046
|
+
var $hsv = rgbToHsv($color);
|
|
4047
|
+
// 这里将i转换成以主色为中心,两侧的i值逐渐增大
|
|
4048
|
+
var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
|
|
4049
|
+
var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
|
|
4050
|
+
return color;
|
|
4051
|
+
};
|
|
4052
|
+
|
|
4053
|
+
/**
|
|
4054
|
+
* getLightness
|
|
4055
|
+
* @desc:转换明度
|
|
4056
|
+
* @author huangbo
|
|
4057
|
+
* @date 2022年5月7日
|
|
4058
|
+
* @return {string,array} 元素类名或者id
|
|
4059
|
+
**/
|
|
4060
|
+
var getLightness = function getLightness($v, $i, $isLight) {
|
|
4061
|
+
var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
|
|
4062
|
+
$value = $value < 1 ? $value : 1;
|
|
4063
|
+
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
|
|
4064
|
+
};
|
|
4065
|
+
|
|
4066
|
+
/**
|
|
4067
|
+
* getSaturation
|
|
4068
|
+
* @desc:转换饱和度
|
|
4069
|
+
* @author huangbo
|
|
4070
|
+
* @date 2022年5月7日
|
|
4071
|
+
**/
|
|
4072
|
+
var getSaturation = function getSaturation($s, $i, $isLight) {
|
|
4073
|
+
var $saturation = void 0;
|
|
4074
|
+
if ($isLight) {
|
|
4075
|
+
$saturation = $s - $saturationStep1 * $i;
|
|
4076
|
+
} else if ($i === $darkColorCount) {
|
|
4077
|
+
$saturation = $s + $saturationStep1;
|
|
4078
|
+
} else {
|
|
4079
|
+
$saturation = $s + $saturationStep2 * $i;
|
|
4080
|
+
}
|
|
4081
|
+
$saturation = $saturation < 1 ? $saturation : 1;
|
|
4082
|
+
|
|
4083
|
+
if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
|
|
4084
|
+
$saturation = 0.1;
|
|
4085
|
+
}
|
|
4086
|
+
$saturation = $saturation > 0.06 ? $saturation : 0.06;
|
|
4087
|
+
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
|
|
4088
|
+
};
|
|
4089
|
+
|
|
4090
|
+
/**
|
|
4091
|
+
* rgbToHsv
|
|
4092
|
+
* @desc:rgb转化成hsv
|
|
4093
|
+
* @author huangbo
|
|
4094
|
+
* @date 2022年5月7日
|
|
4095
|
+
* @param {string} [$color] - 颜色值
|
|
4096
|
+
**/
|
|
4097
|
+
var rgbToHsv = function rgbToHsv($color) {
|
|
4098
|
+
var rgb = getRgb($color);
|
|
4099
|
+
var $red = rgb[0];
|
|
4100
|
+
var $green = rgb[1];
|
|
4101
|
+
var $blue = rgb[2];
|
|
4102
|
+
var $max = Math.max($red, $green, $blue);
|
|
4103
|
+
var $min = Math.min($red, $green, $blue);
|
|
4104
|
+
var $diff = $max - $min;
|
|
4105
|
+
var $h = 0;
|
|
4106
|
+
if ($max === $min) {
|
|
4107
|
+
$h = 0;
|
|
4108
|
+
} else if ($max === $red) {
|
|
4109
|
+
$h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
|
|
4110
|
+
} else if ($max === $green) {
|
|
4111
|
+
$h = 60 * ($blue - $red) / $diff + 120;
|
|
4112
|
+
} else if ($max === $blue) {
|
|
4113
|
+
$h = 60 * ($red - $green) / $diff + 240;
|
|
4114
|
+
}
|
|
4115
|
+
var $s = $max === 0 ? 0 : $diff / $max;
|
|
4116
|
+
var $v = $max / 255;
|
|
4117
|
+
return [$h, $s, $v];
|
|
4118
|
+
};
|
|
4119
|
+
|
|
4120
|
+
/**
|
|
4121
|
+
* hsvTorgb
|
|
4122
|
+
* @desc:hsv转化成rgb
|
|
4123
|
+
* @author huangbo
|
|
4124
|
+
* @date 2022年5月7日
|
|
4125
|
+
* @param {string} [$color] - 颜色值
|
|
4126
|
+
**/
|
|
4127
|
+
var hsvTorgb = function hsvTorgb($h, $s, $v) {
|
|
4128
|
+
var $th = Math.floor($h / 60);
|
|
4129
|
+
var $t1 = $h / 60 - $th;
|
|
4130
|
+
var $t2 = $v * (1 - $s);
|
|
4131
|
+
var $t3 = $v * (1 - $t1 * $s);
|
|
4132
|
+
var $t4 = $v * (1 - (1 - $t1) * $s);
|
|
4133
|
+
var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
|
|
4134
|
+
var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
|
|
4135
|
+
var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
|
|
4136
|
+
// return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
|
|
4137
|
+
var red = Math.round($r * 255);
|
|
4138
|
+
var green = Math.round($g * 255);
|
|
4139
|
+
var blue = Math.round($b * 255);
|
|
4140
|
+
red = red.toString(16);
|
|
4141
|
+
green = green.toString(16);
|
|
4142
|
+
blue = blue.toString(16);
|
|
4143
|
+
red = red.length === 1 ? '0' + red : red;
|
|
4144
|
+
green = green.length === 1 ? '0' + green : green;
|
|
4145
|
+
blue = blue.length === 1 ? '0' + blue : blue;
|
|
4146
|
+
return '#' + red + green + blue;
|
|
4147
|
+
};
|
|
4148
|
+
|
|
4149
|
+
/**
|
|
4150
|
+
* mixColor
|
|
4151
|
+
* @desc:生成混合色
|
|
4152
|
+
* @author huangbo
|
|
4153
|
+
* @date 2022年5月7日
|
|
4154
|
+
* @param {string} [$color1] - 颜色值
|
|
4155
|
+
* @param {string} [$color2] - 颜色值
|
|
4156
|
+
* @param {string} [$n] - 百分比 0~1
|
|
4157
|
+
**/
|
|
4158
|
+
var mixColor = function mixColor($color1, $color2, $n) {
|
|
4159
|
+
var rgb1 = getRgb($color1);
|
|
4160
|
+
var rgb2 = getRgb($color2);
|
|
4161
|
+
var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
|
|
4162
|
+
var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
|
|
4163
|
+
var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
|
|
4164
|
+
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
4165
|
+
};
|
|
4166
|
+
|
|
4167
|
+
/**
|
|
4168
|
+
* getRgb
|
|
4169
|
+
* @desc:获取颜色值的rgb值
|
|
4170
|
+
* @author huangbo
|
|
4171
|
+
* @date 2022年5月7日
|
|
4172
|
+
* @param {string} [$color] - 颜色值
|
|
4173
|
+
**/
|
|
4174
|
+
var getRgb = function getRgb($color) {
|
|
4175
|
+
var rgb = [];
|
|
4176
|
+
// 16进制颜色值的正则
|
|
4177
|
+
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
4178
|
+
// 把颜色值变成小写
|
|
4179
|
+
$color = $color.toLowerCase();
|
|
4180
|
+
if (reg.test($color)) {
|
|
4181
|
+
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
|
|
4182
|
+
if ($color.length === 4) {
|
|
4183
|
+
var colorNew = '#';
|
|
4184
|
+
for (var i = 1; i < 4; i++) {
|
|
4185
|
+
colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
|
|
4186
|
+
}
|
|
4187
|
+
$color = colorNew;
|
|
4188
|
+
}
|
|
4189
|
+
// 处理六位的颜色值,转为RGB
|
|
4190
|
+
for (var _i = 1; _i < 7; _i += 2) {
|
|
4191
|
+
rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
|
|
4192
|
+
}
|
|
4193
|
+
} else {
|
|
4194
|
+
rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
|
|
4195
|
+
}
|
|
4196
|
+
return rgb;
|
|
4197
|
+
};
|
|
4198
|
+
|
|
4199
|
+
/***/ }),
|
|
4200
|
+
|
|
4201
|
+
/***/ 173:
|
|
4202
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4203
|
+
|
|
4204
|
+
"use strict";
|
|
4205
|
+
// ESM COMPAT FLAG
|
|
4206
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4207
|
+
|
|
4208
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/ca-login/src/ca-login.vue?vue&type=template&id=53eb9ede&
|
|
4209
|
+
var render = function () {
|
|
4210
|
+
var _vm = this
|
|
4211
|
+
var _h = _vm.$createElement
|
|
4212
|
+
var _c = _vm._self._c || _h
|
|
4213
|
+
return _c(
|
|
4214
|
+
"es-button",
|
|
4215
|
+
_vm._b(
|
|
4216
|
+
{
|
|
4217
|
+
directives: [
|
|
4218
|
+
{
|
|
4219
|
+
name: "show",
|
|
4220
|
+
rawName: "v-show",
|
|
4221
|
+
value: _vm.$slots.default,
|
|
4222
|
+
expression: "$slots.default",
|
|
4223
|
+
},
|
|
4224
|
+
],
|
|
4225
|
+
staticClass: "es-ca-login",
|
|
4226
|
+
on: { click: _vm.getCertificate },
|
|
4227
|
+
},
|
|
4228
|
+
"es-button",
|
|
4229
|
+
_vm.$attrs,
|
|
4230
|
+
false
|
|
4231
|
+
),
|
|
4232
|
+
[_vm._t("default")],
|
|
4233
|
+
2
|
|
4234
|
+
)
|
|
4235
|
+
}
|
|
4236
|
+
var staticRenderFns = []
|
|
4237
|
+
render._withStripped = true
|
|
4238
|
+
|
|
4239
|
+
|
|
4240
|
+
// CONCATENATED MODULE: ./packages/ca-login/src/ca-login.vue?vue&type=template&id=53eb9ede&
|
|
4241
|
+
|
|
4242
|
+
// EXTERNAL MODULE: external "eoss/lib/message-box"
|
|
4243
|
+
var message_box_ = __webpack_require__(8);
|
|
4244
|
+
var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
4245
|
+
|
|
4246
|
+
// EXTERNAL MODULE: ./src/utils/util.js
|
|
4247
|
+
var util = __webpack_require__(0);
|
|
4248
|
+
|
|
4249
|
+
// CONCATENATED MODULE: ./packages/ca-login/src/plugin.js
|
|
4250
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
4251
|
+
|
|
4252
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4253
|
+
|
|
4254
|
+
/**
|
|
4255
|
+
* JIT_GW_ExtInterface 模块,提供与客户端交互的功能
|
|
4256
|
+
*/
|
|
4257
|
+
var CA_ExtInterface = function () {
|
|
4258
|
+
function CA_ExtInterface() {
|
|
4259
|
+
_classCallCheck(this, CA_ExtInterface);
|
|
4260
|
+
|
|
4261
|
+
this.currentSessionWSURL = '';
|
|
4262
|
+
this.useActioveX = false;
|
|
4263
|
+
this.options = {};
|
|
4264
|
+
this.webSocket = null;
|
|
4265
|
+
this.init();
|
|
4266
|
+
}
|
|
4267
|
+
|
|
4268
|
+
/**
|
|
4269
|
+
* 简单的 Object.assign 兼容 IE <= 11 的 polyfill
|
|
4270
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
4271
|
+
* @param {Object} target - 目标对象
|
|
4272
|
+
* @param {Object} options - 新的选项对象
|
|
4273
|
+
*/
|
|
4274
|
+
|
|
4275
|
+
|
|
4276
|
+
CA_ExtInterface.prototype.extendOptions = function extendOptions(target, options) {
|
|
4277
|
+
if (typeof Object.assign === 'function') {
|
|
4278
|
+
Object.assign(target, options);
|
|
4279
|
+
} else {
|
|
4280
|
+
// 兼容 IE < 11
|
|
4281
|
+
for (var key in options) {
|
|
4282
|
+
target[key] = options[key];
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
};
|
|
4286
|
+
|
|
4287
|
+
/**
|
|
4288
|
+
* 检查当前会话的 WebSocket URL
|
|
4289
|
+
*/
|
|
4290
|
+
|
|
4291
|
+
|
|
4292
|
+
CA_ExtInterface.prototype.checkSessionWSURL = function checkSessionWSURL() {
|
|
4293
|
+
if (this.currentSessionWSURL === '') {
|
|
4294
|
+
if (document.location.protocol === 'https:') {
|
|
4295
|
+
this.currentSessionWSURL = this.sendAndWaitMessage('https://127.0.0.1:10087/', 'QueryService');
|
|
4296
|
+
} else {
|
|
4297
|
+
this.currentSessionWSURL = this.sendAndWaitMessage('http://127.0.0.1:10086/', 'QueryService');
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
};
|
|
4301
|
+
|
|
4302
|
+
/**
|
|
4303
|
+
* 检查是否使用 ActiveX
|
|
4304
|
+
*/
|
|
4305
|
+
|
|
4306
|
+
|
|
4307
|
+
CA_ExtInterface.prototype.isUseActioveX = function isUseActioveX() {
|
|
4308
|
+
if (!!window.ActiveXObject || 'ActiveXObject' in window) {
|
|
4309
|
+
this.useActioveX = true;
|
|
4310
|
+
} else {
|
|
4311
|
+
this.useActioveX = false;
|
|
4312
|
+
}
|
|
4313
|
+
};
|
|
4314
|
+
|
|
4315
|
+
/**
|
|
4316
|
+
* 扩展发送消息并等待响应
|
|
4317
|
+
* @param {string} operatorCmd - 操作命令
|
|
4318
|
+
* @param {string} sendMsg - 发送的消息
|
|
4319
|
+
* @returns {string} 响应消息
|
|
4320
|
+
*/
|
|
4321
|
+
|
|
4322
|
+
|
|
4323
|
+
CA_ExtInterface.prototype.sendAndWaitMessageEx = function sendAndWaitMessageEx(operatorCmd, sendMsg) {
|
|
4324
|
+
this.checkSessionWSURL();
|
|
4325
|
+
var strSendMsg = operatorCmd + ':' + sendMsg;
|
|
4326
|
+
return this.sendAndWaitMessage(this.currentSessionWSURL, strSendMsg);
|
|
4327
|
+
};
|
|
4328
|
+
|
|
4329
|
+
/**
|
|
4330
|
+
* 发送消息并等待响应
|
|
4331
|
+
* @param {string} wsurl - WebSocket URL
|
|
4332
|
+
* @param {string} sendMsg - 发送的消息
|
|
4333
|
+
* @returns {string} 响应消息
|
|
4334
|
+
*/
|
|
4335
|
+
|
|
4336
|
+
|
|
4337
|
+
CA_ExtInterface.prototype.sendAndWaitMessage = function sendAndWaitMessage(wsurl, sendMsg) {
|
|
4338
|
+
var ResultMsg = '{"value":""}';
|
|
4339
|
+
if (ResultMsg === wsurl) {
|
|
4340
|
+
return;
|
|
4341
|
+
}
|
|
4342
|
+
try {
|
|
4343
|
+
var globalXmlHttpRequest = new XMLHttpRequest();
|
|
4344
|
+
globalXmlHttpRequest.open('POST', wsurl, false);
|
|
4345
|
+
globalXmlHttpRequest.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
|
|
4346
|
+
globalXmlHttpRequest.send(sendMsg);
|
|
4347
|
+
ResultMsg = globalXmlHttpRequest.responseText;
|
|
4348
|
+
} catch (e) {
|
|
4349
|
+
this.currentSessionWSURL = '';
|
|
4350
|
+
if (this.options.onError) {
|
|
4351
|
+
this.options.onError.call(undefined, e);
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
return ResultMsg;
|
|
4355
|
+
};
|
|
4356
|
+
|
|
4357
|
+
/**
|
|
4358
|
+
* 配置选项
|
|
4359
|
+
* @param {Object} extendOption - 扩展选项
|
|
4360
|
+
*/
|
|
4361
|
+
|
|
4362
|
+
|
|
4363
|
+
CA_ExtInterface.prototype.config = function config(extendOption) {
|
|
4364
|
+
if (extendOption && (typeof extendOption === 'undefined' ? 'undefined' : _typeof(extendOption)) === 'object') {
|
|
4365
|
+
this.extendOptions(this.options, extendOption);
|
|
4366
|
+
}
|
|
4367
|
+
};
|
|
4368
|
+
|
|
4369
|
+
/**
|
|
4370
|
+
* 初始化
|
|
4371
|
+
*/
|
|
4372
|
+
|
|
4373
|
+
|
|
4374
|
+
CA_ExtInterface.prototype.init = function init() {
|
|
4375
|
+
this.isUseActioveX();
|
|
4376
|
+
};
|
|
4377
|
+
|
|
4378
|
+
/**
|
|
4379
|
+
* 返回客户端的版本
|
|
4380
|
+
* @returns {string} 客户端版本
|
|
4381
|
+
*/
|
|
4382
|
+
|
|
4383
|
+
|
|
4384
|
+
CA_ExtInterface.prototype.getClientVersion = function getClientVersion() {
|
|
4385
|
+
if (this.useActioveX) {
|
|
4386
|
+
return window.PNXClient.GetClientVersion();
|
|
4387
|
+
} else {
|
|
4388
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetClientVersion', ''));
|
|
4389
|
+
return result.value;
|
|
4390
|
+
}
|
|
4391
|
+
};
|
|
4392
|
+
|
|
4393
|
+
/**
|
|
4394
|
+
* 下载客户端程序并安装
|
|
4395
|
+
* @param {string} bstrURL - 下载地址
|
|
4396
|
+
* @param {string} bstrHashValue - 哈希值
|
|
4397
|
+
* @param {boolean} bSync - 是否同步安装
|
|
4398
|
+
* @param {boolean} bOnlySSO - 是否仅安装 SSO
|
|
4399
|
+
* @returns {number} 安装结果
|
|
4400
|
+
*/
|
|
4401
|
+
|
|
4402
|
+
|
|
4403
|
+
CA_ExtInterface.prototype.setupClient = function setupClient(bstrURL, bstrHashValue, bSync, bOnlySSO) {
|
|
4404
|
+
if (this.useActioveX) {
|
|
4405
|
+
return window.PNXClient.SetupClient(bstrURL, bstrHashValue, bSync, bOnlySSO);
|
|
4406
|
+
} else {
|
|
4407
|
+
var jsonstr = { 'strURL': bstrURL, 'strHashValue': bstrHashValue, 'bSync': bSync, 'bOnlySSO': bOnlySSO };
|
|
4408
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('SetupClient', JSON.stringify(jsonstr)));
|
|
4409
|
+
return result.value;
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
|
|
4413
|
+
/**
|
|
4414
|
+
* 获取硬件指纹信息
|
|
4415
|
+
* @param {number} dwSign - 签名
|
|
4416
|
+
* @param {string} strGateWayIP - 网关 IP
|
|
4417
|
+
* @returns {string} 硬件指纹信息
|
|
4418
|
+
*/
|
|
4419
|
+
|
|
4420
|
+
|
|
4421
|
+
CA_ExtInterface.prototype.getFinger = function getFinger(dwSign, strGateWayIP) {
|
|
4422
|
+
if (this.useActioveX) {
|
|
4423
|
+
return window.PNXClient.GetFinger(dwSign, strGateWayIP);
|
|
4424
|
+
} else {
|
|
4425
|
+
var jsonstr = { 'dwSign': dwSign, 'strGateWayIP': strGateWayIP };
|
|
4426
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetFinger', JSON.stringify(jsonstr)));
|
|
4427
|
+
return result.value;
|
|
4428
|
+
}
|
|
4429
|
+
};
|
|
4430
|
+
|
|
4431
|
+
/**
|
|
4432
|
+
* 设置转发策略和代填策略
|
|
4433
|
+
* @param {string} strProxyPolicy - 转发策略
|
|
4434
|
+
* @param {string} strSSOPolicy - 代填策略
|
|
4435
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
4436
|
+
* @returns {number} 设置结果
|
|
4437
|
+
*/
|
|
4438
|
+
|
|
4439
|
+
|
|
4440
|
+
CA_ExtInterface.prototype.setPolicy = function setPolicy(strProxyPolicy, strSSOPolicy, strGatewayAddress) {
|
|
4441
|
+
if (this.useActioveX) {
|
|
4442
|
+
return window.PNXClient.SetPolicy(strProxyPolicy, strSSOPolicy, strGatewayAddress);
|
|
4443
|
+
} else {
|
|
4444
|
+
var jsonstr = { 'strProxyPolicy': strProxyPolicy, 'strSSOPolicy': strSSOPolicy, 'strGatewayAddress': strGatewayAddress };
|
|
4445
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('SetPolicy', JSON.stringify(jsonstr)));
|
|
4446
|
+
return result.value;
|
|
4447
|
+
}
|
|
4448
|
+
};
|
|
4449
|
+
|
|
4450
|
+
/**
|
|
4451
|
+
* 启动认证信息模块
|
|
4452
|
+
* @param {string} strFileName - 文件名
|
|
4453
|
+
* @param {string} strXmlData - XML 数据
|
|
4454
|
+
* @returns {string} 认证信息
|
|
4455
|
+
*/
|
|
4456
|
+
|
|
4457
|
+
|
|
4458
|
+
CA_ExtInterface.prototype.getAuthToken = function getAuthToken(strFileName, strXmlData) {
|
|
4459
|
+
if (this.useActioveX) {
|
|
4460
|
+
return window.PNXClient.GetAuthToken(strFileName, strXmlData);
|
|
4461
|
+
} else {
|
|
4462
|
+
var jsonstr = { 'strFileName': strFileName, 'strXmlData': strXmlData };
|
|
4463
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetAuthToken', JSON.stringify(jsonstr)));
|
|
4464
|
+
return result.value;
|
|
4465
|
+
}
|
|
4466
|
+
};
|
|
4467
|
+
|
|
4468
|
+
/**
|
|
4469
|
+
* 打开 BS 应用
|
|
4470
|
+
* @param {string} strUrl - 应用 URL
|
|
4471
|
+
* @returns {number} 打开结果
|
|
4472
|
+
*/
|
|
4473
|
+
|
|
4474
|
+
|
|
4475
|
+
CA_ExtInterface.prototype.navigateURL = function navigateURL(strUrl) {
|
|
4476
|
+
if (this.useActioveX) {
|
|
4477
|
+
return window.PNXClient.NavigateURL(strUrl);
|
|
4478
|
+
} else {
|
|
4479
|
+
var jsonstr = { 'strUrl': strUrl };
|
|
4480
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('NavigateURL', JSON.stringify(jsonstr)));
|
|
4481
|
+
return result.value;
|
|
4482
|
+
}
|
|
4483
|
+
};
|
|
4484
|
+
|
|
4485
|
+
/**
|
|
4486
|
+
* 打开 CS 应用
|
|
4487
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
4488
|
+
* @param {string} strAppFlag - 应用标识
|
|
4489
|
+
* @param {string} strAppPath - 应用路径
|
|
4490
|
+
* @returns {number} 打开结果
|
|
4491
|
+
*/
|
|
4492
|
+
|
|
4493
|
+
|
|
4494
|
+
CA_ExtInterface.prototype.executeCS = function executeCS(strGatewayAddress, strAppFlag, strAppPath) {
|
|
4495
|
+
if (this.useActioveX) {
|
|
4496
|
+
return window.PNXClient.ExecuteCS(strGatewayAddress, strAppFlag, strAppPath);
|
|
4497
|
+
} else {
|
|
4498
|
+
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'strAppFlag': strAppFlag, 'strAppPath': strAppPath };
|
|
4499
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('ExecuteCS', JSON.stringify(jsonstr)));
|
|
4500
|
+
return result.value;
|
|
4501
|
+
}
|
|
4502
|
+
};
|
|
4503
|
+
|
|
4504
|
+
/**
|
|
4505
|
+
* 设置自动更新策略
|
|
4506
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
4507
|
+
* @param {number} nGatewayPort - 网关端口
|
|
4508
|
+
* @param {string} strUserToken - 用户令牌
|
|
4509
|
+
* @param {number} updatedelay - 更新延迟
|
|
4510
|
+
* @returns {number} 设置结果
|
|
4511
|
+
*/
|
|
4512
|
+
|
|
4513
|
+
|
|
4514
|
+
CA_ExtInterface.prototype.setUpdatePolicy = function setUpdatePolicy(strGatewayAddress, nGatewayPort, strUserToken, updatedelay) {
|
|
4515
|
+
if (this.useActioveX) {
|
|
4516
|
+
return window.PNXClient.SetUpdatePolicy(strGatewayAddress, nGatewayPort, strUserToken, updatedelay);
|
|
4517
|
+
} else {
|
|
4518
|
+
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'nGatewayPort': nGatewayPort, 'strUserToken': strUserToken, 'ulUpdateDelay': updatedelay };
|
|
4519
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('SetUpdatePolicy', JSON.stringify(jsonstr)));
|
|
4520
|
+
return result.value;
|
|
4521
|
+
}
|
|
4522
|
+
};
|
|
4523
|
+
|
|
4524
|
+
/**
|
|
4525
|
+
* 获取客户端 IP
|
|
4526
|
+
* @param {string} strGatewayIP - 网关 IP
|
|
4527
|
+
* @returns {string} 客户端 IP
|
|
4528
|
+
*/
|
|
4529
|
+
|
|
4530
|
+
|
|
4531
|
+
CA_ExtInterface.prototype.getClientIP = function getClientIP(strGatewayIP) {
|
|
4532
|
+
if (this.useActioveX) {
|
|
4533
|
+
return window.PNXClient.GetClientIP(strGatewayIP);
|
|
4534
|
+
} else {
|
|
4535
|
+
var jsonstr = { 'strGatewayIP': strGatewayIP };
|
|
4536
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetClientIP', JSON.stringify(jsonstr)));
|
|
4537
|
+
return result.value;
|
|
4538
|
+
}
|
|
4539
|
+
};
|
|
4540
|
+
|
|
4541
|
+
/**
|
|
4542
|
+
* 登出网关
|
|
4543
|
+
* @param {string} strServerIP - 服务器 IP
|
|
4544
|
+
* @returns {number} 登出结果
|
|
4545
|
+
*/
|
|
4546
|
+
|
|
4547
|
+
|
|
4548
|
+
CA_ExtInterface.prototype.gwLogout = function gwLogout(strServerIP) {
|
|
4549
|
+
if (this.useActioveX) {
|
|
4550
|
+
return window.PNXClient.GWLogout(strServerIP);
|
|
4551
|
+
} else {
|
|
4552
|
+
var jsonstr = { 'strServerIP': strServerIP };
|
|
4553
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GWLogout', JSON.stringify(jsonstr)));
|
|
4554
|
+
return result.value;
|
|
4555
|
+
}
|
|
4556
|
+
};
|
|
4557
|
+
|
|
4558
|
+
/**
|
|
4559
|
+
* 运行安装包
|
|
4560
|
+
* @param {number} lRunType - 运行类型
|
|
4561
|
+
* @param {boolean} bIsOnlySSO - 是否仅安装 SSO
|
|
4562
|
+
* @returns {number} 运行结果
|
|
4563
|
+
*/
|
|
4564
|
+
|
|
4565
|
+
|
|
4566
|
+
CA_ExtInterface.prototype.runSetup = function runSetup(lRunType, bIsOnlySSO) {
|
|
4567
|
+
if (this.useActioveX) {
|
|
4568
|
+
return window.PNXClient.RunSetup(lRunType, bIsOnlySSO);
|
|
4569
|
+
} else {
|
|
4570
|
+
var jsonstr = { 'lRunType': lRunType, 'bIsOnlySSO': bIsOnlySSO };
|
|
4571
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('RunSetup', JSON.stringify(jsonstr)));
|
|
4572
|
+
return result.value;
|
|
4573
|
+
}
|
|
4574
|
+
};
|
|
4575
|
+
|
|
4576
|
+
/**
|
|
4577
|
+
* 获取下载进度
|
|
4578
|
+
* @returns {number} 下载进度
|
|
4579
|
+
*/
|
|
4580
|
+
|
|
4581
|
+
|
|
4582
|
+
CA_ExtInterface.prototype.getDownloadProgress = function getDownloadProgress() {
|
|
4583
|
+
if (this.useActioveX) {
|
|
4584
|
+
return window.PNXClient.GetDownloadProgress();
|
|
4585
|
+
} else {
|
|
4586
|
+
var jsonstr = '';
|
|
4587
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetDownloadProgress', jsonstr));
|
|
4588
|
+
return result.value;
|
|
4589
|
+
}
|
|
4590
|
+
};
|
|
4591
|
+
|
|
4592
|
+
/**
|
|
4593
|
+
* 是否安装完成
|
|
4594
|
+
* @returns {boolean} 安装完成状态
|
|
4595
|
+
*/
|
|
4596
|
+
|
|
4597
|
+
|
|
4598
|
+
CA_ExtInterface.prototype.isInstallComplete = function isInstallComplete() {
|
|
4599
|
+
if (this.useActioveX) {
|
|
4600
|
+
return window.PNXClient.IsInstallComplete();
|
|
4601
|
+
} else {
|
|
4602
|
+
var jsonstr = '';
|
|
4603
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('IsInstallComplete', jsonstr));
|
|
4604
|
+
return result.value;
|
|
4605
|
+
}
|
|
4606
|
+
};
|
|
4607
|
+
|
|
4608
|
+
/**
|
|
4609
|
+
* 初始化签包对象
|
|
4610
|
+
* @param {string} strAlgType - 算法类型
|
|
4611
|
+
* @param {string} strAuxParam - 辅助参数
|
|
4612
|
+
* @returns {number} 初始化结果
|
|
4613
|
+
*/
|
|
4614
|
+
|
|
4615
|
+
|
|
4616
|
+
CA_ExtInterface.prototype.initialize = function initialize(strAlgType, strAuxParam) {
|
|
4617
|
+
if (this.useActioveX) {
|
|
4618
|
+
return window.PNXClient.Initialize(strAlgType, strAuxParam);
|
|
4619
|
+
} else {
|
|
4620
|
+
var jsonstr = { 'strAlgType': strAlgType, 'strAuxParam': strAuxParam };
|
|
4621
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('Initialize', JSON.stringify(jsonstr)));
|
|
4622
|
+
return result.value;
|
|
4623
|
+
}
|
|
4624
|
+
};
|
|
4625
|
+
|
|
4626
|
+
/**
|
|
4627
|
+
* 设置摘要算法
|
|
4628
|
+
* @param {string} strDigestAlg - 摘要算法
|
|
4629
|
+
* @returns {number} 设置结果
|
|
4630
|
+
*/
|
|
4631
|
+
|
|
4632
|
+
|
|
4633
|
+
CA_ExtInterface.prototype.setDigestAlg = function setDigestAlg(strDigestAlg) {
|
|
4634
|
+
if (this.useActioveX) {
|
|
4635
|
+
return window.PNXClient.SetDigestAlg(strDigestAlg);
|
|
4636
|
+
} else {
|
|
4637
|
+
var jsonstr = { 'strDigestAlg': strDigestAlg };
|
|
4638
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('SetDigestAlg', JSON.stringify(jsonstr)));
|
|
4639
|
+
return result.value;
|
|
4640
|
+
}
|
|
4641
|
+
};
|
|
4642
|
+
|
|
4643
|
+
/**
|
|
4644
|
+
* 设置单证书是否弹出对话框
|
|
4645
|
+
* @param {number} isChoose - 是否弹出对话框
|
|
4646
|
+
* @returns {number} 设置结果
|
|
4647
|
+
*/
|
|
4648
|
+
|
|
4649
|
+
|
|
4650
|
+
CA_ExtInterface.prototype.setChooseSingleCert = function setChooseSingleCert(isChoose) {
|
|
4651
|
+
if (this.useActioveX) {
|
|
4652
|
+
return window.PNXClient.SetChooseSingleCert(isChoose);
|
|
4653
|
+
} else {
|
|
4654
|
+
var jsonstr = { 'isChoose': isChoose };
|
|
4655
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('SetChooseSingleCert', JSON.stringify(jsonstr)));
|
|
4656
|
+
return result.value;
|
|
4657
|
+
}
|
|
4658
|
+
};
|
|
4659
|
+
|
|
4660
|
+
/**
|
|
4661
|
+
* 添加证书过滤条件
|
|
4662
|
+
* @param {number} ulType - 过滤类型
|
|
4663
|
+
* @param {string} strValue - 过滤值
|
|
4664
|
+
* @returns {number} 添加结果
|
|
4665
|
+
*/
|
|
4666
|
+
|
|
4667
|
+
|
|
4668
|
+
CA_ExtInterface.prototype.addFilter = function addFilter(ulType, strValue) {
|
|
4669
|
+
if (this.useActioveX) {
|
|
4670
|
+
return window.PNXClient.AddFilter(ulType, strValue);
|
|
4671
|
+
} else {
|
|
4672
|
+
var jsonstr = { 'ulType': ulType, 'strValue': strValue };
|
|
4673
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('AddFilter', JSON.stringify(jsonstr)));
|
|
4674
|
+
return result.value;
|
|
4675
|
+
}
|
|
4676
|
+
};
|
|
4677
|
+
|
|
4678
|
+
/**
|
|
4679
|
+
* 清除所有过滤条件
|
|
4680
|
+
* @returns {number} 清除结果
|
|
4681
|
+
*/
|
|
4682
|
+
|
|
4683
|
+
|
|
4684
|
+
CA_ExtInterface.prototype.clearFilter = function clearFilter() {
|
|
4685
|
+
if (this.useActioveX) {
|
|
4686
|
+
return window.PNXClient.ClearFilter();
|
|
4687
|
+
} else {
|
|
4688
|
+
var jsonstr = '';
|
|
4689
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('ClearFilter', jsonstr));
|
|
4690
|
+
return result.value;
|
|
4691
|
+
}
|
|
4692
|
+
};
|
|
4693
|
+
|
|
4694
|
+
/**
|
|
4695
|
+
* P1 签名
|
|
4696
|
+
* @param {string} strValueBase64 - 待签名的 Base64 字符串
|
|
4697
|
+
* @returns {string} 签名结果
|
|
4698
|
+
*/
|
|
4699
|
+
|
|
4700
|
+
|
|
4701
|
+
CA_ExtInterface.prototype.p1Sign = function p1Sign(strValueBase64) {
|
|
4702
|
+
if (this.useActioveX) {
|
|
4703
|
+
return window.PNXClient.P1Sign(strValueBase64);
|
|
4704
|
+
} else {
|
|
4705
|
+
var jsonstr = { 'strValueBase64': strValueBase64 };
|
|
4706
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('P1Sign', JSON.stringify(jsonstr)));
|
|
4707
|
+
return result.value;
|
|
4708
|
+
}
|
|
4709
|
+
};
|
|
4710
|
+
|
|
4711
|
+
/**
|
|
4712
|
+
* P1 签名字符串
|
|
4713
|
+
* @param {string} strValue - 待签名的字符串
|
|
4714
|
+
* @returns {string} 签名结果
|
|
4715
|
+
*/
|
|
4716
|
+
|
|
4717
|
+
|
|
4718
|
+
CA_ExtInterface.prototype.p1SignString = function p1SignString(strValue) {
|
|
4719
|
+
if (this.useActioveX) {
|
|
4720
|
+
return window.PNXClient.P1SignString(strValue);
|
|
4721
|
+
} else {
|
|
4722
|
+
var jsonstr = { 'strValue': strValue };
|
|
4723
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('P1SignString', JSON.stringify(jsonstr)));
|
|
4724
|
+
return result.value;
|
|
4725
|
+
}
|
|
4726
|
+
};
|
|
4727
|
+
|
|
4728
|
+
/**
|
|
4729
|
+
* P7 签名
|
|
4730
|
+
* @param {string} strValueBase64 - 待签名的 Base64 字符串
|
|
4731
|
+
* @param {boolean} isDetach - 是否分离签名
|
|
4732
|
+
* @param {boolean} isIncludeCert - 是否包含证书
|
|
4733
|
+
* @returns {string} 签名结果
|
|
4734
|
+
*/
|
|
4735
|
+
|
|
4736
|
+
|
|
4737
|
+
CA_ExtInterface.prototype.p7Sign = function p7Sign(strValueBase64, isDetach, isIncludeCert) {
|
|
4738
|
+
if (this.useActioveX) {
|
|
4739
|
+
return window.PNXClient.P7Sign(strValueBase64, isDetach, isIncludeCert);
|
|
4740
|
+
} else {
|
|
4741
|
+
var jsonstr = { 'strValueBase64': strValueBase64, 'isDetach': isDetach, 'isIncludeCert': isIncludeCert };
|
|
4742
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('P7Sign', JSON.stringify(jsonstr)));
|
|
4743
|
+
return result.value;
|
|
4744
|
+
}
|
|
4745
|
+
};
|
|
4746
|
+
|
|
4747
|
+
/**
|
|
4748
|
+
* P7 签名字符串
|
|
4749
|
+
* @param {string} strValue - 待签名的字符串
|
|
4750
|
+
* @param {boolean} isDetach - 是否分离签名
|
|
4751
|
+
* @param {boolean} isIncludeCert - 是否包含证书
|
|
4752
|
+
* @returns {string} 签名结果
|
|
4753
|
+
*/
|
|
4754
|
+
|
|
4755
|
+
|
|
4756
|
+
CA_ExtInterface.prototype.p7SignString = function p7SignString(strValue, isDetach, isIncludeCert) {
|
|
4757
|
+
if (this.useActioveX) {
|
|
4758
|
+
return window.PNXClient.P7SignString(strValue, isDetach, isIncludeCert);
|
|
4759
|
+
} else {
|
|
4760
|
+
var jsonstr = { 'strValue': strValue, 'isDetach': isDetach, 'isIncludeCert': isIncludeCert };
|
|
4761
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('P7SignString', JSON.stringify(jsonstr)));
|
|
4762
|
+
return result.value;
|
|
4763
|
+
}
|
|
4764
|
+
};
|
|
4765
|
+
|
|
4766
|
+
/**
|
|
4767
|
+
* 释放签名对象
|
|
4768
|
+
* @returns {number} 释放结果
|
|
4769
|
+
*/
|
|
4770
|
+
|
|
4771
|
+
|
|
4772
|
+
CA_ExtInterface.prototype.finalize = function finalize() {
|
|
4773
|
+
if (this.useActioveX) {
|
|
4774
|
+
return window.PNXClient.Finalize();
|
|
4775
|
+
} else {
|
|
4776
|
+
var jsonstr = '';
|
|
4777
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('Finalize', jsonstr));
|
|
4778
|
+
return result.value;
|
|
4779
|
+
}
|
|
4780
|
+
};
|
|
4781
|
+
|
|
4782
|
+
/**
|
|
4783
|
+
* 获取签名版本
|
|
4784
|
+
* @returns {string} 签名版本
|
|
4785
|
+
*/
|
|
4786
|
+
|
|
4787
|
+
|
|
4788
|
+
CA_ExtInterface.prototype.getSignVersion = function getSignVersion() {
|
|
4789
|
+
if (this.useActioveX) {
|
|
4790
|
+
return window.PNXClient.GetSignVersion();
|
|
4791
|
+
} else {
|
|
4792
|
+
var jsonstr = '';
|
|
4793
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignVersion', jsonstr));
|
|
4794
|
+
return result.value;
|
|
4795
|
+
}
|
|
4796
|
+
};
|
|
4797
|
+
|
|
4798
|
+
/**
|
|
4799
|
+
* 获取签名证书
|
|
4800
|
+
* @returns {string} 签名证书
|
|
4801
|
+
*/
|
|
4802
|
+
|
|
4803
|
+
|
|
4804
|
+
CA_ExtInterface.prototype.getSignCert = function getSignCert() {
|
|
4805
|
+
if (this.useActioveX) {
|
|
4806
|
+
return window.PNXClient.GetSignCert();
|
|
4807
|
+
} else {
|
|
4808
|
+
var jsonstr = '';
|
|
4809
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignCert', jsonstr));
|
|
4810
|
+
return result.value;
|
|
4811
|
+
}
|
|
4812
|
+
};
|
|
4813
|
+
|
|
4814
|
+
/**
|
|
4815
|
+
* 获取错误码
|
|
4816
|
+
* @returns {number} 错误码
|
|
4817
|
+
*/
|
|
4818
|
+
|
|
4819
|
+
|
|
4820
|
+
CA_ExtInterface.prototype.getLastError = function getLastError() {
|
|
4821
|
+
if (this.useActioveX) {
|
|
4822
|
+
return window.PNXClient.GetLastError();
|
|
4823
|
+
} else {
|
|
4824
|
+
var jsonstr = '';
|
|
4825
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetLastError', jsonstr));
|
|
4826
|
+
return result.value;
|
|
4827
|
+
}
|
|
4828
|
+
};
|
|
4829
|
+
|
|
4830
|
+
/**
|
|
4831
|
+
* 获取错误信息
|
|
4832
|
+
* @returns {string} 错误信息
|
|
4833
|
+
*/
|
|
4834
|
+
|
|
4835
|
+
|
|
4836
|
+
CA_ExtInterface.prototype.getLastErrorMessage = function getLastErrorMessage() {
|
|
4837
|
+
if (this.useActioveX) {
|
|
4838
|
+
return window.PNXClient.GetLastErrorMessage();
|
|
4839
|
+
} else {
|
|
4840
|
+
var jsonstr = '';
|
|
4841
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetLastErrorMessage', jsonstr));
|
|
4842
|
+
return result.value;
|
|
4843
|
+
}
|
|
4844
|
+
};
|
|
4845
|
+
|
|
4846
|
+
/**
|
|
4847
|
+
* 销毁认证对象
|
|
4848
|
+
* @returns {number} 销毁结果
|
|
4849
|
+
*/
|
|
4850
|
+
|
|
4851
|
+
|
|
4852
|
+
CA_ExtInterface.prototype.destoryAuth = function destoryAuth() {
|
|
4853
|
+
if (this.useActioveX) {
|
|
4854
|
+
return window.PNXClient.DestoryAuth();
|
|
4855
|
+
} else {
|
|
4856
|
+
var jsonstr = '';
|
|
4857
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('DestoryAuth', jsonstr));
|
|
4858
|
+
return result.value;
|
|
4859
|
+
}
|
|
4860
|
+
};
|
|
4861
|
+
|
|
4862
|
+
/**
|
|
4863
|
+
* 获取证书类型
|
|
4864
|
+
* @returns {string} 证书类型
|
|
4865
|
+
*/
|
|
4866
|
+
|
|
4867
|
+
|
|
4868
|
+
CA_ExtInterface.prototype.getSignCertType = function getSignCertType() {
|
|
4869
|
+
if (this.useActioveX) {
|
|
4870
|
+
return window.PNXClient.GetSignCertType();
|
|
4871
|
+
} else {
|
|
4872
|
+
var jsonstr = '';
|
|
4873
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignCertType', jsonstr));
|
|
4874
|
+
return result.value;
|
|
4875
|
+
}
|
|
4876
|
+
};
|
|
4877
|
+
|
|
4878
|
+
/**
|
|
4879
|
+
* 获取签名摘要算法
|
|
4880
|
+
* @returns {string} 签名摘要算法
|
|
4881
|
+
*/
|
|
4882
|
+
|
|
4883
|
+
|
|
4884
|
+
CA_ExtInterface.prototype.getSignHash = function getSignHash() {
|
|
4885
|
+
if (this.useActioveX) {
|
|
4886
|
+
return window.PNXClient.GetSignHash();
|
|
4887
|
+
} else {
|
|
4888
|
+
var jsonstr = '';
|
|
4889
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetSignHash', jsonstr));
|
|
4890
|
+
return result.value;
|
|
4891
|
+
}
|
|
4892
|
+
};
|
|
4893
|
+
|
|
4894
|
+
/**
|
|
4895
|
+
* 使能调用序列
|
|
4896
|
+
* @param {boolean} bCallQueueEnable - 是否使能调用序列
|
|
4897
|
+
* @param {boolean} bHeadInfoEnable - 是否使能头部信息
|
|
4898
|
+
* @returns {number} 使能结果
|
|
4899
|
+
*/
|
|
4900
|
+
|
|
4901
|
+
|
|
4902
|
+
CA_ExtInterface.prototype.callQueueEnable = function callQueueEnable(bCallQueueEnable, bHeadInfoEnable) {
|
|
4903
|
+
if (this.useActioveX) {
|
|
4904
|
+
return window.PNXClient.CallQueueEnable(bCallQueueEnable, bHeadInfoEnable);
|
|
4905
|
+
} else {
|
|
4906
|
+
var jsonstr = { 'bCallQueueEnable': bCallQueueEnable, 'bHeadInfoEnable': bHeadInfoEnable };
|
|
4907
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('CallQueueEnable', JSON.stringify(jsonstr)));
|
|
4908
|
+
return result.value;
|
|
4909
|
+
}
|
|
4910
|
+
};
|
|
4911
|
+
|
|
4912
|
+
/**
|
|
4913
|
+
* 清空调用序列结果
|
|
4914
|
+
* @returns {number} 清空调用序列结果
|
|
4915
|
+
*/
|
|
4916
|
+
|
|
4917
|
+
|
|
4918
|
+
CA_ExtInterface.prototype.callQueueClear = function callQueueClear() {
|
|
4919
|
+
if (this.useActioveX) {
|
|
4920
|
+
return window.PNXClient.CallQueueClear();
|
|
4921
|
+
} else {
|
|
4922
|
+
var jsonstr = '';
|
|
4923
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('CallQueueClear', jsonstr));
|
|
4924
|
+
return result.value;
|
|
4925
|
+
}
|
|
4926
|
+
};
|
|
4927
|
+
|
|
4928
|
+
/**
|
|
4929
|
+
* 获取调用序列结果
|
|
4930
|
+
* @returns {string} 调用序列结果
|
|
4931
|
+
*/
|
|
4932
|
+
|
|
4933
|
+
|
|
4934
|
+
CA_ExtInterface.prototype.callQueueGet = function callQueueGet() {
|
|
4935
|
+
if (this.useActioveX) {
|
|
4936
|
+
return window.PNXClient.CallQueueGet();
|
|
4937
|
+
} else {
|
|
4938
|
+
var jsonstr = '';
|
|
4939
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('CallQueueGet', jsonstr));
|
|
4940
|
+
return result.value;
|
|
4941
|
+
}
|
|
4942
|
+
};
|
|
4943
|
+
|
|
4944
|
+
/**
|
|
4945
|
+
* 客户端安全策略检查
|
|
4946
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
4947
|
+
* @param {number} usGatewayPort - 网关端口
|
|
4948
|
+
* @param {string} strSecurityPolicys - 安全策略
|
|
4949
|
+
* @returns {boolean} 检查结果
|
|
4950
|
+
*/
|
|
4951
|
+
|
|
4952
|
+
|
|
4953
|
+
CA_ExtInterface.prototype.doClientSecurityCheck = function doClientSecurityCheck(strGatewayAddress, usGatewayPort, strSecurityPolicys) {
|
|
4954
|
+
if (this.useActioveX) {
|
|
4955
|
+
return window.PNXClient.DoClientSecurityCheck(strGatewayAddress, usGatewayPort, strSecurityPolicys);
|
|
4956
|
+
} else {
|
|
4957
|
+
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'usGatewayPort': usGatewayPort, 'strSecurityPolicys': strSecurityPolicys };
|
|
4958
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('DoClientSecurityCheck', JSON.stringify(jsonstr)));
|
|
4959
|
+
return result.value;
|
|
4960
|
+
}
|
|
4961
|
+
};
|
|
4962
|
+
|
|
4963
|
+
/**
|
|
4964
|
+
* 获取通讯协议版本
|
|
4965
|
+
* @returns {string} 通讯协议版本
|
|
4966
|
+
*/
|
|
4967
|
+
|
|
4968
|
+
|
|
4969
|
+
CA_ExtInterface.prototype.getProtocolVersion = function getProtocolVersion() {
|
|
4970
|
+
if (this.useActioveX) {
|
|
4971
|
+
return window.PNXClient.GetProtocolVersion();
|
|
4972
|
+
} else {
|
|
4973
|
+
var jsonstr = '';
|
|
4974
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetProtocolVersion', jsonstr));
|
|
4975
|
+
return result.value;
|
|
4976
|
+
}
|
|
4977
|
+
};
|
|
4978
|
+
|
|
4979
|
+
/**
|
|
4980
|
+
* 修改 Key 的 Pin 码
|
|
4981
|
+
* @param {string} strCertSn - 证书序列号
|
|
4982
|
+
* @param {number} lPinCodeType - Pin 码类型
|
|
4983
|
+
* @param {string} strCurPinCode - 当前 Pin 码
|
|
4984
|
+
* @param {string} strNewPinCode - 新 Pin 码
|
|
4985
|
+
* @returns {number} 修改结果
|
|
4986
|
+
*/
|
|
4987
|
+
|
|
4988
|
+
|
|
4989
|
+
CA_ExtInterface.prototype.changePinCode = function changePinCode(strCertSn, lPinCodeType, strCurPinCode, strNewPinCode) {
|
|
4990
|
+
if (this.useActioveX) {
|
|
4991
|
+
return window.PNXClient.ChangePinCode(strCertSn, lPinCodeType, strCurPinCode, strNewPinCode);
|
|
4992
|
+
} else {
|
|
4993
|
+
var jsonstr = { 'strCertSn': strCertSn, 'lPinCodeType': lPinCodeType, 'strCurPinCode': strCurPinCode, 'strNewPinCode': strNewPinCode };
|
|
4994
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('ChangePinCode', JSON.stringify(jsonstr)));
|
|
4995
|
+
return result.value;
|
|
4996
|
+
}
|
|
4997
|
+
};
|
|
4998
|
+
|
|
4999
|
+
/**
|
|
5000
|
+
* 等待策略设置完毕
|
|
5001
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
5002
|
+
* @returns {number} 等待结果
|
|
5003
|
+
*/
|
|
5004
|
+
|
|
5005
|
+
|
|
5006
|
+
CA_ExtInterface.prototype.waitSetPolicyFinish = function waitSetPolicyFinish(strGatewayAddress) {
|
|
5007
|
+
if (this.useActioveX) {
|
|
5008
|
+
return window.PNXClient.WaitSetPolicyFinish(strGatewayAddress);
|
|
5009
|
+
} else {
|
|
5010
|
+
var jsonstr = { 'strGatewayAddress': strGatewayAddress };
|
|
5011
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('WaitSetPolicyFinish', JSON.stringify(jsonstr)));
|
|
5012
|
+
return result.value;
|
|
5013
|
+
}
|
|
5014
|
+
};
|
|
5015
|
+
|
|
5016
|
+
/**
|
|
5017
|
+
* 获取会话 Token
|
|
5018
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
5019
|
+
* @returns {string} 会话 Token
|
|
5020
|
+
*/
|
|
5021
|
+
|
|
5022
|
+
|
|
5023
|
+
CA_ExtInterface.prototype.getSessionToken = function getSessionToken(strGatewayAddress) {
|
|
5024
|
+
if (this.useActioveX) {
|
|
5025
|
+
return window.PNXClient.GetSessionToken(strGatewayAddress);
|
|
5026
|
+
} else {
|
|
5027
|
+
var jsonstr = { 'strGatewayAddress': strGatewayAddress };
|
|
5028
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetSessionToken', JSON.stringify(jsonstr)));
|
|
5029
|
+
return result.value;
|
|
5030
|
+
}
|
|
5031
|
+
};
|
|
5032
|
+
|
|
5033
|
+
/**
|
|
5034
|
+
* 获取控件版本
|
|
5035
|
+
* @returns {string} 控件版本
|
|
5036
|
+
*/
|
|
5037
|
+
|
|
5038
|
+
|
|
5039
|
+
CA_ExtInterface.prototype.getVersion = function getVersion() {
|
|
5040
|
+
if (this.useActioveX) {
|
|
5041
|
+
return window.PNXClient.GetVersion();
|
|
5042
|
+
} else {
|
|
5043
|
+
var jsonstr = '';
|
|
5044
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetVersion', jsonstr));
|
|
5045
|
+
return result.value;
|
|
5046
|
+
}
|
|
5047
|
+
};
|
|
5048
|
+
|
|
5049
|
+
/**
|
|
5050
|
+
* 设置语言资源
|
|
5051
|
+
* @param {string} strLanguage - 语言资源
|
|
5052
|
+
* @returns {number} 设置结果
|
|
5053
|
+
*/
|
|
5054
|
+
|
|
5055
|
+
|
|
5056
|
+
CA_ExtInterface.prototype.setLanguage = function setLanguage(strLanguage) {
|
|
5057
|
+
if (this.useActioveX) {
|
|
5058
|
+
return window.PNXClient.SetLanguage(strLanguage);
|
|
5059
|
+
} else {
|
|
5060
|
+
var jsonstr = { 'strLanguage': strLanguage };
|
|
5061
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('SetLanguage', JSON.stringify(jsonstr)));
|
|
5062
|
+
return result.value;
|
|
5063
|
+
}
|
|
5064
|
+
};
|
|
5065
|
+
|
|
5066
|
+
/**
|
|
5067
|
+
* 获取用户属性
|
|
5068
|
+
* @param {string} strGatewayAddress - 网关地址
|
|
5069
|
+
* @param {string} strAppFlag - 应用标识
|
|
5070
|
+
* @param {string} strAttributeName - 属性名称
|
|
5071
|
+
* @returns {string} 用户属性值
|
|
5072
|
+
*/
|
|
5073
|
+
|
|
5074
|
+
|
|
5075
|
+
CA_ExtInterface.prototype.getAttribute = function getAttribute(strGatewayAddress, strAppFlag, strAttributeName) {
|
|
5076
|
+
if (this.useActioveX) {
|
|
5077
|
+
return window.PNXClient.GetAttribute(strGatewayAddress, strAppFlag, strAttributeName);
|
|
5078
|
+
} else {
|
|
5079
|
+
var jsonstr = { 'strGatewayAddress': strGatewayAddress, 'strAppFlag': strAppFlag, 'strAttributeName': strAttributeName };
|
|
5080
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetAttribute', JSON.stringify(jsonstr)));
|
|
5081
|
+
return result.value;
|
|
5082
|
+
}
|
|
5083
|
+
};
|
|
5084
|
+
|
|
5085
|
+
/**
|
|
5086
|
+
* 获取签名加密 PIN 码
|
|
5087
|
+
* @returns {string} 签名加密 PIN 码
|
|
5088
|
+
*/
|
|
5089
|
+
|
|
5090
|
+
|
|
5091
|
+
CA_ExtInterface.prototype.getPinCode = function getPinCode() {
|
|
5092
|
+
if (this.useActioveX) {
|
|
5093
|
+
return window.PNXClient.GetPinCode();
|
|
5094
|
+
} else {
|
|
5095
|
+
var jsonstr = '';
|
|
5096
|
+
var result = JSON.parse(this.sendAndWaitMessageEx('GetPinCode', jsonstr));
|
|
5097
|
+
return result.value;
|
|
5098
|
+
}
|
|
5099
|
+
};
|
|
5100
|
+
/*
|
|
5101
|
+
*曙光四川CA
|
|
5102
|
+
*'SOF_GetUserList' 证书列表
|
|
5103
|
+
*'SOF_ExportUserCert' 导出证书
|
|
5104
|
+
*'SOF_GetCertInfo': 获取证书信息
|
|
5105
|
+
*'SOF_GenRandom': 生成随机数
|
|
5106
|
+
*'SOF_SignData': 获取证书签名
|
|
5107
|
+
*'SOF_Login': 登录证书
|
|
5108
|
+
*'SOF_GetPinRetryCount': 剩余次数
|
|
5109
|
+
*/
|
|
5110
|
+
/**
|
|
5111
|
+
*
|
|
5112
|
+
* 获取webSocket消息
|
|
5113
|
+
* @returns {string}
|
|
5114
|
+
*/
|
|
5115
|
+
|
|
5116
|
+
|
|
5117
|
+
CA_ExtInterface.prototype.getMessage = function getMessage(_ref) {
|
|
5118
|
+
var _this = this;
|
|
5119
|
+
|
|
5120
|
+
var action = _ref.action,
|
|
5121
|
+
_ref$params = _ref.params,
|
|
5122
|
+
params = _ref$params === undefined ? [] : _ref$params;
|
|
5123
|
+
|
|
5124
|
+
return new Promise(function (resolve, reject) {
|
|
5125
|
+
var obj = JSON.stringify({
|
|
5126
|
+
'action': action,
|
|
5127
|
+
'params': params
|
|
5128
|
+
});
|
|
5129
|
+
if (!_this.webSocket) {
|
|
5130
|
+
_this.webSocket = new WebSocket('wss://localhost:36171');
|
|
5131
|
+
_this.webSocket.onerror = function (event) {
|
|
5132
|
+
_this.webSocket = null;
|
|
5133
|
+
reject(event);
|
|
5134
|
+
};
|
|
5135
|
+
_this.webSocket.onopen = function () {
|
|
5136
|
+
_this.webSocket.send(obj);
|
|
5137
|
+
};
|
|
5138
|
+
} else {
|
|
5139
|
+
_this.webSocket.send(obj);
|
|
5140
|
+
}
|
|
5141
|
+
_this.webSocket.onclose = function () {
|
|
5142
|
+
_this.webSocket = null;
|
|
5143
|
+
};
|
|
5144
|
+
_this.webSocket.onmessage = function (event) {
|
|
5145
|
+
resolve(JSON.parse(event.data));
|
|
5146
|
+
};
|
|
5147
|
+
});
|
|
5148
|
+
};
|
|
5149
|
+
/**
|
|
5150
|
+
*
|
|
5151
|
+
* base64解码
|
|
5152
|
+
* @returns {string} base64解码后的字符串
|
|
5153
|
+
*/
|
|
5154
|
+
|
|
5155
|
+
|
|
5156
|
+
CA_ExtInterface.prototype.base64Decode = function base64Decode(res) {
|
|
5157
|
+
var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
5158
|
+
var val = '';
|
|
5159
|
+
var chr1 = void 0;
|
|
5160
|
+
var chr2 = void 0;
|
|
5161
|
+
var chr3 = void 0;
|
|
5162
|
+
var enc1 = void 0;
|
|
5163
|
+
var enc2 = void 0;
|
|
5164
|
+
var enc3 = void 0;
|
|
5165
|
+
var enc4 = void 0;
|
|
5166
|
+
var i = 0;
|
|
5167
|
+
res = res.replace(/[^A-Za-z0-9\+\/\=]/g, '');
|
|
5168
|
+
while (i < res.length) {
|
|
5169
|
+
enc1 = _keyStr.indexOf(res.charAt(i++));
|
|
5170
|
+
enc2 = _keyStr.indexOf(res.charAt(i++));
|
|
5171
|
+
enc3 = _keyStr.indexOf(res.charAt(i++));
|
|
5172
|
+
enc4 = _keyStr.indexOf(res.charAt(i++));
|
|
5173
|
+
chr1 = enc1 << 2 | enc2 >> 4;
|
|
5174
|
+
chr2 = (enc2 & 15) << 4 | enc3 >> 2;
|
|
5175
|
+
chr3 = (enc3 & 3) << 6 | enc4;
|
|
5176
|
+
val = val + String.fromCharCode(chr1);
|
|
5177
|
+
if (enc3 !== 64) {
|
|
5178
|
+
val = val + String.fromCharCode(chr2);
|
|
5179
|
+
}
|
|
5180
|
+
if (enc4 !== 64) {
|
|
5181
|
+
val = val + String.fromCharCode(chr3);
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
5184
|
+
val = this.utf8_decode(val);
|
|
5185
|
+
return val;
|
|
5186
|
+
};
|
|
5187
|
+
/**
|
|
5188
|
+
*
|
|
5189
|
+
* base64编码
|
|
5190
|
+
* @returns {string} base64编码后的字符串
|
|
5191
|
+
*/
|
|
5192
|
+
|
|
5193
|
+
|
|
5194
|
+
CA_ExtInterface.prototype.base64Encode = function base64Encode(res) {
|
|
5195
|
+
var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
5196
|
+
var val = '';
|
|
5197
|
+
var chr1 = void 0;
|
|
5198
|
+
var chr2 = void 0;
|
|
5199
|
+
var chr3 = void 0;
|
|
5200
|
+
var enc1 = void 0;
|
|
5201
|
+
var enc2 = void 0;
|
|
5202
|
+
var enc3 = void 0;
|
|
5203
|
+
var enc4 = void 0;
|
|
5204
|
+
var i = 0;
|
|
5205
|
+
res = this.utf8_encode(res);
|
|
5206
|
+
while (i < res.length) {
|
|
5207
|
+
chr1 = res.charCodeAt(i++);
|
|
5208
|
+
chr2 = res.charCodeAt(i++);
|
|
5209
|
+
chr3 = res.charCodeAt(i++);
|
|
5210
|
+
enc1 = chr1 >> 2;
|
|
5211
|
+
enc2 = (chr1 & 3) << 4 | chr2 >> 4;
|
|
5212
|
+
enc3 = (chr2 & 15) << 2 | chr3 >> 6;
|
|
5213
|
+
enc4 = chr3 & 63;
|
|
5214
|
+
if (isNaN(chr2)) {
|
|
5215
|
+
enc3 = enc4 = 64;
|
|
5216
|
+
} else if (isNaN(chr3)) {
|
|
5217
|
+
enc4 = 64;
|
|
5218
|
+
}
|
|
5219
|
+
val = val + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
|
|
5220
|
+
}
|
|
5221
|
+
return val;
|
|
5222
|
+
};
|
|
5223
|
+
/**
|
|
5224
|
+
*
|
|
5225
|
+
* utf8解码
|
|
5226
|
+
* @returns {string} utf8解码后的字符串
|
|
5227
|
+
*/
|
|
5228
|
+
|
|
5229
|
+
|
|
5230
|
+
CA_ExtInterface.prototype.utf8_decode = function utf8_decode(utftext) {
|
|
5231
|
+
var string = '';
|
|
5232
|
+
var i = 0;
|
|
5233
|
+
var c = 0;
|
|
5234
|
+
// let c1 = 0;
|
|
5235
|
+
var c2 = 0;
|
|
5236
|
+
var c3 = 0;
|
|
5237
|
+
while (i < utftext.length) {
|
|
5238
|
+
c = utftext.charCodeAt(i);
|
|
5239
|
+
if (c < 128) {
|
|
5240
|
+
string += String.fromCharCode(c);
|
|
5241
|
+
i++;
|
|
5242
|
+
} else if (c > 191 && c < 224) {
|
|
5243
|
+
c2 = utftext.charCodeAt(i + 1);
|
|
5244
|
+
string += String.fromCharCode((c & 31) << 6 | c2 & 63);
|
|
5245
|
+
i += 2;
|
|
5246
|
+
} else {
|
|
5247
|
+
c2 = utftext.charCodeAt(i + 1);
|
|
5248
|
+
c3 = utftext.charCodeAt(i + 2);
|
|
5249
|
+
string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
|
5250
|
+
i += 3;
|
|
5251
|
+
}
|
|
5252
|
+
}
|
|
5253
|
+
return string;
|
|
5254
|
+
};
|
|
5255
|
+
/**
|
|
5256
|
+
*
|
|
5257
|
+
* utf8编码
|
|
5258
|
+
* @returns {string} utf8编码后的字符串
|
|
5259
|
+
*/
|
|
5260
|
+
|
|
5261
|
+
|
|
5262
|
+
CA_ExtInterface.prototype.utf8_encode = function utf8_encode(string) {
|
|
5263
|
+
string = string.replace(/\r\n/g, '\n');
|
|
5264
|
+
var utftext = '';
|
|
5265
|
+
for (var n = 0; n < string.length; n++) {
|
|
5266
|
+
var c = string.charCodeAt(n);
|
|
5267
|
+
if (c < 128) {
|
|
5268
|
+
utftext += String.fromCharCode(c);
|
|
5269
|
+
} else if (c > 127 && c < 2048) {
|
|
5270
|
+
utftext += String.fromCharCode(c >> 6 | 192);
|
|
5271
|
+
utftext += String.fromCharCode(c & 63 | 128);
|
|
5272
|
+
} else {
|
|
5273
|
+
utftext += String.fromCharCode(c >> 12 | 224);
|
|
5274
|
+
utftext += String.fromCharCode(c >> 6 & 63 | 128);
|
|
5275
|
+
utftext += String.fromCharCode(c & 63 | 128);
|
|
5276
|
+
}
|
|
5277
|
+
}
|
|
5278
|
+
return utftext;
|
|
5279
|
+
};
|
|
5280
|
+
|
|
5281
|
+
return CA_ExtInterface;
|
|
5282
|
+
}();
|
|
5283
|
+
|
|
5284
|
+
var caPlugin = new CA_ExtInterface();
|
|
5285
|
+
/* harmony default export */ var src_plugin = (caPlugin);
|
|
5286
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/ca-login/src/ca-login.vue?vue&type=script&lang=js&
|
|
5287
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
5288
|
+
|
|
5289
|
+
//
|
|
5290
|
+
//
|
|
5291
|
+
//
|
|
5292
|
+
//
|
|
5293
|
+
//
|
|
5294
|
+
//
|
|
5295
|
+
//
|
|
5296
|
+
//
|
|
5297
|
+
//
|
|
5298
|
+
//
|
|
5299
|
+
//
|
|
5300
|
+
//
|
|
5301
|
+
//
|
|
5302
|
+
//
|
|
5303
|
+
//
|
|
5304
|
+
//
|
|
5305
|
+
//
|
|
5306
|
+
//
|
|
5307
|
+
//
|
|
5308
|
+
//
|
|
5309
|
+
//
|
|
5310
|
+
//
|
|
5311
|
+
//
|
|
5312
|
+
//
|
|
5313
|
+
|
|
5314
|
+
|
|
5315
|
+
|
|
5316
|
+
|
|
5317
|
+
|
|
5318
|
+
/* harmony default export */ var ca_loginvue_type_script_lang_js_ = ({
|
|
5319
|
+
name: 'EsCaLogin',
|
|
5320
|
+
props: {
|
|
5321
|
+
//登录接口地址
|
|
5322
|
+
action: String,
|
|
5323
|
+
// 额外参数
|
|
5324
|
+
data: {
|
|
5325
|
+
type: Object,
|
|
5326
|
+
default: function _default() {
|
|
5327
|
+
return {};
|
|
5328
|
+
}
|
|
5329
|
+
},
|
|
5330
|
+
// 插件安装路径
|
|
5331
|
+
installPath: String,
|
|
5332
|
+
// CA类型JIDA-吉大正元,SHU_GUANG-曙光,SICHUAN-四川
|
|
5333
|
+
mode: {
|
|
5334
|
+
type: String,
|
|
5335
|
+
required: true
|
|
5336
|
+
},
|
|
5337
|
+
// 唯一标识ID
|
|
5338
|
+
identifyingId: {
|
|
5339
|
+
type: String,
|
|
5340
|
+
default: function _default() {
|
|
5341
|
+
return Object(util["Y" /* uuid */])(12);
|
|
5342
|
+
}
|
|
5343
|
+
},
|
|
5344
|
+
// DLL 名称列表
|
|
5345
|
+
dllname: {
|
|
5346
|
+
type: Array,
|
|
5347
|
+
default: function _default() {
|
|
5348
|
+
return [];
|
|
5349
|
+
}
|
|
5350
|
+
},
|
|
5351
|
+
// 是否显示证书选择框
|
|
5352
|
+
showSelect: Boolean
|
|
5353
|
+
},
|
|
5354
|
+
data: function data() {
|
|
5355
|
+
return {
|
|
5356
|
+
userList: [],
|
|
5357
|
+
signedData: '', //证书原文
|
|
5358
|
+
b64originData: '', //签名原文
|
|
5359
|
+
b64SignData: '', //签名结果
|
|
5360
|
+
idCard: '',
|
|
5361
|
+
certId: '',
|
|
5362
|
+
loading: null
|
|
5363
|
+
};
|
|
5364
|
+
},
|
|
5365
|
+
|
|
5366
|
+
computed: {
|
|
5367
|
+
jida: function jida() {
|
|
5368
|
+
// 生成不重复的 DLL 名称列表
|
|
5369
|
+
var dllnames = Array.from(new Set(['L3Vzci9saWI2NC9saWJTS0ZBUEkuc28=', 'bGliU0tGQVBJLWFybTY0LnNv', 'L3Vzci9saWIvYWFyY2g2NC1saW51eC1nbnUvbGliU0tGQVBJLWFybTY0LnNv', 'L3Vzci9saWIvbGliU0tGQVBJLnNv', 'U0tGQVBJMzAwOTIuZGxs', 'bGliU0tGQVBJLnNv', 'L29wdC9oYWl0YWkvbGliL2xpYlNLRkFQSS5zbw==', 'U0tGQVBJNDAwOTcuZGxs'].concat(this.dllname)));
|
|
5370
|
+
|
|
5371
|
+
return '<?xml version="1.0" encoding="utf-8"?>\n <authinfo>\n <liblist>\n ' + dllnames.map(function (dllname) {
|
|
5372
|
+
return '<lib type="SKF" version="1.0" dllname="' + dllname + '"><algid val="SHA1" sm2_hashalg="SM3" /></lib>';
|
|
5373
|
+
}).join('') + '\n </liblist>\n </authinfo>';
|
|
5374
|
+
}
|
|
5375
|
+
},
|
|
5376
|
+
created: function created() {
|
|
5377
|
+
this.init();
|
|
5378
|
+
},
|
|
5379
|
+
mounted: function mounted() {},
|
|
5380
|
+
|
|
5381
|
+
methods: {
|
|
5382
|
+
init: function init() {
|
|
5383
|
+
if (!window.PNXClient) {
|
|
5384
|
+
// 创建 object 元素
|
|
5385
|
+
var pnxClientElement = document.createElement('object');
|
|
5386
|
+
pnxClientElement.classid = 'clsid:9DD991F7-6FB0-4004-95A4-0A55006A8C42';
|
|
5387
|
+
pnxClientElement.width = '0';
|
|
5388
|
+
pnxClientElement.height = '0';
|
|
5389
|
+
pnxClientElement.id = 'PNXClient';
|
|
5390
|
+
pnxClientElement.style.position = 'absolute';
|
|
5391
|
+
document.body.appendChild(pnxClientElement);
|
|
5392
|
+
}
|
|
5393
|
+
},
|
|
5394
|
+
getCertificate: function getCertificate() {
|
|
5395
|
+
var _this = this;
|
|
5396
|
+
|
|
5397
|
+
// 检查 PNXClient 是否存在
|
|
5398
|
+
if (!window.PNXClient) {
|
|
5399
|
+
Object(util["m" /* error */])('控件加载失败,请刷新页面重试!', function () {
|
|
5400
|
+
_this.$emit('error', {
|
|
5401
|
+
code: 0,
|
|
5402
|
+
msg: '控件加载失败,请刷新页面重试!'
|
|
5403
|
+
});
|
|
5404
|
+
});
|
|
5405
|
+
return;
|
|
5406
|
+
}
|
|
5407
|
+
switch (this.mode) {
|
|
5408
|
+
//吉大正元:
|
|
5409
|
+
case 'JIDA':
|
|
5410
|
+
try {
|
|
5411
|
+
src_plugin.getVersion();
|
|
5412
|
+
} catch (e) {
|
|
5413
|
+
if (this.installPath) {
|
|
5414
|
+
message_box_default.a.confirm('未安装控件,请进行安装控件!', '控件下载', {
|
|
5415
|
+
confirmButtonText: '下载',
|
|
5416
|
+
cancelButtonText: '取消',
|
|
5417
|
+
type: 'warning'
|
|
5418
|
+
}).then(function () {
|
|
5419
|
+
Object(util["k" /* downloadFile */])(_this.installPath);
|
|
5420
|
+
}).catch(function () {});
|
|
5421
|
+
} else {
|
|
5422
|
+
Object(util["m" /* error */])('未安装控件,请进行安装控件!', function () {
|
|
5423
|
+
_this.$emit('error', {
|
|
5424
|
+
type: 1,
|
|
5425
|
+
msg: '未安装控件,请进行安装控件!'
|
|
5426
|
+
});
|
|
5427
|
+
});
|
|
5428
|
+
}
|
|
5429
|
+
return;
|
|
5430
|
+
}
|
|
5431
|
+
try {
|
|
5432
|
+
// 清除之前的过滤器
|
|
5433
|
+
src_plugin.clearFilter();
|
|
5434
|
+
// 初始化vctk控件
|
|
5435
|
+
src_plugin.initialize('', this.jida);
|
|
5436
|
+
// 控制证书为一个时,并且不显示选择框时,不弹出证书选择框
|
|
5437
|
+
!this.showSelect && src_plugin.setChooseSingleCert(1);
|
|
5438
|
+
|
|
5439
|
+
// 生成签名信息
|
|
5440
|
+
this.signedData = src_plugin.p7SignString(this.identifyingId, true, true);
|
|
5441
|
+
|
|
5442
|
+
//获取错误码
|
|
5443
|
+
var errorCode = Number(src_plugin.getLastError());
|
|
5444
|
+
if (errorCode !== 0) {
|
|
5445
|
+
if (errorCode === 3758096386 || errorCode === 2148532334) {
|
|
5446
|
+
Object(util["m" /* error */])('用户取消操作!', function () {
|
|
5447
|
+
_this.$emit('error', { code: 52, msg: '用户取消操作!' });
|
|
5448
|
+
});
|
|
5449
|
+
return;
|
|
5450
|
+
} else if (errorCode === -536870815 || errorCode === 3758096481) {
|
|
5451
|
+
Object(util["m" /* error */])('没有找到有效的证书,如果使用的是KEY,请确认已经插入key!', function () {
|
|
5452
|
+
_this.$emit('error', {
|
|
5453
|
+
type: 2,
|
|
5454
|
+
msg: '没有找到有效的证书,如果使用的是KEY,请确认已经插入key!'
|
|
5455
|
+
});
|
|
5456
|
+
});
|
|
5457
|
+
return;
|
|
5458
|
+
} else {
|
|
5459
|
+
var msg = src_plugin.getLastErrorMessage();
|
|
5460
|
+
Object(util["m" /* error */])(msg, function () {
|
|
5461
|
+
_this.$emit('error', { code: 3, msg: msg });
|
|
5462
|
+
});
|
|
5463
|
+
return;
|
|
5464
|
+
}
|
|
5465
|
+
}
|
|
5466
|
+
this.$emit('success', this.signedData);
|
|
5467
|
+
return this.signedData;
|
|
5468
|
+
} catch (error) {
|
|
5469
|
+
// 捕获其他可能的异常
|
|
5470
|
+
error('\u64CD\u4F5C\u5931\u8D25: ' + error.message, function () {
|
|
5471
|
+
_this.$emit('error', { code: 4, msg: error.message });
|
|
5472
|
+
});
|
|
5473
|
+
}
|
|
5474
|
+
break;
|
|
5475
|
+
//曙光:
|
|
5476
|
+
case 'SHU_GUANG':
|
|
5477
|
+
src_plugin.getMessage({ action: 'SOF_GetUserList' }).then(function (res) {
|
|
5478
|
+
var retCode = res.retCode,
|
|
5479
|
+
retMsg = res.retMsg,
|
|
5480
|
+
retValue = res.retValue;
|
|
5481
|
+
|
|
5482
|
+
if (!retValue || retCode !== 0) {
|
|
5483
|
+
Object(util["m" /* error */])(retCode !== 0 ? retMsg : '未找到证书,请插入证书UKEY!', function () {
|
|
5484
|
+
_this.$emit('error', {
|
|
5485
|
+
type: 2,
|
|
5486
|
+
msg: retCode !== 0 ? retMsg : '未找到证书,请插入证书UKEY!'
|
|
5487
|
+
});
|
|
5488
|
+
});
|
|
5489
|
+
return;
|
|
5490
|
+
}
|
|
5491
|
+
var userList = retValue.split('&&&');
|
|
5492
|
+
if (userList.length === 1 && !_this.showSelect) {
|
|
5493
|
+
//如果只有一个证书,并且不显示选择框时,直接获取证书信息
|
|
5494
|
+
_this.certId = userList[0].split('||')[1];
|
|
5495
|
+
_this.getCertInfo(_this.certId);
|
|
5496
|
+
} else {
|
|
5497
|
+
// 如果有多个证书,弹出选择框
|
|
5498
|
+
_this.userList = userList.map(function (item) {
|
|
5499
|
+
var _item$split = item.split('||'),
|
|
5500
|
+
name = _item$split[0],
|
|
5501
|
+
certId = _item$split[1];
|
|
5502
|
+
|
|
5503
|
+
return { label: name, value: certId };
|
|
5504
|
+
});
|
|
5505
|
+
message_box_default.a.prompt('', '证书选择', {
|
|
5506
|
+
confirmButtonText: '确定',
|
|
5507
|
+
cancelButtonText: '取消',
|
|
5508
|
+
inputPattern: /^.+$/,
|
|
5509
|
+
inputErrorMessage: '请选择证书!',
|
|
5510
|
+
selectData: _this.userList
|
|
5511
|
+
}).then(function (res) {
|
|
5512
|
+
_this.certId = res.value;
|
|
5513
|
+
_this.getCertInfo(_this.certId);
|
|
5514
|
+
}).catch(function () {
|
|
5515
|
+
_this.$emit('error', { code: 52, msg: '用户取消操作!' });
|
|
5516
|
+
});
|
|
5517
|
+
}
|
|
5518
|
+
}).catch(function (err) {
|
|
5519
|
+
if (_this.installPath) {
|
|
5520
|
+
message_box_default.a.confirm('请检查是否安装并启用证书助手控件!', '控件下载', {
|
|
5521
|
+
confirmButtonText: '下载',
|
|
5522
|
+
cancelButtonText: '取消',
|
|
5523
|
+
type: 'warning'
|
|
5524
|
+
}).then(function () {
|
|
5525
|
+
Object(util["k" /* downloadFile */])(_this.installPath);
|
|
5526
|
+
}).catch(function () {
|
|
5527
|
+
_this.$emit('error', {
|
|
5528
|
+
type: 1,
|
|
5529
|
+
msg: '请检查是否安装并启用证书助手控件!'
|
|
5530
|
+
});
|
|
5531
|
+
});
|
|
5532
|
+
} else {
|
|
5533
|
+
Object(util["m" /* error */])('请检查是否安装并启用证书助手控件!', function () {
|
|
5534
|
+
_this.$emit('error', {
|
|
5535
|
+
type: 1,
|
|
5536
|
+
msg: '请检查是否安装并启用证书助手控件!'
|
|
5537
|
+
});
|
|
5538
|
+
});
|
|
5539
|
+
}
|
|
5540
|
+
});
|
|
5541
|
+
break;
|
|
5542
|
+
//四川:
|
|
5543
|
+
case 'SICHUAN':
|
|
5544
|
+
Object(util["ab" /* warning */])('四川CA登录方式对接中!', function () {
|
|
5545
|
+
_this.$emit('error', {
|
|
5546
|
+
type: 2,
|
|
5547
|
+
msg: '四川CA登录方式对接中!'
|
|
5548
|
+
});
|
|
5549
|
+
});
|
|
5550
|
+
break;
|
|
5551
|
+
}
|
|
5552
|
+
},
|
|
5553
|
+
getCertInfo: function getCertInfo(name) {
|
|
5554
|
+
var _this2 = this;
|
|
5555
|
+
|
|
5556
|
+
src_plugin.getMessage({ action: 'SOF_ExportUserCert', params: [name] }).then(function (res) {
|
|
5557
|
+
var retCode = res.retCode,
|
|
5558
|
+
retMsg = res.retMsg,
|
|
5559
|
+
retValue = res.retValue;
|
|
5560
|
+
|
|
5561
|
+
if (retCode !== 0) {
|
|
5562
|
+
Object(util["m" /* error */])(retMsg, function () {
|
|
5563
|
+
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
5564
|
+
});
|
|
5565
|
+
return;
|
|
5566
|
+
}
|
|
5567
|
+
//设置证书原文
|
|
5568
|
+
_this2.signedData = retValue.replace('-----BEGIN CERTIFICATE-----', '').replace('-----END CERTIFICATE-----', '');
|
|
5569
|
+
src_plugin.getMessage({
|
|
5570
|
+
action: 'SOF_GetCertInfo',
|
|
5571
|
+
params: [retValue, 'SGD_CERT_SUBJECT_SN']
|
|
5572
|
+
}).then(function (res) {
|
|
5573
|
+
var retCode = res.retCode,
|
|
5574
|
+
retMsg = res.retMsg,
|
|
5575
|
+
retValue = res.retValue;
|
|
5576
|
+
|
|
5577
|
+
if (retCode !== 0) {
|
|
5578
|
+
Object(util["m" /* error */])(retMsg, function () {
|
|
5579
|
+
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
5580
|
+
});
|
|
5581
|
+
return;
|
|
5582
|
+
}
|
|
5583
|
+
_this2.idCard = src_plugin.base64Decode(retValue);
|
|
5584
|
+
src_plugin.getMessage({
|
|
5585
|
+
action: 'SOF_GenRandom',
|
|
5586
|
+
params: [16]
|
|
5587
|
+
}).then(function (res) {
|
|
5588
|
+
var retCode = res.retCode,
|
|
5589
|
+
retMsg = res.retMsg,
|
|
5590
|
+
retValue = res.retValue;
|
|
5591
|
+
|
|
5592
|
+
if (retCode !== 0) {
|
|
5593
|
+
Object(util["m" /* error */])(retMsg, function () {
|
|
5594
|
+
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
5595
|
+
});
|
|
5596
|
+
return;
|
|
5597
|
+
}
|
|
5598
|
+
_this2.b64originData = retValue + _this2.identifyingId;
|
|
5599
|
+
src_plugin.getMessage({
|
|
5600
|
+
action: 'SOF_SignData',
|
|
5601
|
+
params: [_this2.certId, src_plugin.base64Encode(_this2.b64originData)]
|
|
5602
|
+
}).then(function (res) {
|
|
5603
|
+
var retCode = res.retCode,
|
|
5604
|
+
retMsg = res.retMsg,
|
|
5605
|
+
retValue = res.retValue;
|
|
5606
|
+
|
|
5607
|
+
if (retCode !== 0) {
|
|
5608
|
+
if (retCode === 184550659) {
|
|
5609
|
+
_this2.cerLogin();
|
|
5610
|
+
} else {
|
|
5611
|
+
Object(util["m" /* error */])(retMsg, function () {
|
|
5612
|
+
_this2.$emit('error', { code: retCode, msg: retMsg });
|
|
5613
|
+
});
|
|
5614
|
+
}
|
|
5615
|
+
return;
|
|
5616
|
+
}
|
|
5617
|
+
_this2.b64SignData = retValue;
|
|
5618
|
+
_this2.$emit('success', {
|
|
5619
|
+
identifyingId: _this2.identifyingId,
|
|
5620
|
+
signedData: _this2.signedData, //证书原文
|
|
5621
|
+
b64originData: _this2.b64originData, //签名原文
|
|
5622
|
+
b64SignData: _this2.b64SignData, //签名结果
|
|
5623
|
+
idCard: _this2.idCard,
|
|
5624
|
+
certId: _this2.certId
|
|
5625
|
+
});
|
|
5626
|
+
}).catch(function (err) {
|
|
5627
|
+
_this2.$emit('error', { code: 5, msg: err });
|
|
5628
|
+
});
|
|
5629
|
+
}).catch(function (err) {
|
|
5630
|
+
_this2.$emit('error', { code: 6, msg: err });
|
|
5631
|
+
});
|
|
5632
|
+
}).catch(function (err) {
|
|
5633
|
+
_this2.$emit('error', { code: 7, msg: err });
|
|
5634
|
+
});
|
|
5635
|
+
}).catch(function (err) {
|
|
5636
|
+
_this2.$emit('error', { code: 8, msg: err });
|
|
5637
|
+
});
|
|
5638
|
+
},
|
|
5639
|
+
cerLogin: function cerLogin() {
|
|
5640
|
+
var _this3 = this;
|
|
5641
|
+
|
|
5642
|
+
var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '提示';
|
|
5643
|
+
|
|
5644
|
+
message_box_default.a.prompt('输入密码', title, {
|
|
5645
|
+
confirmButtonText: '确定',
|
|
5646
|
+
cancelButtonText: '取消',
|
|
5647
|
+
inputPattern: /^[[\x21-\x7E]{6,16}$/,
|
|
5648
|
+
inputErrorMessage: '请输入密码'
|
|
5649
|
+
}).then(function (_ref) {
|
|
5650
|
+
var value = _ref.value;
|
|
5651
|
+
|
|
5652
|
+
src_plugin.getMessage({
|
|
5653
|
+
action: 'SOF_Login',
|
|
5654
|
+
params: [_this3.certId, value]
|
|
5655
|
+
}).then(function (res) {
|
|
5656
|
+
var retCode = res.retCode,
|
|
5657
|
+
retMsg = res.retMsg,
|
|
5658
|
+
retValue = res.retValue;
|
|
5659
|
+
|
|
5660
|
+
if (retCode !== 0 || retValue === false) {
|
|
5661
|
+
if (retValue === false) {
|
|
5662
|
+
src_plugin.getMessage({
|
|
5663
|
+
action: 'SOF_GetPinRetryCount',
|
|
5664
|
+
params: [_this3.certId]
|
|
5665
|
+
}).then(function (res) {
|
|
5666
|
+
var retValue = res.retValue;
|
|
5667
|
+
|
|
5668
|
+
_this3.cerLogin('\u767B\u5F55\u5931\u8D25\uFF01\u5269\u4F59\u53E3\u4EE4\u91CD\u8BD5\u6B21\u6570\uFF1A' + retValue + '\u6B21');
|
|
5669
|
+
});
|
|
5670
|
+
return;
|
|
5671
|
+
}
|
|
5672
|
+
Object(util["m" /* error */])(retMsg, function () {
|
|
5673
|
+
_this3.$emit('error', { code: retCode, msg: retMsg });
|
|
5674
|
+
});
|
|
5675
|
+
return;
|
|
5676
|
+
}
|
|
5677
|
+
src_plugin.getMessage({
|
|
5678
|
+
action: 'SOF_SignData',
|
|
5679
|
+
params: [_this3.certId, src_plugin.base64Encode(_this3.b64originData)]
|
|
5680
|
+
}).then(function (res) {
|
|
5681
|
+
var retCode = res.retCode,
|
|
5682
|
+
retMsg = res.retMsg,
|
|
5683
|
+
retValue = res.retValue;
|
|
5684
|
+
|
|
5685
|
+
if (retCode !== 0) {
|
|
5686
|
+
if (retCode === 184550659) {
|
|
5687
|
+
_this3.cerLogin();
|
|
5688
|
+
} else {
|
|
5689
|
+
Object(util["m" /* error */])(retMsg, function () {
|
|
5690
|
+
_this3.$emit('error', { code: retCode, msg: retMsg });
|
|
5691
|
+
});
|
|
5692
|
+
}
|
|
5693
|
+
return;
|
|
5694
|
+
}
|
|
5695
|
+
_this3.b64SignData = retValue;
|
|
5696
|
+
if (_this3.autoLogin) {
|
|
5697
|
+
_this3.doLogin();
|
|
5698
|
+
return;
|
|
5699
|
+
}
|
|
5700
|
+
_this3.$emit('success', {
|
|
5701
|
+
identifyingId: _this3.identifyingId,
|
|
5702
|
+
signedData: _this3.signedData, //证书原文
|
|
5703
|
+
b64originData: _this3.b64originData, //签名原文
|
|
5704
|
+
b64SignData: _this3.b64SignData, //签名结果
|
|
5705
|
+
idCard: _this3.idCard,
|
|
5706
|
+
certId: _this3.certId
|
|
5707
|
+
});
|
|
5708
|
+
}).catch(function (err) {
|
|
5709
|
+
_this3.$emit('error', { code: 9, msg: err });
|
|
5710
|
+
});
|
|
5711
|
+
}).catch(function () {
|
|
5712
|
+
_this3.$emit('error', { code: 10, msg: err });
|
|
5713
|
+
});
|
|
5714
|
+
}).catch(function () {
|
|
5715
|
+
_this3.$emit('error', { code: 11, msg: err });
|
|
5716
|
+
});
|
|
5717
|
+
},
|
|
5718
|
+
doLogin: function doLogin() {
|
|
5719
|
+
var _this4 = this;
|
|
5720
|
+
|
|
5721
|
+
var data = _extends({
|
|
5722
|
+
identifyingId: this.identifyingId,
|
|
5723
|
+
signedData: this.signedData, //证书原文
|
|
5724
|
+
b64originData: this.b64originData, //签名原文
|
|
5725
|
+
b64SignData: this.b64SignData, //签名结果
|
|
5726
|
+
idCard: this.idCard,
|
|
5727
|
+
certId: this.certId
|
|
5728
|
+
}, this.data);
|
|
5729
|
+
var loadingInstance = Object(util["K" /* loading */])('登录中...');
|
|
5730
|
+
ajax({
|
|
5731
|
+
method: 'post',
|
|
5732
|
+
url: this.action,
|
|
5733
|
+
data: data
|
|
5734
|
+
}).then(function (res) {
|
|
5735
|
+
if (res.rCode == 0) {
|
|
5736
|
+
var _results = results,
|
|
5737
|
+
statusCode = _results.statusCode,
|
|
5738
|
+
msg = _results.msg;
|
|
5739
|
+
|
|
5740
|
+
if (statusCode === 1) {
|
|
5741
|
+
Object(util["m" /* error */])(msg || '登录失败!', function () {
|
|
5742
|
+
_this4.$emit('error', res);
|
|
5743
|
+
});
|
|
5744
|
+
} else {
|
|
5745
|
+
_this4.$emit('success', results);
|
|
5746
|
+
}
|
|
5747
|
+
} else {
|
|
5748
|
+
var _msg = res.results && res.results.msg ? res.results.msg : res.msg;
|
|
5749
|
+
Object(util["m" /* error */])(_msg || '系统错误,请联系管理员!', function () {
|
|
5750
|
+
_this4.$emit('error', res);
|
|
5751
|
+
});
|
|
5752
|
+
}
|
|
5753
|
+
loadingInstance.close();
|
|
5754
|
+
}).catch(function (err) {
|
|
5755
|
+
loadingInstance.close();
|
|
5756
|
+
});
|
|
5757
|
+
}
|
|
5758
|
+
}
|
|
5759
|
+
});
|
|
5760
|
+
// CONCATENATED MODULE: ./packages/ca-login/src/ca-login.vue?vue&type=script&lang=js&
|
|
5761
|
+
/* harmony default export */ var src_ca_loginvue_type_script_lang_js_ = (ca_loginvue_type_script_lang_js_);
|
|
5762
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
5763
|
+
var componentNormalizer = __webpack_require__(3);
|
|
5764
|
+
|
|
5765
|
+
// CONCATENATED MODULE: ./packages/ca-login/src/ca-login.vue
|
|
5766
|
+
|
|
5767
|
+
|
|
5768
|
+
|
|
5769
|
+
|
|
5770
|
+
|
|
5771
|
+
/* normalize component */
|
|
5772
|
+
|
|
5773
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
5774
|
+
src_ca_loginvue_type_script_lang_js_,
|
|
5775
|
+
render,
|
|
5776
|
+
staticRenderFns,
|
|
5777
|
+
false,
|
|
5778
|
+
null,
|
|
5779
|
+
null,
|
|
5780
|
+
null
|
|
5781
|
+
|
|
5782
|
+
)
|
|
5783
|
+
|
|
5784
|
+
/* harmony default export */ var ca_login = (component.exports);
|
|
5785
|
+
// CONCATENATED MODULE: ./packages/ca-login/index.js
|
|
5786
|
+
|
|
5787
|
+
|
|
5788
|
+
ca_login.install = function (Vue) {
|
|
5789
|
+
return Vue.component(ca_login.name, ca_login);
|
|
5790
|
+
};
|
|
5791
|
+
|
|
5792
|
+
/* harmony default export */ var packages_ca_login = __webpack_exports__["default"] = (ca_login);
|
|
5793
|
+
|
|
5794
|
+
/***/ }),
|
|
5795
|
+
|
|
5796
|
+
/***/ 19:
|
|
5797
|
+
/***/ (function(module, exports) {
|
|
5798
|
+
|
|
5799
|
+
module.exports = require("eoss/lib/loading");
|
|
5800
|
+
|
|
5801
|
+
/***/ }),
|
|
5802
|
+
|
|
5803
|
+
/***/ 2:
|
|
5804
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5805
|
+
|
|
5806
|
+
"use strict";
|
|
5807
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
|
|
5808
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
|
|
5809
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
|
|
5810
|
+
/* unused harmony export setCookie */
|
|
5811
|
+
/* unused harmony export getCookie */
|
|
5812
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
5813
|
+
|
|
5814
|
+
/**
|
|
5815
|
+
* setStorage
|
|
5816
|
+
* @desc:设置本地储存数据
|
|
5817
|
+
* @author huangbo
|
|
5818
|
+
* @date 2022年5月7日
|
|
5819
|
+
* @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
|
|
5820
|
+
* @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
|
|
5821
|
+
**/
|
|
5822
|
+
var setStorage = function setStorage(key, value) {
|
|
5823
|
+
// 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
|
|
5824
|
+
var type = void 0,
|
|
5825
|
+
finalKey = void 0,
|
|
5826
|
+
finalValue = void 0;
|
|
5827
|
+
|
|
5828
|
+
if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
|
|
5829
|
+
// 对象调用方式:setStorage({type, key, value})
|
|
5830
|
+
type = key.type;
|
|
5831
|
+
finalKey = key.key;
|
|
5832
|
+
finalValue = key.value;
|
|
5833
|
+
} else {
|
|
5834
|
+
// 字符串调用方式:setStorage(key, value)
|
|
5835
|
+
type = getStorage('storageType');
|
|
5836
|
+
finalKey = key;
|
|
5837
|
+
finalValue = value;
|
|
5838
|
+
}
|
|
5839
|
+
|
|
5840
|
+
// 使用默认存储类型如果未指定
|
|
5841
|
+
type = type || getStorage('storageType');
|
|
5842
|
+
|
|
5843
|
+
// 获取存储对象
|
|
5844
|
+
var storage = type === 'localStorage' ? localStorage : sessionStorage;
|
|
5845
|
+
|
|
5846
|
+
// 处理不同类型的key
|
|
5847
|
+
if (typeof finalKey === 'string') {
|
|
5848
|
+
// 单个字符串key
|
|
5849
|
+
var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
|
|
5850
|
+
storage.setItem(finalKey, storedValue);
|
|
5851
|
+
if (finalKey === 'token') {
|
|
5852
|
+
setCookie('token', storedValue);
|
|
5853
|
+
}
|
|
5854
|
+
} else if (Array.isArray(finalKey)) {
|
|
5855
|
+
// 数组key,为多个key设置同一个value
|
|
5856
|
+
var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
|
|
5857
|
+
for (var i = 0; i < finalKey.length; i++) {
|
|
5858
|
+
storage.setItem(finalKey[i], _storedValue);
|
|
5859
|
+
if (finalKey[i] === 'token') {
|
|
5860
|
+
setCookie('token', _storedValue);
|
|
5861
|
+
}
|
|
5862
|
+
}
|
|
5863
|
+
} else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
|
|
5864
|
+
// 对象key,对象的属性名称作为key,属性值作为value
|
|
5865
|
+
for (var k in finalKey) {
|
|
5866
|
+
if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
|
|
5867
|
+
var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
|
|
5868
|
+
storage.setItem(k, _storedValue2);
|
|
5869
|
+
if (k === 'token') {
|
|
5870
|
+
setCookie('token', _storedValue2);
|
|
5871
|
+
}
|
|
5872
|
+
}
|
|
5873
|
+
}
|
|
5874
|
+
}
|
|
5875
|
+
};
|
|
5876
|
+
|
|
5877
|
+
/**
|
|
5878
|
+
* getStorage
|
|
5879
|
+
* @desc:获取本地储存数据
|
|
5880
|
+
* @author huangbo
|
|
5881
|
+
* @date 2022年5月7日
|
|
5882
|
+
* @param {String} [key] - 获取的名称
|
|
5883
|
+
**/
|
|
5884
|
+
var getStorage = function getStorage(key) {
|
|
5885
|
+
if (key) {
|
|
5886
|
+
var res = sessionStorage.getItem(key) || localStorage.getItem(key);
|
|
5887
|
+
if (!res && key === 'token') {
|
|
5888
|
+
res = getCookie('token');
|
|
5889
|
+
}
|
|
5890
|
+
if (key === 'host' && !res) {
|
|
5891
|
+
res = '';
|
|
5892
|
+
}
|
|
5893
|
+
return res;
|
|
5894
|
+
}
|
|
5895
|
+
var defaults = {};
|
|
5896
|
+
var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
|
|
5897
|
+
var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
|
|
5898
|
+
|
|
5899
|
+
var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
|
|
5900
|
+
if (token) {
|
|
5901
|
+
defaults.Authorization = token;
|
|
5902
|
+
}
|
|
5903
|
+
if (ssId) {
|
|
5904
|
+
defaults.ssId = ssId;
|
|
5905
|
+
}
|
|
5906
|
+
if (deviceUnique) {
|
|
5907
|
+
defaults.deviceUnique = deviceUnique;
|
|
5908
|
+
}
|
|
5909
|
+
return defaults;
|
|
5910
|
+
};
|
|
5911
|
+
|
|
5912
|
+
/**
|
|
5913
|
+
* removeStorage
|
|
5914
|
+
* @desc:删除本地储存数据
|
|
5915
|
+
* @author huangbo
|
|
5916
|
+
* @date 2022年5月7日
|
|
5917
|
+
* @param {String, Array} [key] - 获取的名称
|
|
5918
|
+
**/
|
|
5919
|
+
var removeStorage = function removeStorage(key) {
|
|
5920
|
+
if (Array.isArray(key)) {
|
|
5921
|
+
for (var i = 0; i < key.length; i++) {
|
|
5922
|
+
sessionStorage.removeItem(key[i]);
|
|
5923
|
+
localStorage.removeItem(key[i]);
|
|
5924
|
+
if (key[i] === 'token') {
|
|
5925
|
+
removeCookie('token');
|
|
5926
|
+
}
|
|
5927
|
+
}
|
|
5928
|
+
} else if (key) {
|
|
5929
|
+
sessionStorage.removeItem(key);
|
|
5930
|
+
localStorage.removeItem(key);
|
|
5931
|
+
if (key === 'token') {
|
|
5932
|
+
removeCookie('token');
|
|
5933
|
+
}
|
|
5934
|
+
} else {
|
|
5935
|
+
sessionStorage.clear();
|
|
5936
|
+
localStorage.clear();
|
|
5937
|
+
removeCookie('token');
|
|
5938
|
+
}
|
|
5939
|
+
};
|
|
5940
|
+
|
|
5941
|
+
/**
|
|
5942
|
+
* setCookie
|
|
5943
|
+
* @desc 设置cookie
|
|
5944
|
+
* @author huangbo
|
|
5945
|
+
* @param {string} [name] cookie名称
|
|
5946
|
+
* @param {string} [value] cookie值
|
|
5947
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
5948
|
+
**/
|
|
5949
|
+
var setCookie = function setCookie(name, value) {
|
|
5950
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
5951
|
+
var time = arguments[3];
|
|
5952
|
+
|
|
5953
|
+
try {
|
|
5954
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
5955
|
+
];
|
|
5956
|
+
// 会话/持久Cookie设置
|
|
5957
|
+
if (!isSession) {
|
|
5958
|
+
if (/MSIE|Trident/.test(navigator.userAgent)) {
|
|
5959
|
+
// IE使用expires
|
|
5960
|
+
var date = new Date();
|
|
5961
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
5962
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
5963
|
+
} else {
|
|
5964
|
+
// 其他浏览器使用max-age
|
|
5965
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
5966
|
+
}
|
|
5967
|
+
}
|
|
5968
|
+
// 内核兼容处理
|
|
5969
|
+
if (/MSIE|Trident/.test(navigator.userAgent)) {
|
|
5970
|
+
// IE特殊处理:添加P3P协议头
|
|
5971
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
5972
|
+
} else {
|
|
5973
|
+
// 现代浏览器设置
|
|
5974
|
+
cookieParts.push('samesite=lax');
|
|
5975
|
+
if (window.location.protocol === 'https:') {
|
|
5976
|
+
cookieParts.push('secure');
|
|
5977
|
+
}
|
|
5978
|
+
}
|
|
5979
|
+
|
|
5980
|
+
// 设置Cookie
|
|
5981
|
+
document.cookie = cookieParts.join('; ');
|
|
5982
|
+
return true;
|
|
5983
|
+
} catch (e) {
|
|
5984
|
+
console.error('Cookie设置失败:', e);
|
|
5985
|
+
return false;
|
|
5986
|
+
}
|
|
5987
|
+
};
|
|
5988
|
+
|
|
5989
|
+
/**
|
|
5990
|
+
* getCookie
|
|
5991
|
+
* @desc 获取cookie中指定名称的值
|
|
5992
|
+
* @author huangbo
|
|
5993
|
+
* @param {string} [name] cookie名称
|
|
5994
|
+
**/
|
|
5995
|
+
var getCookie = function getCookie(name) {
|
|
5996
|
+
var cookies = document.cookie.split(';');
|
|
5997
|
+
for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
5998
|
+
var _ref;
|
|
5999
|
+
|
|
6000
|
+
if (_isArray) {
|
|
6001
|
+
if (_i >= _iterator.length) break;
|
|
6002
|
+
_ref = _iterator[_i++];
|
|
6003
|
+
} else {
|
|
6004
|
+
_i = _iterator.next();
|
|
6005
|
+
if (_i.done) break;
|
|
6006
|
+
_ref = _i.value;
|
|
6007
|
+
}
|
|
6008
|
+
|
|
6009
|
+
var cookie = _ref;
|
|
6010
|
+
|
|
6011
|
+
var _cookie$trim$split = cookie.trim().split('='),
|
|
6012
|
+
cookieName = _cookie$trim$split[0],
|
|
6013
|
+
cookieValue = _cookie$trim$split[1];
|
|
6014
|
+
|
|
6015
|
+
if (decodeURIComponent(cookieName) === name) {
|
|
6016
|
+
return decodeURIComponent(cookieValue);
|
|
6017
|
+
}
|
|
6018
|
+
}
|
|
6019
|
+
return null;
|
|
6020
|
+
};
|
|
6021
|
+
|
|
6022
|
+
/**
|
|
6023
|
+
* removeCookie
|
|
6024
|
+
* @desc:删除cookie
|
|
6025
|
+
* @author huangbo
|
|
6026
|
+
* @date 2022年5月7日
|
|
6027
|
+
* @param {String, Array} [key] - 获取的名称
|
|
6028
|
+
**/
|
|
6029
|
+
var removeCookie = function removeCookie(key) {
|
|
6030
|
+
if (Array.isArray(key)) {
|
|
6031
|
+
for (var i = 0; i < key.length; i++) {
|
|
6032
|
+
document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
|
|
6033
|
+
}
|
|
6034
|
+
} else {
|
|
6035
|
+
document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
|
|
6036
|
+
}
|
|
6037
|
+
};
|
|
6038
|
+
|
|
6039
|
+
/***/ }),
|
|
6040
|
+
|
|
6041
|
+
/***/ 20:
|
|
6042
|
+
/***/ (function(module, exports) {
|
|
6043
|
+
|
|
6044
|
+
module.exports = require("lodash/get");
|
|
6045
|
+
|
|
6046
|
+
/***/ }),
|
|
6047
|
+
|
|
6048
|
+
/***/ 21:
|
|
6049
|
+
/***/ (function(module, exports) {
|
|
6050
|
+
|
|
6051
|
+
module.exports = require("lodash/set");
|
|
6052
|
+
|
|
6053
|
+
/***/ }),
|
|
6054
|
+
|
|
6055
|
+
/***/ 22:
|
|
6056
|
+
/***/ (function(module, exports) {
|
|
6057
|
+
|
|
6058
|
+
module.exports = require("lodash/cloneDeep");
|
|
6059
|
+
|
|
6060
|
+
/***/ }),
|
|
6061
|
+
|
|
6062
|
+
/***/ 3:
|
|
6063
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6064
|
+
|
|
6065
|
+
"use strict";
|
|
6066
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
6067
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
6068
|
+
|
|
6069
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
6070
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
6071
|
+
// be included in the final webpack user bundle.
|
|
6072
|
+
|
|
6073
|
+
function normalizeComponent(
|
|
6074
|
+
scriptExports,
|
|
6075
|
+
render,
|
|
6076
|
+
staticRenderFns,
|
|
6077
|
+
functionalTemplate,
|
|
6078
|
+
injectStyles,
|
|
6079
|
+
scopeId,
|
|
6080
|
+
moduleIdentifier /* server only */,
|
|
6081
|
+
shadowMode /* vue-cli only */
|
|
6082
|
+
) {
|
|
6083
|
+
// Vue.extend constructor export interop
|
|
6084
|
+
var options =
|
|
6085
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
6086
|
+
|
|
6087
|
+
// render functions
|
|
6088
|
+
if (render) {
|
|
6089
|
+
options.render = render
|
|
6090
|
+
options.staticRenderFns = staticRenderFns
|
|
6091
|
+
options._compiled = true
|
|
6092
|
+
}
|
|
6093
|
+
|
|
6094
|
+
// functional template
|
|
6095
|
+
if (functionalTemplate) {
|
|
6096
|
+
options.functional = true
|
|
6097
|
+
}
|
|
6098
|
+
|
|
6099
|
+
// scopedId
|
|
6100
|
+
if (scopeId) {
|
|
6101
|
+
options._scopeId = 'data-v-' + scopeId
|
|
6102
|
+
}
|
|
6103
|
+
|
|
6104
|
+
var hook
|
|
6105
|
+
if (moduleIdentifier) {
|
|
6106
|
+
// server build
|
|
6107
|
+
hook = function (context) {
|
|
6108
|
+
// 2.3 injection
|
|
6109
|
+
context =
|
|
6110
|
+
context || // cached call
|
|
6111
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
6112
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
6113
|
+
// 2.2 with runInNewContext: true
|
|
6114
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
6115
|
+
context = __VUE_SSR_CONTEXT__
|
|
6116
|
+
}
|
|
6117
|
+
// inject component styles
|
|
6118
|
+
if (injectStyles) {
|
|
6119
|
+
injectStyles.call(this, context)
|
|
6120
|
+
}
|
|
6121
|
+
// register component module identifier for async chunk inferrence
|
|
6122
|
+
if (context && context._registeredComponents) {
|
|
6123
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
6124
|
+
}
|
|
6125
|
+
}
|
|
6126
|
+
// used by ssr in case component is cached and beforeCreate
|
|
6127
|
+
// never gets called
|
|
6128
|
+
options._ssrRegister = hook
|
|
6129
|
+
} else if (injectStyles) {
|
|
6130
|
+
hook = shadowMode
|
|
6131
|
+
? function () {
|
|
6132
|
+
injectStyles.call(
|
|
6133
|
+
this,
|
|
6134
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
6135
|
+
)
|
|
6136
|
+
}
|
|
6137
|
+
: injectStyles
|
|
6138
|
+
}
|
|
6139
|
+
|
|
6140
|
+
if (hook) {
|
|
6141
|
+
if (options.functional) {
|
|
6142
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
6143
|
+
// go through the normalizer
|
|
6144
|
+
options._injectStyles = hook
|
|
6145
|
+
// register for functional component in vue file
|
|
6146
|
+
var originalRender = options.render
|
|
6147
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
6148
|
+
hook.call(context)
|
|
6149
|
+
return originalRender(h, context)
|
|
6150
|
+
}
|
|
6151
|
+
} else {
|
|
6152
|
+
// inject component registration as beforeCreate hook
|
|
6153
|
+
var existing = options.beforeCreate
|
|
6154
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
6155
|
+
}
|
|
6156
|
+
}
|
|
6157
|
+
|
|
6158
|
+
return {
|
|
6159
|
+
exports: scriptExports,
|
|
6160
|
+
options: options
|
|
6161
|
+
}
|
|
6162
|
+
}
|
|
6163
|
+
|
|
6164
|
+
|
|
6165
|
+
/***/ }),
|
|
6166
|
+
|
|
6167
|
+
/***/ 4:
|
|
6168
|
+
/***/ (function(module, exports) {
|
|
6169
|
+
|
|
6170
|
+
module.exports = require("vue");
|
|
6171
|
+
|
|
6172
|
+
/***/ }),
|
|
6173
|
+
|
|
6174
|
+
/***/ 6:
|
|
6175
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6176
|
+
|
|
6177
|
+
"use strict";
|
|
6178
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
|
|
6179
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
|
|
6180
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
|
|
6181
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
|
|
6182
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
|
|
6183
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
|
|
6184
|
+
/**
|
|
6185
|
+
* 检查一个值是否为字符串类型
|
|
6186
|
+
* @param {*} obj 要检查的值
|
|
6187
|
+
* @returns {boolean} 如果值为字符串则返回true,否则返回false
|
|
6188
|
+
*/
|
|
6189
|
+
function isString(obj) {
|
|
6190
|
+
return Object.prototype.toString.call(obj) === '[object String]';
|
|
6191
|
+
}
|
|
6192
|
+
|
|
6047
6193
|
/**
|
|
6048
|
-
*
|
|
6049
|
-
* @
|
|
6050
|
-
* @
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
}
|
|
6057
|
-
if (typeof date === 'string') {
|
|
6058
|
-
date = new Date(date);
|
|
6059
|
-
}
|
|
6060
|
-
return date.getMinutes();
|
|
6061
|
-
};
|
|
6062
|
-
|
|
6194
|
+
* 检查一个值是否为对象类型
|
|
6195
|
+
* @param {*} obj 要检查的值
|
|
6196
|
+
* @returns {boolean} 如果值为对象则返回true,否则返回false
|
|
6197
|
+
*/
|
|
6198
|
+
function isObject(obj) {
|
|
6199
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
6200
|
+
}
|
|
6201
|
+
|
|
6063
6202
|
/**
|
|
6064
|
-
*
|
|
6065
|
-
* @
|
|
6066
|
-
* @
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
}
|
|
6073
|
-
if (typeof date === 'string') {
|
|
6074
|
-
date = new Date(date);
|
|
6075
|
-
}
|
|
6076
|
-
return date.getMonth() + 1;
|
|
6077
|
-
};
|
|
6078
|
-
|
|
6203
|
+
* 检查一个节点是否为HTML元素
|
|
6204
|
+
* @param {Node} node 要检查的节点
|
|
6205
|
+
* @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
|
|
6206
|
+
*/
|
|
6207
|
+
function isHtmlElement(node) {
|
|
6208
|
+
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
6209
|
+
}
|
|
6210
|
+
|
|
6079
6211
|
/**
|
|
6080
|
-
*
|
|
6081
|
-
* @
|
|
6082
|
-
* @
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
if (typeof date === 'string') {
|
|
6090
|
-
date = new Date(date);
|
|
6091
|
-
}
|
|
6092
|
-
return date.getSeconds();
|
|
6093
|
-
};
|
|
6094
|
-
|
|
6212
|
+
* 检查一个值是否为函数类型
|
|
6213
|
+
* @param {*} functionToCheck 要检查的值
|
|
6214
|
+
* @returns {boolean} 如果值为函数则返回true,否则返回false
|
|
6215
|
+
*/
|
|
6216
|
+
function isFunction(functionToCheck) {
|
|
6217
|
+
var getType = {};
|
|
6218
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
6219
|
+
}
|
|
6220
|
+
|
|
6095
6221
|
/**
|
|
6096
|
-
*
|
|
6097
|
-
* @
|
|
6098
|
-
* @
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
}
|
|
6105
|
-
if (typeof date === 'string') {
|
|
6106
|
-
date = new Date(date);
|
|
6107
|
-
}
|
|
6108
|
-
return date.getDay();
|
|
6109
|
-
};
|
|
6110
|
-
|
|
6111
|
-
|
|
6222
|
+
* 检查一个值是否为undefined
|
|
6223
|
+
* @param {*} val 要检查的值
|
|
6224
|
+
* @returns {boolean} 如果值为undefined则返回true,否则返回false
|
|
6225
|
+
*/
|
|
6226
|
+
function isUndefined(val) {
|
|
6227
|
+
return val === void 0;
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6112
6230
|
/**
|
|
6113
|
-
*
|
|
6114
|
-
* @
|
|
6115
|
-
* @
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
if (!time) {
|
|
6121
|
-
hour = new Date().getHours();
|
|
6122
|
-
} else if (typeof time === 'string') {
|
|
6123
|
-
// 从时间字符串中提取小时
|
|
6124
|
-
const match = time.match(/^(\d{1,2})/);
|
|
6125
|
-
if (match) {
|
|
6126
|
-
hour = parseInt(match[1], 10);
|
|
6127
|
-
}
|
|
6128
|
-
} else if (typeof time === 'number') {
|
|
6129
|
-
hour = time;
|
|
6130
|
-
}
|
|
6131
|
-
// 判断时间段
|
|
6132
|
-
if (hour >= 5 && hour < 12) {
|
|
6133
|
-
return '上午';
|
|
6134
|
-
} else if (hour >= 12 && hour < 18) {
|
|
6135
|
-
return '下午';
|
|
6136
|
-
} else {
|
|
6137
|
-
return '晚上';
|
|
6138
|
-
}
|
|
6139
|
-
};
|
|
6231
|
+
* 检查一个值是否已定义(不是undefined或null)
|
|
6232
|
+
* @param {*} val 要检查的值
|
|
6233
|
+
* @returns {boolean} 如果值已定义则返回true,否则返回false
|
|
6234
|
+
*/
|
|
6235
|
+
function isDefined(val) {
|
|
6236
|
+
return val !== undefined && val !== null;
|
|
6237
|
+
}
|
|
6140
6238
|
|
|
6141
6239
|
/***/ }),
|
|
6142
6240
|
|