eoss-ui 0.6.67 → 0.6.69

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.
Files changed (282) hide show
  1. package/lib/button-group.js +3 -2
  2. package/lib/button.js +3 -2
  3. package/lib/calogin.js +700 -256
  4. package/lib/checkbox-group.js +3 -2
  5. package/lib/data-table-form.js +3 -2
  6. package/lib/data-table.js +3 -2
  7. package/lib/date-picker.js +3 -2
  8. package/lib/dialog.js +3 -2
  9. package/lib/eoss-ui.common.js +1386 -920
  10. package/lib/flow-group.js +3 -2
  11. package/lib/flow-list.js +161 -177
  12. package/lib/flow.js +301 -291
  13. package/lib/form.js +3 -2
  14. package/lib/handle-user.js +3 -2
  15. package/lib/handler.js +3 -2
  16. package/lib/icon.js +3 -2
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +3 -2
  19. package/lib/input.js +3 -2
  20. package/lib/login.js +70 -39
  21. package/lib/main.js +135 -134
  22. package/lib/nav.js +3 -2
  23. package/lib/page.js +3 -2
  24. package/lib/pagination.js +3 -2
  25. package/lib/player.js +3 -2
  26. package/lib/qr-code.js +16 -15
  27. package/lib/radio-group.js +3 -2
  28. package/lib/retrial-auth.js +3 -2
  29. package/lib/select-ganged.js +3 -2
  30. package/lib/select.js +3 -2
  31. package/lib/selector-panel.js +3 -2
  32. package/lib/selector.js +3 -2
  33. package/lib/sizer.js +3 -2
  34. package/lib/steps.js +3 -2
  35. package/lib/switch.js +3 -2
  36. package/lib/table-form.js +3 -2
  37. package/lib/tabs.js +3 -2
  38. package/lib/theme-chalk/index.css +1 -1
  39. package/lib/theme-chalk/login.css +1 -1
  40. package/lib/tips.js +3 -2
  41. package/lib/tree-group.js +3 -2
  42. package/lib/tree.js +3 -2
  43. package/lib/upload.js +3 -2
  44. package/lib/utils/util.js +3 -2
  45. package/lib/wujie.js +3 -2
  46. package/lib/wxlogin.js +3 -2
  47. package/package.json +160 -160
  48. package/packages/.DS_Store +0 -0
  49. package/packages/autocomplete/.DS_Store +0 -0
  50. package/packages/button/index.js +5 -5
  51. package/packages/button/src/main.vue +418 -418
  52. package/packages/button-group/index.js +5 -5
  53. package/packages/button-group/src/main.vue +298 -298
  54. package/packages/calendar/index.js +5 -5
  55. package/packages/calogin/.DS_Store +0 -0
  56. package/packages/calogin/index.js +5 -5
  57. package/packages/calogin/src/main.vue +410 -131
  58. package/packages/calogin/src/plugin.js +915 -748
  59. package/packages/card/index.js +5 -5
  60. package/packages/card/src/main.vue +156 -156
  61. package/packages/cascader/index.js +5 -5
  62. package/packages/cascader/src/main.vue +168 -168
  63. package/packages/checkbox-group/index.js +5 -5
  64. package/packages/checkbox-group/src/main.vue +333 -333
  65. package/packages/clients/index.js +5 -5
  66. package/packages/clients/src/main.vue +151 -151
  67. package/packages/data-table/index.js +5 -5
  68. package/packages/data-table/src/children.vue +39 -39
  69. package/packages/data-table/src/column.vue +989 -989
  70. package/packages/data-table/src/main.vue +1822 -1822
  71. package/packages/data-table/src/sizer.vue +195 -195
  72. package/packages/data-table-form/index.js +5 -5
  73. package/packages/data-table-form/src/checkbox.vue +101 -101
  74. package/packages/data-table-form/src/colgroup.vue +17 -17
  75. package/packages/data-table-form/src/main.vue +181 -181
  76. package/packages/data-table-form/src/radio.vue +65 -65
  77. package/packages/data-table-form/src/table.vue +233 -233
  78. package/packages/data-table-form/src/tbody.vue +336 -336
  79. package/packages/data-table-form/src/thead.vue +68 -68
  80. package/packages/date-picker/.DS_Store +0 -0
  81. package/packages/date-picker/index.js +5 -5
  82. package/packages/date-picker/src/.DS_Store +0 -0
  83. package/packages/date-picker/src/main.vue +236 -236
  84. package/packages/dialog/index.js +5 -5
  85. package/packages/enable-drag/index.js +5 -5
  86. package/packages/enterprise/index.js +5 -5
  87. package/packages/enterprise/src/main.vue +66 -66
  88. package/packages/error-page/index.js +5 -5
  89. package/packages/error-page/src/main.vue +44 -44
  90. package/packages/flow/.DS_Store +0 -0
  91. package/packages/flow/index.js +5 -5
  92. package/packages/flow/src/component/Circulate.vue +351 -351
  93. package/packages/flow/src/component/CommonOpinions.vue +346 -346
  94. package/packages/flow/src/component/CustomPreset.vue +322 -322
  95. package/packages/flow/src/component/FileList.vue +99 -99
  96. package/packages/flow/src/component/Preset.vue +255 -255
  97. package/packages/flow/src/component/SendMsg.vue +241 -241
  98. package/packages/flow/src/component/TimeLimit.vue +190 -190
  99. package/packages/flow/src/component/taskUnionExamine.vue +619 -619
  100. package/packages/flow/src/form.vue +121 -121
  101. package/packages/flow/src/freeStartFlow.vue +2843 -2843
  102. package/packages/flow/src/main.vue +3369 -3367
  103. package/packages/flow/src/processForm.vue +1091 -1091
  104. package/packages/flow/src/processReject.vue +294 -294
  105. package/packages/flow/src/reset.vue +905 -905
  106. package/packages/flow/src/selectUser.vue +6 -0
  107. package/packages/flow/src/startTaskRead.vue +659 -659
  108. package/packages/flow/src/supervise.vue +149 -149
  109. package/packages/flow/src/table.vue +58 -58
  110. package/packages/flow-group/index.js +5 -5
  111. package/packages/flow-group/src/main.vue +688 -688
  112. package/packages/flow-list/.DS_Store +0 -0
  113. package/packages/flow-list/index.js +5 -5
  114. package/packages/flow-list/src/main.vue +1738 -1757
  115. package/packages/form/index.js +5 -5
  116. package/packages/form/src/main.vue +3581 -3581
  117. package/packages/form/src/table.vue +1426 -1426
  118. package/packages/handle-user/index.js +5 -5
  119. package/packages/handle-user/src/main.vue +138 -138
  120. package/packages/handler/index.js +5 -5
  121. package/packages/handler/src/main.vue +493 -493
  122. package/packages/icon/index.js +5 -5
  123. package/packages/icon/src/main.vue +101 -101
  124. package/packages/icons/index.js +5 -5
  125. package/packages/icons/src/main.vue +81 -81
  126. package/packages/input/index.js +5 -5
  127. package/packages/input/src/main.vue +356 -356
  128. package/packages/input-number/index.js +5 -5
  129. package/packages/input-number/src/main.vue +106 -106
  130. package/packages/label/index.js +5 -5
  131. package/packages/label/src/main.vue +457 -457
  132. package/packages/layout/index.js +5 -5
  133. package/packages/layout/src/item.vue +152 -152
  134. package/packages/layout/src/main.vue +31 -31
  135. package/packages/login/.DS_Store +0 -0
  136. package/packages/login/index.js +5 -5
  137. package/packages/login/src/main.vue +2015 -1988
  138. package/packages/login/src/resetPassword.vue +562 -562
  139. package/packages/main/.DS_Store +0 -0
  140. package/packages/main/index.js +5 -5
  141. package/packages/main/src/.DS_Store +0 -0
  142. package/packages/main/src/default/message.vue +249 -249
  143. package/packages/main/src/default/notice.vue +157 -157
  144. package/packages/main/src/default/userinfo.vue +503 -503
  145. package/packages/main/src/public/online.vue +89 -89
  146. package/packages/main/src/public/search.vue +462 -462
  147. package/packages/main/src/public/settings.vue +221 -221
  148. package/packages/main/src/simplicity/apps.vue +388 -388
  149. package/packages/main/src/simplicity/avatar.vue +83 -83
  150. package/packages/main/src/simplicity/handler.vue +259 -259
  151. package/packages/main/src/simplicity/index.vue +2089 -2089
  152. package/packages/main/src/simplicity/lists.vue +84 -84
  153. package/packages/main/src/simplicity/menu-list.vue +135 -135
  154. package/packages/main/src/simplicity/message.vue +259 -259
  155. package/packages/main/src/simplicity/notice.vue +190 -190
  156. package/packages/main/src/simplicity/router-page.vue +45 -45
  157. package/packages/main/src/simplicity/sub-menu.vue +264 -264
  158. package/packages/main/src/simplicity/user.vue +257 -257
  159. package/packages/main/src/simplicity/userinfo.vue +312 -312
  160. package/packages/menu/.DS_Store +0 -0
  161. package/packages/menu/index.js +5 -5
  162. package/packages/menu/src/main.vue +584 -584
  163. package/packages/nav/index.js +5 -5
  164. package/packages/nav/src/main.vue +351 -351
  165. package/packages/notify/index.js +5 -5
  166. package/packages/notify/src/main.vue +538 -538
  167. package/packages/page/index.js +5 -5
  168. package/packages/page/src/main.vue +167 -167
  169. package/packages/pagination/index.js +5 -5
  170. package/packages/pagination/src/main.vue +96 -96
  171. package/packages/player/index.js +5 -5
  172. package/packages/player/src/main.vue +194 -194
  173. package/packages/qr-code/index.js +5 -5
  174. package/packages/qr-code/src/main.vue +170 -170
  175. package/packages/radio-group/index.js +6 -6
  176. package/packages/radio-group/src/main.vue +319 -319
  177. package/packages/retrial-auth/index.js +5 -5
  178. package/packages/retrial-auth/src/main.vue +280 -280
  179. package/packages/scrollbar/.DS_Store +0 -0
  180. package/packages/select/.DS_Store +0 -0
  181. package/packages/select/index.js +5 -5
  182. package/packages/select/src/main.vue +778 -778
  183. package/packages/select-ganged/index.js +5 -5
  184. package/packages/select-ganged/src/main.vue +724 -724
  185. package/packages/selector/index.js +5 -5
  186. package/packages/selector/src/main.vue +687 -687
  187. package/packages/selector-panel/index.js +5 -5
  188. package/packages/selector-panel/src/main.vue +1027 -1027
  189. package/packages/selector-panel/src/selection.vue +177 -177
  190. package/packages/selector-panel/src/tree.vue +129 -129
  191. package/packages/sizer/index.js +5 -5
  192. package/packages/sizer/src/main.vue +254 -254
  193. package/packages/steps/index.js +5 -5
  194. package/packages/steps/src/main.vue +181 -181
  195. package/packages/switch/index.js +5 -5
  196. package/packages/switch/src/main.vue +154 -154
  197. package/packages/table-form/index.js +5 -5
  198. package/packages/tabs/index.js +5 -5
  199. package/packages/tabs/src/main.vue +788 -788
  200. package/packages/tabs-panel/index.js +5 -5
  201. package/packages/tabs-panel/src/main.vue +29 -29
  202. package/packages/theme-chalk/lib/index.css +1 -1
  203. package/packages/theme-chalk/lib/login.css +1 -1
  204. package/packages/theme-chalk/src/.DS_Store +0 -0
  205. package/packages/theme-chalk/src/base.scss +261 -261
  206. package/packages/theme-chalk/src/button-group.scss +176 -176
  207. package/packages/theme-chalk/src/button.scss +24 -24
  208. package/packages/theme-chalk/src/calendar.scss +113 -113
  209. package/packages/theme-chalk/src/card.scss +99 -99
  210. package/packages/theme-chalk/src/checkbox-group.scss +8 -8
  211. package/packages/theme-chalk/src/clients.scss +87 -87
  212. package/packages/theme-chalk/src/data-table-form.scss +67 -67
  213. package/packages/theme-chalk/src/data-table.scss +293 -293
  214. package/packages/theme-chalk/src/date-picker.scss +7 -7
  215. package/packages/theme-chalk/src/dialog.scss +77 -77
  216. package/packages/theme-chalk/src/enable-drag.scss +181 -181
  217. package/packages/theme-chalk/src/enterprise.scss +5 -5
  218. package/packages/theme-chalk/src/error-page.scss +18 -18
  219. package/packages/theme-chalk/src/flow-group.scss +110 -110
  220. package/packages/theme-chalk/src/flow-list.scss +39 -39
  221. package/packages/theme-chalk/src/flow.scss +343 -343
  222. package/packages/theme-chalk/src/form.scss +496 -496
  223. package/packages/theme-chalk/src/handle-user.scss +40 -40
  224. package/packages/theme-chalk/src/handler.scss +143 -143
  225. package/packages/theme-chalk/src/icon.scss +1792 -1792
  226. package/packages/theme-chalk/src/icons.scss +99 -99
  227. package/packages/theme-chalk/src/input.scss +9 -9
  228. package/packages/theme-chalk/src/label.scss +24 -24
  229. package/packages/theme-chalk/src/layout.scss +46 -46
  230. package/packages/theme-chalk/src/login.scss +981 -981
  231. package/packages/theme-chalk/src/main.scss +663 -663
  232. package/packages/theme-chalk/src/menu.scss +222 -222
  233. package/packages/theme-chalk/src/mixins/color.scss +117 -117
  234. package/packages/theme-chalk/src/nav.scss +111 -111
  235. package/packages/theme-chalk/src/page.scss +3 -3
  236. package/packages/theme-chalk/src/pagination.scss +29 -29
  237. package/packages/theme-chalk/src/player.scss +9 -9
  238. package/packages/theme-chalk/src/qr-code.scss +17 -17
  239. package/packages/theme-chalk/src/radio-group.scss +9 -9
  240. package/packages/theme-chalk/src/retrial-auth.scss +38 -38
  241. package/packages/theme-chalk/src/select-ganged.scss +8 -8
  242. package/packages/theme-chalk/src/select.scss +8 -8
  243. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  244. package/packages/theme-chalk/src/selector.scss +91 -91
  245. package/packages/theme-chalk/src/simplicity.scss +1355 -1355
  246. package/packages/theme-chalk/src/sizer.scss +36 -36
  247. package/packages/theme-chalk/src/steps.scss +88 -88
  248. package/packages/theme-chalk/src/switch.scss +3 -3
  249. package/packages/theme-chalk/src/table-form.scss +1 -1
  250. package/packages/theme-chalk/src/tabs.scss +87 -87
  251. package/packages/theme-chalk/src/tips.scss +7 -7
  252. package/packages/theme-chalk/src/toolbar.scss +179 -179
  253. package/packages/theme-chalk/src/tree-group.scss +72 -72
  254. package/packages/theme-chalk/src/tree.scss +165 -165
  255. package/packages/theme-chalk/src/upload.scss +168 -168
  256. package/packages/theme-chalk/src/wxlogin.scss +3 -3
  257. package/packages/tips/index.js +5 -5
  258. package/packages/tips/src/main.vue +141 -141
  259. package/packages/toolbar/index.js +5 -5
  260. package/packages/toolbar/src/main.vue +430 -430
  261. package/packages/tree/index.js +5 -5
  262. package/packages/tree-group/index.js +5 -5
  263. package/packages/upload/.DS_Store +0 -0
  264. package/packages/upload/index.js +5 -5
  265. package/packages/upload/src/main.vue +1347 -1347
  266. package/packages/upload/src/picture.js +15 -15
  267. package/packages/wujie/index.js +5 -5
  268. package/packages/wujie/src/main.vue +145 -145
  269. package/packages/wxlogin/index.js +5 -5
  270. package/packages/wxlogin/src/main.vue +128 -128
  271. package/src/.DS_Store +0 -0
  272. package/src/config/api.js +291 -291
  273. package/src/config/image.js +2 -2
  274. package/src/index.js +163 -163
  275. package/src/utils/.DS_Store +0 -0
  276. package/src/utils/bus.js +3 -3
  277. package/src/utils/date-util.js +312 -312
  278. package/src/utils/http.js +50 -50
  279. package/src/utils/rules.js +18 -18
  280. package/src/utils/store.js +21 -21
  281. package/src/utils/util.js +3 -2
  282. package/src/utils/webSocket.js +107 -107
package/lib/calogin.js CHANGED
@@ -586,8 +586,9 @@ var ajaxStream = function ajaxStream(_ref2) {
586
586
  try {
587
587
  // 假设数据是 JSON 格式
588
588
  var parsedData = JSON.parse(data);
589
- info.time = parsedData.time;
590
- info.conversationId = parsedData.conversationId;
589
+ info = _extends({}, info, parsedData);
590
+ // info.time = parsedData.time;
591
+ // info.conversationId = parsedData.conversationId;
591
592
  var thinkRegex = /<think>([\s\S]*?)<\/think>([\s\S]*)?/;
592
593
  var match = parsedData.message.match(thinkRegex);
593
594
  if (match) {
@@ -4254,23 +4255,20 @@ module.exports = require("sm-crypto");
4254
4255
  // ESM COMPAT FLAG
4255
4256
  __webpack_require__.r(__webpack_exports__);
4256
4257
 
4257
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/calogin/src/main.vue?vue&type=template&id=e879a944&scoped=true&
4258
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/calogin/src/main.vue?vue&type=template&id=4b7c35fc&scoped=true&
4258
4259
  var render = function () {
4259
4260
  var _vm = this
4260
4261
  var _h = _vm.$createElement
4261
4262
  var _c = _vm._self._c || _h
4262
- return _c(
4263
- "span",
4264
- { on: { click: _vm.getCertificate } },
4265
- [_vm._t("default")],
4266
- 2
4267
- )
4263
+ return _c("span", [
4264
+ _c("span", { on: { click: _vm.getCertificate } }, [_vm._t("default")], 2),
4265
+ ])
4268
4266
  }
4269
4267
  var staticRenderFns = []
4270
4268
  render._withStripped = true
4271
4269
 
4272
4270
 
4273
- // CONCATENATED MODULE: ./packages/calogin/src/main.vue?vue&type=template&id=e879a944&scoped=true&
4271
+ // CONCATENATED MODULE: ./packages/calogin/src/main.vue?vue&type=template&id=4b7c35fc&scoped=true&
4274
4272
 
4275
4273
  // EXTERNAL MODULE: ./src/utils/util.js
4276
4274
  var util = __webpack_require__(0);
@@ -4280,8 +4278,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
4280
4278
 
4281
4279
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4282
4280
 
4283
- /**
4284
- * JIT_GW_ExtInterface 模块,提供与客户端交互的功能
4281
+ /**
4282
+ * JIT_GW_ExtInterface 模块,提供与客户端交互的功能
4285
4283
  */
4286
4284
  var CA_ExtInterface = function () {
4287
4285
  function CA_ExtInterface() {
@@ -4290,13 +4288,15 @@ var CA_ExtInterface = function () {
4290
4288
  this.currentSessionWSURL = '';
4291
4289
  this.useActioveX = false;
4292
4290
  this.options = {};
4291
+ this.webSocket = null;
4292
+ this.init();
4293
4293
  }
4294
4294
 
4295
- /**
4296
- * 简单的 Object.assign 兼容 IE <= 11 的 polyfill
4297
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
4298
- * @param {Object} target - 目标对象
4299
- * @param {Object} options - 新的选项对象
4295
+ /**
4296
+ * 简单的 Object.assign 兼容 IE <= 11 的 polyfill
4297
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
4298
+ * @param {Object} target - 目标对象
4299
+ * @param {Object} options - 新的选项对象
4300
4300
  */
4301
4301
 
4302
4302
 
@@ -4311,8 +4311,8 @@ var CA_ExtInterface = function () {
4311
4311
  }
4312
4312
  };
4313
4313
 
4314
- /**
4315
- * 检查当前会话的 WebSocket URL
4314
+ /**
4315
+ * 检查当前会话的 WebSocket URL
4316
4316
  */
4317
4317
 
4318
4318
 
@@ -4326,8 +4326,8 @@ var CA_ExtInterface = function () {
4326
4326
  }
4327
4327
  };
4328
4328
 
4329
- /**
4330
- * 检查是否使用 ActiveX
4329
+ /**
4330
+ * 检查是否使用 ActiveX
4331
4331
  */
4332
4332
 
4333
4333
 
@@ -4339,11 +4339,11 @@ var CA_ExtInterface = function () {
4339
4339
  }
4340
4340
  };
4341
4341
 
4342
- /**
4343
- * 扩展发送消息并等待响应
4344
- * @param {string} operatorCmd - 操作命令
4345
- * @param {string} sendMsg - 发送的消息
4346
- * @returns {string} 响应消息
4342
+ /**
4343
+ * 扩展发送消息并等待响应
4344
+ * @param {string} operatorCmd - 操作命令
4345
+ * @param {string} sendMsg - 发送的消息
4346
+ * @returns {string} 响应消息
4347
4347
  */
4348
4348
 
4349
4349
 
@@ -4353,11 +4353,11 @@ var CA_ExtInterface = function () {
4353
4353
  return this.sendAndWaitMessage(this.currentSessionWSURL, strSendMsg);
4354
4354
  };
4355
4355
 
4356
- /**
4357
- * 发送消息并等待响应
4358
- * @param {string} wsurl - WebSocket URL
4359
- * @param {string} sendMsg - 发送的消息
4360
- * @returns {string} 响应消息
4356
+ /**
4357
+ * 发送消息并等待响应
4358
+ * @param {string} wsurl - WebSocket URL
4359
+ * @param {string} sendMsg - 发送的消息
4360
+ * @returns {string} 响应消息
4361
4361
  */
4362
4362
 
4363
4363
 
@@ -4381,9 +4381,9 @@ var CA_ExtInterface = function () {
4381
4381
  return ResultMsg;
4382
4382
  };
4383
4383
 
4384
- /**
4385
- * 配置选项
4386
- * @param {Object} extendOption - 扩展选项
4384
+ /**
4385
+ * 配置选项
4386
+ * @param {Object} extendOption - 扩展选项
4387
4387
  */
4388
4388
 
4389
4389
 
@@ -4393,8 +4393,8 @@ var CA_ExtInterface = function () {
4393
4393
  }
4394
4394
  };
4395
4395
 
4396
- /**
4397
- * 初始化
4396
+ /**
4397
+ * 初始化
4398
4398
  */
4399
4399
 
4400
4400
 
@@ -4402,9 +4402,9 @@ var CA_ExtInterface = function () {
4402
4402
  this.isUseActioveX();
4403
4403
  };
4404
4404
 
4405
- /**
4406
- * 返回客户端的版本
4407
- * @returns {string} 客户端版本
4405
+ /**
4406
+ * 返回客户端的版本
4407
+ * @returns {string} 客户端版本
4408
4408
  */
4409
4409
 
4410
4410
 
@@ -4417,13 +4417,13 @@ var CA_ExtInterface = function () {
4417
4417
  }
4418
4418
  };
4419
4419
 
4420
- /**
4421
- * 下载客户端程序并安装
4422
- * @param {string} bstrURL - 下载地址
4423
- * @param {string} bstrHashValue - 哈希值
4424
- * @param {boolean} bSync - 是否同步安装
4425
- * @param {boolean} bOnlySSO - 是否仅安装 SSO
4426
- * @returns {number} 安装结果
4420
+ /**
4421
+ * 下载客户端程序并安装
4422
+ * @param {string} bstrURL - 下载地址
4423
+ * @param {string} bstrHashValue - 哈希值
4424
+ * @param {boolean} bSync - 是否同步安装
4425
+ * @param {boolean} bOnlySSO - 是否仅安装 SSO
4426
+ * @returns {number} 安装结果
4427
4427
  */
4428
4428
 
4429
4429
 
@@ -4437,11 +4437,11 @@ var CA_ExtInterface = function () {
4437
4437
  }
4438
4438
  };
4439
4439
 
4440
- /**
4441
- * 获取硬件指纹信息
4442
- * @param {number} dwSign - 签名
4443
- * @param {string} strGateWayIP - 网关 IP
4444
- * @returns {string} 硬件指纹信息
4440
+ /**
4441
+ * 获取硬件指纹信息
4442
+ * @param {number} dwSign - 签名
4443
+ * @param {string} strGateWayIP - 网关 IP
4444
+ * @returns {string} 硬件指纹信息
4445
4445
  */
4446
4446
 
4447
4447
 
@@ -4455,12 +4455,12 @@ var CA_ExtInterface = function () {
4455
4455
  }
4456
4456
  };
4457
4457
 
4458
- /**
4459
- * 设置转发策略和代填策略
4460
- * @param {string} strProxyPolicy - 转发策略
4461
- * @param {string} strSSOPolicy - 代填策略
4462
- * @param {string} strGatewayAddress - 网关地址
4463
- * @returns {number} 设置结果
4458
+ /**
4459
+ * 设置转发策略和代填策略
4460
+ * @param {string} strProxyPolicy - 转发策略
4461
+ * @param {string} strSSOPolicy - 代填策略
4462
+ * @param {string} strGatewayAddress - 网关地址
4463
+ * @returns {number} 设置结果
4464
4464
  */
4465
4465
 
4466
4466
 
@@ -4474,11 +4474,11 @@ var CA_ExtInterface = function () {
4474
4474
  }
4475
4475
  };
4476
4476
 
4477
- /**
4478
- * 启动认证信息模块
4479
- * @param {string} strFileName - 文件名
4480
- * @param {string} strXmlData - XML 数据
4481
- * @returns {string} 认证信息
4477
+ /**
4478
+ * 启动认证信息模块
4479
+ * @param {string} strFileName - 文件名
4480
+ * @param {string} strXmlData - XML 数据
4481
+ * @returns {string} 认证信息
4482
4482
  */
4483
4483
 
4484
4484
 
@@ -4492,10 +4492,10 @@ var CA_ExtInterface = function () {
4492
4492
  }
4493
4493
  };
4494
4494
 
4495
- /**
4496
- * 打开 BS 应用
4497
- * @param {string} strUrl - 应用 URL
4498
- * @returns {number} 打开结果
4495
+ /**
4496
+ * 打开 BS 应用
4497
+ * @param {string} strUrl - 应用 URL
4498
+ * @returns {number} 打开结果
4499
4499
  */
4500
4500
 
4501
4501
 
@@ -4509,12 +4509,12 @@ var CA_ExtInterface = function () {
4509
4509
  }
4510
4510
  };
4511
4511
 
4512
- /**
4513
- * 打开 CS 应用
4514
- * @param {string} strGatewayAddress - 网关地址
4515
- * @param {string} strAppFlag - 应用标识
4516
- * @param {string} strAppPath - 应用路径
4517
- * @returns {number} 打开结果
4512
+ /**
4513
+ * 打开 CS 应用
4514
+ * @param {string} strGatewayAddress - 网关地址
4515
+ * @param {string} strAppFlag - 应用标识
4516
+ * @param {string} strAppPath - 应用路径
4517
+ * @returns {number} 打开结果
4518
4518
  */
4519
4519
 
4520
4520
 
@@ -4528,13 +4528,13 @@ var CA_ExtInterface = function () {
4528
4528
  }
4529
4529
  };
4530
4530
 
4531
- /**
4532
- * 设置自动更新策略
4533
- * @param {string} strGatewayAddress - 网关地址
4534
- * @param {number} nGatewayPort - 网关端口
4535
- * @param {string} strUserToken - 用户令牌
4536
- * @param {number} updatedelay - 更新延迟
4537
- * @returns {number} 设置结果
4531
+ /**
4532
+ * 设置自动更新策略
4533
+ * @param {string} strGatewayAddress - 网关地址
4534
+ * @param {number} nGatewayPort - 网关端口
4535
+ * @param {string} strUserToken - 用户令牌
4536
+ * @param {number} updatedelay - 更新延迟
4537
+ * @returns {number} 设置结果
4538
4538
  */
4539
4539
 
4540
4540
 
@@ -4548,10 +4548,10 @@ var CA_ExtInterface = function () {
4548
4548
  }
4549
4549
  };
4550
4550
 
4551
- /**
4552
- * 获取客户端 IP
4553
- * @param {string} strGatewayIP - 网关 IP
4554
- * @returns {string} 客户端 IP
4551
+ /**
4552
+ * 获取客户端 IP
4553
+ * @param {string} strGatewayIP - 网关 IP
4554
+ * @returns {string} 客户端 IP
4555
4555
  */
4556
4556
 
4557
4557
 
@@ -4565,10 +4565,10 @@ var CA_ExtInterface = function () {
4565
4565
  }
4566
4566
  };
4567
4567
 
4568
- /**
4569
- * 登出网关
4570
- * @param {string} strServerIP - 服务器 IP
4571
- * @returns {number} 登出结果
4568
+ /**
4569
+ * 登出网关
4570
+ * @param {string} strServerIP - 服务器 IP
4571
+ * @returns {number} 登出结果
4572
4572
  */
4573
4573
 
4574
4574
 
@@ -4582,11 +4582,11 @@ var CA_ExtInterface = function () {
4582
4582
  }
4583
4583
  };
4584
4584
 
4585
- /**
4586
- * 运行安装包
4587
- * @param {number} lRunType - 运行类型
4588
- * @param {boolean} bIsOnlySSO - 是否仅安装 SSO
4589
- * @returns {number} 运行结果
4585
+ /**
4586
+ * 运行安装包
4587
+ * @param {number} lRunType - 运行类型
4588
+ * @param {boolean} bIsOnlySSO - 是否仅安装 SSO
4589
+ * @returns {number} 运行结果
4590
4590
  */
4591
4591
 
4592
4592
 
@@ -4600,9 +4600,9 @@ var CA_ExtInterface = function () {
4600
4600
  }
4601
4601
  };
4602
4602
 
4603
- /**
4604
- * 获取下载进度
4605
- * @returns {number} 下载进度
4603
+ /**
4604
+ * 获取下载进度
4605
+ * @returns {number} 下载进度
4606
4606
  */
4607
4607
 
4608
4608
 
@@ -4616,9 +4616,9 @@ var CA_ExtInterface = function () {
4616
4616
  }
4617
4617
  };
4618
4618
 
4619
- /**
4620
- * 是否安装完成
4621
- * @returns {boolean} 安装完成状态
4619
+ /**
4620
+ * 是否安装完成
4621
+ * @returns {boolean} 安装完成状态
4622
4622
  */
4623
4623
 
4624
4624
 
@@ -4632,11 +4632,11 @@ var CA_ExtInterface = function () {
4632
4632
  }
4633
4633
  };
4634
4634
 
4635
- /**
4636
- * 初始化签包对象
4637
- * @param {string} strAlgType - 算法类型
4638
- * @param {string} strAuxParam - 辅助参数
4639
- * @returns {number} 初始化结果
4635
+ /**
4636
+ * 初始化签包对象
4637
+ * @param {string} strAlgType - 算法类型
4638
+ * @param {string} strAuxParam - 辅助参数
4639
+ * @returns {number} 初始化结果
4640
4640
  */
4641
4641
 
4642
4642
 
@@ -4650,10 +4650,10 @@ var CA_ExtInterface = function () {
4650
4650
  }
4651
4651
  };
4652
4652
 
4653
- /**
4654
- * 设置摘要算法
4655
- * @param {string} strDigestAlg - 摘要算法
4656
- * @returns {number} 设置结果
4653
+ /**
4654
+ * 设置摘要算法
4655
+ * @param {string} strDigestAlg - 摘要算法
4656
+ * @returns {number} 设置结果
4657
4657
  */
4658
4658
 
4659
4659
 
@@ -4667,10 +4667,10 @@ var CA_ExtInterface = function () {
4667
4667
  }
4668
4668
  };
4669
4669
 
4670
- /**
4671
- * 设置单证书是否弹出对话框
4672
- * @param {number} isChoose - 是否弹出对话框
4673
- * @returns {number} 设置结果
4670
+ /**
4671
+ * 设置单证书是否弹出对话框
4672
+ * @param {number} isChoose - 是否弹出对话框
4673
+ * @returns {number} 设置结果
4674
4674
  */
4675
4675
 
4676
4676
 
@@ -4684,11 +4684,11 @@ var CA_ExtInterface = function () {
4684
4684
  }
4685
4685
  };
4686
4686
 
4687
- /**
4688
- * 添加证书过滤条件
4689
- * @param {number} ulType - 过滤类型
4690
- * @param {string} strValue - 过滤值
4691
- * @returns {number} 添加结果
4687
+ /**
4688
+ * 添加证书过滤条件
4689
+ * @param {number} ulType - 过滤类型
4690
+ * @param {string} strValue - 过滤值
4691
+ * @returns {number} 添加结果
4692
4692
  */
4693
4693
 
4694
4694
 
@@ -4702,9 +4702,9 @@ var CA_ExtInterface = function () {
4702
4702
  }
4703
4703
  };
4704
4704
 
4705
- /**
4706
- * 清除所有过滤条件
4707
- * @returns {number} 清除结果
4705
+ /**
4706
+ * 清除所有过滤条件
4707
+ * @returns {number} 清除结果
4708
4708
  */
4709
4709
 
4710
4710
 
@@ -4718,10 +4718,10 @@ var CA_ExtInterface = function () {
4718
4718
  }
4719
4719
  };
4720
4720
 
4721
- /**
4722
- * P1 签名
4723
- * @param {string} strValueBase64 - 待签名的 Base64 字符串
4724
- * @returns {string} 签名结果
4721
+ /**
4722
+ * P1 签名
4723
+ * @param {string} strValueBase64 - 待签名的 Base64 字符串
4724
+ * @returns {string} 签名结果
4725
4725
  */
4726
4726
 
4727
4727
 
@@ -4735,10 +4735,10 @@ var CA_ExtInterface = function () {
4735
4735
  }
4736
4736
  };
4737
4737
 
4738
- /**
4739
- * P1 签名字符串
4740
- * @param {string} strValue - 待签名的字符串
4741
- * @returns {string} 签名结果
4738
+ /**
4739
+ * P1 签名字符串
4740
+ * @param {string} strValue - 待签名的字符串
4741
+ * @returns {string} 签名结果
4742
4742
  */
4743
4743
 
4744
4744
 
@@ -4752,12 +4752,12 @@ var CA_ExtInterface = function () {
4752
4752
  }
4753
4753
  };
4754
4754
 
4755
- /**
4756
- * P7 签名
4757
- * @param {string} strValueBase64 - 待签名的 Base64 字符串
4758
- * @param {boolean} isDetach - 是否分离签名
4759
- * @param {boolean} isIncludeCert - 是否包含证书
4760
- * @returns {string} 签名结果
4755
+ /**
4756
+ * P7 签名
4757
+ * @param {string} strValueBase64 - 待签名的 Base64 字符串
4758
+ * @param {boolean} isDetach - 是否分离签名
4759
+ * @param {boolean} isIncludeCert - 是否包含证书
4760
+ * @returns {string} 签名结果
4761
4761
  */
4762
4762
 
4763
4763
 
@@ -4771,12 +4771,12 @@ var CA_ExtInterface = function () {
4771
4771
  }
4772
4772
  };
4773
4773
 
4774
- /**
4775
- * P7 签名字符串
4776
- * @param {string} strValue - 待签名的字符串
4777
- * @param {boolean} isDetach - 是否分离签名
4778
- * @param {boolean} isIncludeCert - 是否包含证书
4779
- * @returns {string} 签名结果
4774
+ /**
4775
+ * P7 签名字符串
4776
+ * @param {string} strValue - 待签名的字符串
4777
+ * @param {boolean} isDetach - 是否分离签名
4778
+ * @param {boolean} isIncludeCert - 是否包含证书
4779
+ * @returns {string} 签名结果
4780
4780
  */
4781
4781
 
4782
4782
 
@@ -4790,9 +4790,9 @@ var CA_ExtInterface = function () {
4790
4790
  }
4791
4791
  };
4792
4792
 
4793
- /**
4794
- * 释放签名对象
4795
- * @returns {number} 释放结果
4793
+ /**
4794
+ * 释放签名对象
4795
+ * @returns {number} 释放结果
4796
4796
  */
4797
4797
 
4798
4798
 
@@ -4806,9 +4806,9 @@ var CA_ExtInterface = function () {
4806
4806
  }
4807
4807
  };
4808
4808
 
4809
- /**
4810
- * 获取签名版本
4811
- * @returns {string} 签名版本
4809
+ /**
4810
+ * 获取签名版本
4811
+ * @returns {string} 签名版本
4812
4812
  */
4813
4813
 
4814
4814
 
@@ -4822,9 +4822,9 @@ var CA_ExtInterface = function () {
4822
4822
  }
4823
4823
  };
4824
4824
 
4825
- /**
4826
- * 获取签名证书
4827
- * @returns {string} 签名证书
4825
+ /**
4826
+ * 获取签名证书
4827
+ * @returns {string} 签名证书
4828
4828
  */
4829
4829
 
4830
4830
 
@@ -4838,9 +4838,9 @@ var CA_ExtInterface = function () {
4838
4838
  }
4839
4839
  };
4840
4840
 
4841
- /**
4842
- * 获取错误码
4843
- * @returns {number} 错误码
4841
+ /**
4842
+ * 获取错误码
4843
+ * @returns {number} 错误码
4844
4844
  */
4845
4845
 
4846
4846
 
@@ -4854,9 +4854,9 @@ var CA_ExtInterface = function () {
4854
4854
  }
4855
4855
  };
4856
4856
 
4857
- /**
4858
- * 获取错误信息
4859
- * @returns {string} 错误信息
4857
+ /**
4858
+ * 获取错误信息
4859
+ * @returns {string} 错误信息
4860
4860
  */
4861
4861
 
4862
4862
 
@@ -4870,9 +4870,9 @@ var CA_ExtInterface = function () {
4870
4870
  }
4871
4871
  };
4872
4872
 
4873
- /**
4874
- * 销毁认证对象
4875
- * @returns {number} 销毁结果
4873
+ /**
4874
+ * 销毁认证对象
4875
+ * @returns {number} 销毁结果
4876
4876
  */
4877
4877
 
4878
4878
 
@@ -4886,9 +4886,9 @@ var CA_ExtInterface = function () {
4886
4886
  }
4887
4887
  };
4888
4888
 
4889
- /**
4890
- * 获取证书类型
4891
- * @returns {string} 证书类型
4889
+ /**
4890
+ * 获取证书类型
4891
+ * @returns {string} 证书类型
4892
4892
  */
4893
4893
 
4894
4894
 
@@ -4902,9 +4902,9 @@ var CA_ExtInterface = function () {
4902
4902
  }
4903
4903
  };
4904
4904
 
4905
- /**
4906
- * 获取签名摘要算法
4907
- * @returns {string} 签名摘要算法
4905
+ /**
4906
+ * 获取签名摘要算法
4907
+ * @returns {string} 签名摘要算法
4908
4908
  */
4909
4909
 
4910
4910
 
@@ -4918,11 +4918,11 @@ var CA_ExtInterface = function () {
4918
4918
  }
4919
4919
  };
4920
4920
 
4921
- /**
4922
- * 使能调用序列
4923
- * @param {boolean} bCallQueueEnable - 是否使能调用序列
4924
- * @param {boolean} bHeadInfoEnable - 是否使能头部信息
4925
- * @returns {number} 使能结果
4921
+ /**
4922
+ * 使能调用序列
4923
+ * @param {boolean} bCallQueueEnable - 是否使能调用序列
4924
+ * @param {boolean} bHeadInfoEnable - 是否使能头部信息
4925
+ * @returns {number} 使能结果
4926
4926
  */
4927
4927
 
4928
4928
 
@@ -4936,9 +4936,9 @@ var CA_ExtInterface = function () {
4936
4936
  }
4937
4937
  };
4938
4938
 
4939
- /**
4940
- * 清空调用序列结果
4941
- * @returns {number} 清空调用序列结果
4939
+ /**
4940
+ * 清空调用序列结果
4941
+ * @returns {number} 清空调用序列结果
4942
4942
  */
4943
4943
 
4944
4944
 
@@ -4952,9 +4952,9 @@ var CA_ExtInterface = function () {
4952
4952
  }
4953
4953
  };
4954
4954
 
4955
- /**
4956
- * 获取调用序列结果
4957
- * @returns {string} 调用序列结果
4955
+ /**
4956
+ * 获取调用序列结果
4957
+ * @returns {string} 调用序列结果
4958
4958
  */
4959
4959
 
4960
4960
 
@@ -4968,12 +4968,12 @@ var CA_ExtInterface = function () {
4968
4968
  }
4969
4969
  };
4970
4970
 
4971
- /**
4972
- * 客户端安全策略检查
4973
- * @param {string} strGatewayAddress - 网关地址
4974
- * @param {number} usGatewayPort - 网关端口
4975
- * @param {string} strSecurityPolicys - 安全策略
4976
- * @returns {boolean} 检查结果
4971
+ /**
4972
+ * 客户端安全策略检查
4973
+ * @param {string} strGatewayAddress - 网关地址
4974
+ * @param {number} usGatewayPort - 网关端口
4975
+ * @param {string} strSecurityPolicys - 安全策略
4976
+ * @returns {boolean} 检查结果
4977
4977
  */
4978
4978
 
4979
4979
 
@@ -4987,9 +4987,9 @@ var CA_ExtInterface = function () {
4987
4987
  }
4988
4988
  };
4989
4989
 
4990
- /**
4991
- * 获取通讯协议版本
4992
- * @returns {string} 通讯协议版本
4990
+ /**
4991
+ * 获取通讯协议版本
4992
+ * @returns {string} 通讯协议版本
4993
4993
  */
4994
4994
 
4995
4995
 
@@ -5003,13 +5003,13 @@ var CA_ExtInterface = function () {
5003
5003
  }
5004
5004
  };
5005
5005
 
5006
- /**
5007
- * 修改 Key 的 Pin 码
5008
- * @param {string} strCertSn - 证书序列号
5009
- * @param {number} lPinCodeType - Pin 码类型
5010
- * @param {string} strCurPinCode - 当前 Pin 码
5011
- * @param {string} strNewPinCode - 新 Pin 码
5012
- * @returns {number} 修改结果
5006
+ /**
5007
+ * 修改 Key 的 Pin 码
5008
+ * @param {string} strCertSn - 证书序列号
5009
+ * @param {number} lPinCodeType - Pin 码类型
5010
+ * @param {string} strCurPinCode - 当前 Pin 码
5011
+ * @param {string} strNewPinCode - 新 Pin 码
5012
+ * @returns {number} 修改结果
5013
5013
  */
5014
5014
 
5015
5015
 
@@ -5023,10 +5023,10 @@ var CA_ExtInterface = function () {
5023
5023
  }
5024
5024
  };
5025
5025
 
5026
- /**
5027
- * 等待策略设置完毕
5028
- * @param {string} strGatewayAddress - 网关地址
5029
- * @returns {number} 等待结果
5026
+ /**
5027
+ * 等待策略设置完毕
5028
+ * @param {string} strGatewayAddress - 网关地址
5029
+ * @returns {number} 等待结果
5030
5030
  */
5031
5031
 
5032
5032
 
@@ -5040,10 +5040,10 @@ var CA_ExtInterface = function () {
5040
5040
  }
5041
5041
  };
5042
5042
 
5043
- /**
5044
- * 获取会话 Token
5045
- * @param {string} strGatewayAddress - 网关地址
5046
- * @returns {string} 会话 Token
5043
+ /**
5044
+ * 获取会话 Token
5045
+ * @param {string} strGatewayAddress - 网关地址
5046
+ * @returns {string} 会话 Token
5047
5047
  */
5048
5048
 
5049
5049
 
@@ -5057,9 +5057,9 @@ var CA_ExtInterface = function () {
5057
5057
  }
5058
5058
  };
5059
5059
 
5060
- /**
5061
- * 获取控件版本
5062
- * @returns {string} 控件版本
5060
+ /**
5061
+ * 获取控件版本
5062
+ * @returns {string} 控件版本
5063
5063
  */
5064
5064
 
5065
5065
 
@@ -5073,10 +5073,10 @@ var CA_ExtInterface = function () {
5073
5073
  }
5074
5074
  };
5075
5075
 
5076
- /**
5077
- * 设置语言资源
5078
- * @param {string} strLanguage - 语言资源
5079
- * @returns {number} 设置结果
5076
+ /**
5077
+ * 设置语言资源
5078
+ * @param {string} strLanguage - 语言资源
5079
+ * @returns {number} 设置结果
5080
5080
  */
5081
5081
 
5082
5082
 
@@ -5090,12 +5090,12 @@ var CA_ExtInterface = function () {
5090
5090
  }
5091
5091
  };
5092
5092
 
5093
- /**
5094
- * 获取用户属性
5095
- * @param {string} strGatewayAddress - 网关地址
5096
- * @param {string} strAppFlag - 应用标识
5097
- * @param {string} strAttributeName - 属性名称
5098
- * @returns {string} 用户属性值
5093
+ /**
5094
+ * 获取用户属性
5095
+ * @param {string} strGatewayAddress - 网关地址
5096
+ * @param {string} strAppFlag - 应用标识
5097
+ * @param {string} strAttributeName - 属性名称
5098
+ * @returns {string} 用户属性值
5099
5099
  */
5100
5100
 
5101
5101
 
@@ -5109,9 +5109,9 @@ var CA_ExtInterface = function () {
5109
5109
  }
5110
5110
  };
5111
5111
 
5112
- /**
5113
- * 获取签名加密 PIN 码
5114
- * @returns {string} 签名加密 PIN 码
5112
+ /**
5113
+ * 获取签名加密 PIN 码
5114
+ * @returns {string} 签名加密 PIN 码
5115
5115
  */
5116
5116
 
5117
5117
 
@@ -5124,6 +5124,186 @@ var CA_ExtInterface = function () {
5124
5124
  return result.value;
5125
5125
  }
5126
5126
  };
5127
+ /*
5128
+ *曙光四川CA
5129
+ *'SOF_GetUserList' 证书列表
5130
+ *'SOF_ExportUserCert' 导出证书
5131
+ *'SOF_GetCertInfo': 获取证书信息
5132
+ *'SOF_GenRandom': 生成随机数
5133
+ *'SOF_SignData': 获取证书签名
5134
+ *'SOF_Login': 登录证书
5135
+ *'SOF_GetPinRetryCount': 剩余次数
5136
+ */
5137
+ /**
5138
+ *
5139
+ * 获取webSocket消息
5140
+ * @returns {string}
5141
+ */
5142
+
5143
+
5144
+ CA_ExtInterface.prototype.getMessage = function getMessage(_ref) {
5145
+ var _this = this;
5146
+
5147
+ var action = _ref.action,
5148
+ _ref$params = _ref.params,
5149
+ params = _ref$params === undefined ? [] : _ref$params;
5150
+
5151
+ return new Promise(function (resolve, reject) {
5152
+ var obj = JSON.stringify({
5153
+ 'action': action,
5154
+ 'params': params
5155
+ });
5156
+ if (!_this.webSocket) {
5157
+ _this.webSocket = new WebSocket('wss://localhost:36171');
5158
+ _this.webSocket.onerror = function (event) {
5159
+ _this.webSocket = null;
5160
+ reject(event);
5161
+ };
5162
+ _this.webSocket.onopen = function () {
5163
+ _this.webSocket.send(obj);
5164
+ };
5165
+ } else {
5166
+ _this.webSocket.send(obj);
5167
+ }
5168
+ _this.webSocket.onclose = function (event) {
5169
+ _this.webSocket = null;
5170
+ };
5171
+ _this.webSocket.onmessage = function (event) {
5172
+ resolve(JSON.parse(event.data));
5173
+ };
5174
+ });
5175
+ };
5176
+ /**
5177
+ *
5178
+ * base64解码
5179
+ * @returns {string} base64解码后的字符串
5180
+ */
5181
+
5182
+
5183
+ CA_ExtInterface.prototype.base64Decode = function base64Decode(res) {
5184
+ var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
5185
+ var val = '';
5186
+ var chr1 = void 0;
5187
+ var chr2 = void 0;
5188
+ var chr3 = void 0;
5189
+ var enc1 = void 0;
5190
+ var enc2 = void 0;
5191
+ var enc3 = void 0;
5192
+ var enc4 = void 0;
5193
+ var i = 0;
5194
+ res = res.replace(/[^A-Za-z0-9\+\/\=]/g, '');
5195
+ while (i < res.length) {
5196
+ enc1 = _keyStr.indexOf(res.charAt(i++));
5197
+ enc2 = _keyStr.indexOf(res.charAt(i++));
5198
+ enc3 = _keyStr.indexOf(res.charAt(i++));
5199
+ enc4 = _keyStr.indexOf(res.charAt(i++));
5200
+ chr1 = enc1 << 2 | enc2 >> 4;
5201
+ chr2 = (enc2 & 15) << 4 | enc3 >> 2;
5202
+ chr3 = (enc3 & 3) << 6 | enc4;
5203
+ val = val + String.fromCharCode(chr1);
5204
+ if (enc3 !== 64) {
5205
+ val = val + String.fromCharCode(chr2);
5206
+ }
5207
+ if (enc4 !== 64) {
5208
+ val = val + String.fromCharCode(chr3);
5209
+ }
5210
+ }
5211
+ val = this.utf8_decode(val);
5212
+ return val;
5213
+ };
5214
+ /**
5215
+ *
5216
+ * base64编码
5217
+ * @returns {string} base64编码后的字符串
5218
+ */
5219
+
5220
+
5221
+ CA_ExtInterface.prototype.base64Encode = function base64Encode(res) {
5222
+ var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
5223
+ var val = '';
5224
+ var chr1 = void 0;
5225
+ var chr2 = void 0;
5226
+ var chr3 = void 0;
5227
+ var enc1 = void 0;
5228
+ var enc2 = void 0;
5229
+ var enc3 = void 0;
5230
+ var enc4 = void 0;
5231
+ var i = 0;
5232
+ res = this.utf8_encode(res);
5233
+ while (i < res.length) {
5234
+ chr1 = res.charCodeAt(i++);
5235
+ chr2 = res.charCodeAt(i++);
5236
+ chr3 = res.charCodeAt(i++);
5237
+ enc1 = chr1 >> 2;
5238
+ enc2 = (chr1 & 3) << 4 | chr2 >> 4;
5239
+ enc3 = (chr2 & 15) << 2 | chr3 >> 6;
5240
+ enc4 = chr3 & 63;
5241
+ if (isNaN(chr2)) {
5242
+ enc3 = enc4 = 64;
5243
+ } else if (isNaN(chr3)) {
5244
+ enc4 = 64;
5245
+ }
5246
+ val = val + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
5247
+ }
5248
+ return val;
5249
+ };
5250
+ /**
5251
+ *
5252
+ * utf8解码
5253
+ * @returns {string} utf8解码后的字符串
5254
+ */
5255
+
5256
+
5257
+ CA_ExtInterface.prototype.utf8_decode = function utf8_decode(utftext) {
5258
+ var string = '';
5259
+ var i = 0;
5260
+ var c = 0;
5261
+ // let c1 = 0;
5262
+ var c2 = 0;
5263
+ var c3 = 0;
5264
+ while (i < utftext.length) {
5265
+ c = utftext.charCodeAt(i);
5266
+ if (c < 128) {
5267
+ string += String.fromCharCode(c);
5268
+ i++;
5269
+ } else if (c > 191 && c < 224) {
5270
+ c2 = utftext.charCodeAt(i + 1);
5271
+ string += String.fromCharCode((c & 31) << 6 | c2 & 63);
5272
+ i += 2;
5273
+ } else {
5274
+ c2 = utftext.charCodeAt(i + 1);
5275
+ c3 = utftext.charCodeAt(i + 2);
5276
+ string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
5277
+ i += 3;
5278
+ }
5279
+ }
5280
+ return string;
5281
+ };
5282
+ /**
5283
+ *
5284
+ * utf8编码
5285
+ * @returns {string} utf8编码后的字符串
5286
+ */
5287
+
5288
+
5289
+ CA_ExtInterface.prototype.utf8_encode = function utf8_encode(string) {
5290
+ string = string.replace(/\r\n/g, '\n');
5291
+ var utftext = '';
5292
+ for (var n = 0; n < string.length; n++) {
5293
+ var c = string.charCodeAt(n);
5294
+ if (c < 128) {
5295
+ utftext += String.fromCharCode(c);
5296
+ } else if (c > 127 && c < 2048) {
5297
+ utftext += String.fromCharCode(c >> 6 | 192);
5298
+ utftext += String.fromCharCode(c & 63 | 128);
5299
+ } else {
5300
+ utftext += String.fromCharCode(c >> 12 | 224);
5301
+ utftext += String.fromCharCode(c >> 6 & 63 | 128);
5302
+ utftext += String.fromCharCode(c & 63 | 128);
5303
+ }
5304
+ }
5305
+ return utftext;
5306
+ };
5127
5307
 
5128
5308
  return CA_ExtInterface;
5129
5309
  }();
@@ -5137,6 +5317,8 @@ var caPlugin = new CA_ExtInterface();
5137
5317
  //
5138
5318
  //
5139
5319
  //
5320
+ //
5321
+ //
5140
5322
 
5141
5323
 
5142
5324
 
@@ -5144,6 +5326,11 @@ var caPlugin = new CA_ExtInterface();
5144
5326
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
5145
5327
  name: 'EsCaLogin',
5146
5328
  props: {
5329
+ installPath: String,
5330
+ caModel: {
5331
+ type: String,
5332
+ required: true
5333
+ }, // CA登录方式,JIDA-吉大正元,SHU_GUANG-曙光,SICHUAN-四川
5147
5334
  identifyingId: {
5148
5335
  type: String,
5149
5336
  default: function _default() {
@@ -5166,7 +5353,12 @@ var caPlugin = new CA_ExtInterface();
5166
5353
  },
5167
5354
  data: function data() {
5168
5355
  return {
5169
- signedData: ''
5356
+ userList: [],
5357
+ signedData: '', //证书原文
5358
+ b64originData: '', //签名原文
5359
+ b64SignData: '', //签名结果
5360
+ idCard: '',
5361
+ certId: ''
5170
5362
  };
5171
5363
  },
5172
5364
 
@@ -5188,58 +5380,310 @@ var caPlugin = new CA_ExtInterface();
5188
5380
  methods: {
5189
5381
  init: function init() {
5190
5382
  if (!window.PNXClient) {
5191
- var parser = new DOMParser();
5192
- var doc = parser.parseFromString("<object classid='clsid:9DD991F7-6FB0-4004-95A4-0A55006A8C42' width='0' height='0' id='PNXClient' style='position: absolute;'></object>", 'text/html');
5193
- var pnxClientElement = doc.querySelector('object');
5194
- if (pnxClientElement) {
5195
- document.body.appendChild(pnxClientElement);
5196
- }
5383
+ // 创建 object 元素
5384
+ var pnxClientElement = document.createElement('object');
5385
+ pnxClientElement.classid = 'clsid:9DD991F7-6FB0-4004-95A4-0A55006A8C42';
5386
+ pnxClientElement.width = '0';
5387
+ pnxClientElement.height = '0';
5388
+ pnxClientElement.id = 'PNXClient';
5389
+ pnxClientElement.style.position = 'absolute';
5390
+ document.body.appendChild(pnxClientElement);
5197
5391
  }
5198
5392
  },
5199
5393
  getCertificate: function getCertificate() {
5394
+ var _this = this;
5395
+
5396
+ this.$emit('click');
5200
5397
  // 检查 PNXClient 是否存在
5201
5398
  if (!window.PNXClient) {
5202
5399
  this.$message.error('控件加载失败,请刷新页面重试!');
5400
+ this.$emit('error', { code: 0, msg: '控件加载失败,请刷新页面重试!' });
5203
5401
  return;
5204
5402
  }
5205
- try {
5206
- src_plugin.getVersion();
5207
- } catch (e) {
5208
- this.$message.error('未安装控件,请进行安装控件!');
5209
- return;
5210
- }
5211
- try {
5212
- // 清除之前的过滤器
5213
- src_plugin.clearFilter();
5214
- // 初始化vctk控件
5215
- src_plugin.initialize('', this.param);
5216
- // 控制证书为一个时,不弹出证书选择框
5217
- src_plugin.setChooseSingleCert(1);
5218
-
5219
- // 生成签名信息
5220
- this.signedData = src_plugin.p7SignString(this.identifyingId, true, true);
5221
-
5222
- //获取错误码
5223
- var errorCode = Number(src_plugin.getLastError());
5224
- if (errorCode !== 0) {
5225
- if (errorCode === 3758096386 || errorCode === 2148532334) {
5226
- this.$message.error('用户取消操作!');
5403
+ switch (this.caModel) {
5404
+ //吉大正元:
5405
+ case 'JIDA':
5406
+ try {
5407
+ src_plugin.getVersion();
5408
+ } catch (e) {
5409
+ if (this.installPath) {
5410
+ this.$confirm('未安装控件,请进行安装控件!', '控件下载', {
5411
+ confirmButtonText: '确定',
5412
+ cancelButtonText: '取消',
5413
+ type: 'warning'
5414
+ }).then(function () {
5415
+ window.open(_this.installPath);
5416
+ }).catch(function () {});
5417
+ } else {
5418
+ this.$message.error('未安装控件,请进行安装控件!');
5419
+ }
5420
+ this.$emit('error', {
5421
+ type: 1,
5422
+ msg: '未安装控件,请进行安装控件!'
5423
+ });
5227
5424
  return;
5228
- } else if (errorCode === -536870815 || errorCode === 3758096481) {
5229
- this.$message.error('没有找到有效的证书,如果使用的是KEY,请确认已经插入key!');
5425
+ }
5426
+ try {
5427
+ // 清除之前的过滤器
5428
+ src_plugin.clearFilter();
5429
+ // 初始化vctk控件
5430
+ src_plugin.initialize('', this.param);
5431
+ // 控制证书为一个时,不弹出证书选择框
5432
+ src_plugin.setChooseSingleCert(1);
5433
+
5434
+ // 生成签名信息
5435
+ this.signedData = src_plugin.p7SignString(this.identifyingId, true, true);
5436
+
5437
+ //获取错误码
5438
+ var errorCode = Number(src_plugin.getLastError());
5439
+ if (errorCode !== 0) {
5440
+ if (errorCode === 3758096386 || errorCode === 2148532334) {
5441
+ this.$message.error('用户取消操作!');
5442
+ this.$emit('error', { code: 52, msg: '用户取消操作!' });
5443
+ return;
5444
+ } else if (errorCode === -536870815 || errorCode === 3758096481) {
5445
+ this.$message.error('没有找到有效的证书,如果使用的是KEY,请确认已经插入key!');
5446
+ this.$emit('error', {
5447
+ type: 2,
5448
+ msg: '没有找到有效的证书,如果使用的是KEY,请确认已经插入key!'
5449
+ });
5450
+ return;
5451
+ } else {
5452
+ var msg = src_plugin.getLastErrorMessage();
5453
+ this.$message.error(msg);
5454
+ this.$emit('error', { code: 3, msg: msg });
5455
+ return;
5456
+ }
5457
+ }
5458
+ this.success && this.success(this.signedData);
5459
+ return this.signedData;
5460
+ } catch (error) {
5461
+ // 捕获其他可能的异常
5462
+ this.$message.error('\u64CD\u4F5C\u5931\u8D25: ' + error.message);
5463
+ this.$emit('error', { code: 4, msg: error.message });
5464
+ }
5465
+ break;
5466
+ //曙光:
5467
+ case 'SHU_GUANG':
5468
+ src_plugin.getMessage({ action: 'SOF_GetUserList' }).then(function (res) {
5469
+ var retCode = res.retCode,
5470
+ retMsg = res.retMsg,
5471
+ retValue = res.retValue;
5472
+
5473
+ if (!retValue || retCode !== 0) {
5474
+ _this.$message.error(retCode !== 0 ? retMsg : '未找到证书,请插入证书UKEY!');
5475
+ _this.$emit('error', {
5476
+ type: 2,
5477
+ msg: retCode !== 0 ? retMsg : '未找到证书,请插入证书UKEY!'
5478
+ });
5479
+ return;
5480
+ }
5481
+ var userList = retValue.split('&&&');
5482
+ if (userList.length === 1) {
5483
+ //如果只有一个证书,直接获取证书信息
5484
+ _this.certId = userList[0].split('||')[1];
5485
+ _this.getCertInfo(_this.certId);
5486
+ } else {
5487
+ // 如果有多个证书,弹出选择框
5488
+ _this.userList = userList.map(function (item) {
5489
+ var _item$split = item.split('||'),
5490
+ name = _item$split[0],
5491
+ certId = _item$split[1];
5492
+
5493
+ return { label: name, value: certId };
5494
+ });
5495
+ _this.$prompt('', '证书选择', {
5496
+ confirmButtonText: '确定',
5497
+ cancelButtonText: '取消',
5498
+ inputPattern: /^.+$/,
5499
+ inputErrorMessage: '请选择证书!',
5500
+ selectData: _this.userList
5501
+ }).then(function (res) {
5502
+ _this.certId = res.value;
5503
+ _this.getCertInfo(_this.certId);
5504
+ }).catch(function () {
5505
+ _this.$emit('error', { code: 52, msg: '用户取消操作!' });
5506
+ });
5507
+ }
5508
+ }).catch(function (err) {
5509
+ if (_this.installPath) {
5510
+ _this.$confirm('请检查是否安装并启用证书助手控件!', '控件下载', {
5511
+ confirmButtonText: '确定',
5512
+ cancelButtonText: '取消',
5513
+ type: 'warning'
5514
+ }).then(function () {
5515
+ window.open(_this.installPath);
5516
+ }).catch(function () {});
5517
+ } else {
5518
+ _this.$message.error('请检查是否安装并启用证书助手控件!');
5519
+ }
5520
+ _this.$emit('error', {
5521
+ type: 1,
5522
+ msg: '请检查是否安装并启用证书助手控件!'
5523
+ });
5524
+ });
5525
+ break;
5526
+ //四川:
5527
+ case 'SICHUAN':
5528
+ this.$message.warning('四川CA登录方式对接中!');
5529
+ this.$emit('error');
5530
+ break;
5531
+ }
5532
+ },
5533
+ getCertInfo: function getCertInfo(name) {
5534
+ var _this2 = this;
5535
+
5536
+ src_plugin.getMessage({ action: 'SOF_ExportUserCert', params: [name] }).then(function (res) {
5537
+ var retCode = res.retCode,
5538
+ retMsg = res.retMsg,
5539
+ retValue = res.retValue;
5540
+
5541
+ if (retCode !== 0) {
5542
+ _this2.$message.error(retMsg);
5543
+ _this2.$emit('error', { code: retCode, msg: retMsg });
5544
+ return;
5545
+ }
5546
+ //设置证书原文
5547
+ _this2.signedData = retValue.replace('-----BEGIN CERTIFICATE-----', '').replace('-----END CERTIFICATE-----', '');
5548
+ src_plugin.getMessage({
5549
+ action: 'SOF_GetCertInfo',
5550
+ params: [retValue, 'SGD_CERT_SUBJECT_SN']
5551
+ }).then(function (res) {
5552
+ var retCode = res.retCode,
5553
+ retMsg = res.retMsg,
5554
+ retValue = res.retValue;
5555
+
5556
+ if (retCode !== 0) {
5557
+ _this2.$message.error(retMsg);
5558
+ _this2.$emit('error', { code: retCode, msg: retMsg });
5230
5559
  return;
5231
- } else {
5232
- this.$message.error(src_plugin.getLastErrorMessage());
5560
+ }
5561
+ _this2.idCard = src_plugin.base64Decode(retValue);
5562
+ src_plugin.getMessage({
5563
+ action: 'SOF_GenRandom',
5564
+ params: [16]
5565
+ }).then(function (res) {
5566
+ var retCode = res.retCode,
5567
+ retMsg = res.retMsg,
5568
+ retValue = res.retValue;
5569
+
5570
+ if (retCode !== 0) {
5571
+ _this2.$message.error(retMsg);
5572
+ _this2.$emit('error', { code: retCode, msg: retMsg });
5573
+ return;
5574
+ }
5575
+ _this2.b64originData = retValue + _this2.identifyingId;
5576
+ src_plugin.getMessage({
5577
+ action: 'SOF_SignData',
5578
+ params: [_this2.certId, src_plugin.base64Encode(_this2.b64originData)]
5579
+ }).then(function (res) {
5580
+ var retCode = res.retCode,
5581
+ retMsg = res.retMsg,
5582
+ retValue = res.retValue;
5583
+
5584
+ if (retCode !== 0) {
5585
+ if (retCode === 184550659) {
5586
+ _this2.cerLogin();
5587
+ } else {
5588
+ _this2.$message.error(retMsg);
5589
+ _this2.$emit('error', { code: retCode, msg: retMsg });
5590
+ }
5591
+ return;
5592
+ }
5593
+ _this2.b64SignData = retValue;
5594
+ _this2.success && _this2.success({
5595
+ identifyingId: _this2.identifyingId,
5596
+ signedData: _this2.signedData, //证书原文
5597
+ b64originData: _this2.b64originData, //签名原文
5598
+ b64SignData: _this2.b64SignData, //签名结果
5599
+ idCard: _this2.idCard,
5600
+ certId: _this2.certId
5601
+ });
5602
+ }).catch(function (err) {
5603
+ _this2.$emit('error', { code: 5, msg: err });
5604
+ });
5605
+ }).catch(function (err) {
5606
+ _this2.$emit('error', { code: 6, msg: err });
5607
+ });
5608
+ }).catch(function (err) {
5609
+ _this2.$emit('error', { code: 7, msg: err });
5610
+ });
5611
+ }).catch(function (err) {
5612
+ _this2.$emit('error', { code: 8, msg: err });
5613
+ });
5614
+ },
5615
+ cerLogin: function cerLogin() {
5616
+ var _this3 = this;
5617
+
5618
+ var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '提示';
5619
+
5620
+ this.$prompt('输入密码', title, {
5621
+ confirmButtonText: '确定',
5622
+ cancelButtonText: '取消',
5623
+ inputPattern: /^[[\x21-\x7E]{6,16}$/,
5624
+ inputErrorMessage: '请输入密码'
5625
+ }).then(function (_ref) {
5626
+ var value = _ref.value;
5627
+
5628
+ src_plugin.getMessage({
5629
+ action: 'SOF_Login',
5630
+ params: [_this3.certId, value]
5631
+ }).then(function (res) {
5632
+ var retCode = res.retCode,
5633
+ retMsg = res.retMsg,
5634
+ retValue = res.retValue;
5635
+
5636
+ if (retCode !== 0 || retValue === false) {
5637
+ if (retValue === false) {
5638
+ src_plugin.getMessage({
5639
+ action: 'SOF_GetPinRetryCount',
5640
+ params: [_this3.certId]
5641
+ }).then(function (res) {
5642
+ var retValue = res.retValue;
5643
+
5644
+ _this3.cerLogin('\u767B\u5F55\u5931\u8D25\uFF01\u5269\u4F59\u53E3\u4EE4\u91CD\u8BD5\u6B21\u6570\uFF1A' + retValue + '\u6B21');
5645
+ });
5646
+ return;
5647
+ }
5648
+ _this3.$message.error(retMsg);
5649
+ _this3.$emit('error', { code: retCode, msg: retMsg });
5233
5650
  return;
5234
5651
  }
5235
- }
5236
- console.log('签名数据:', this.signedData);
5237
- this.success && this.success(this.signedData);
5238
- return this.signedData;
5239
- } catch (error) {
5240
- // 捕获其他可能的异常
5241
- this.$message.error('\u64CD\u4F5C\u5931\u8D25: ' + error.message);
5242
- }
5652
+ src_plugin.getMessage({
5653
+ action: 'SOF_SignData',
5654
+ params: [_this3.certId, src_plugin.base64Encode(_this3.b64originData)]
5655
+ }).then(function (res) {
5656
+ var retCode = res.retCode,
5657
+ retMsg = res.retMsg,
5658
+ retValue = res.retValue;
5659
+
5660
+ if (retCode !== 0) {
5661
+ if (retCode === 184550659) {
5662
+ _this3.cerLogin();
5663
+ } else {
5664
+ _this3.$message.error(retMsg);
5665
+ _this3.$emit('error', { code: retCode, msg: retMsg });
5666
+ }
5667
+ return;
5668
+ }
5669
+ _this3.b64SignData = retValue;
5670
+ _this3.success && _this3.success({
5671
+ identifyingId: _this3.identifyingId,
5672
+ signedData: _this3.signedData, //证书原文
5673
+ b64originData: _this3.b64originData, //签名原文
5674
+ b64SignData: _this3.b64SignData, //签名结果
5675
+ idCard: _this3.idCard,
5676
+ certId: _this3.certId
5677
+ });
5678
+ }).catch(function (err) {
5679
+ _this3.$emit('error', { code: 9, msg: err });
5680
+ });
5681
+ }).catch(function () {
5682
+ _this3.$emit('error', { code: 10, msg: err });
5683
+ });
5684
+ }).catch(function () {
5685
+ _this3.$emit('error', { code: 11, msg: err });
5686
+ });
5243
5687
  }
5244
5688
  }
5245
5689
  });
@@ -5262,7 +5706,7 @@ var component = Object(componentNormalizer["a" /* default */])(
5262
5706
  staticRenderFns,
5263
5707
  false,
5264
5708
  null,
5265
- "e879a944",
5709
+ "4b7c35fc",
5266
5710
  null
5267
5711
 
5268
5712
  )