eoss-ui 0.6.67 → 0.6.68

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