icve-sso-vue3 0.0.14 → 0.0.15

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.
@@ -34610,7 +34610,7 @@ const agreement_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(agreemen
34610
34610
 
34611
34611
  //获取验证类型
34612
34612
  function getCaptcha() {
34613
- return utils_request({
34613
+ return request({
34614
34614
  url: '/v2/user/getCaptcha',
34615
34615
  method: 'post'
34616
34616
  });
@@ -34767,8 +34767,8 @@ function login_saveUserInfo(data) {
34767
34767
  });
34768
34768
  }
34769
34769
  //获取CaptchaAppid加密
34770
- function login_getCaptchaAppid() {
34771
- return utils_request({
34770
+ function getCaptchaAppid() {
34771
+ return request({
34772
34772
  url: '/captcha/encrypt',
34773
34773
  method: 'post'
34774
34774
  });
@@ -35118,309 +35118,21 @@ function unBindMobile(data) {
35118
35118
  data: data
35119
35119
  });
35120
35120
  }
35121
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/verifyComponents.vue?vue&type=template&id=7d804fae
35121
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/verifyComponents.vue?vue&type=template&id=28be0eea
35122
35122
 
35123
- var verifyComponentsvue_type_template_id_7d804fae_hoisted_1 = {
35123
+ var verifyComponentsvue_type_template_id_28be0eea_hoisted_1 = {
35124
35124
  "class": "verify"
35125
35125
  };
35126
- var verifyComponentsvue_type_template_id_7d804fae_hoisted_2 = {
35127
- key: 1,
35128
- "class": "aly"
35129
- };
35130
- var verifyComponentsvue_type_template_id_7d804fae_hoisted_3 = {
35131
- id: "clickButton",
35132
- ref: "clickButton"
35133
- };
35134
- function verifyComponentsvue_type_template_id_7d804fae_render(_ctx, _cache, $props, $setup, $data, $options) {
35135
- var _component_TJCaptcha = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("TJCaptcha");
35136
- var _component_AliyunCaptchaModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("AliyunCaptchaModal");
35137
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", verifyComponentsvue_type_template_id_7d804fae_hoisted_1, [$data.type == 1 ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_TJCaptcha, {
35138
- key: 0,
35139
- ref: "TJCaptcha",
35140
- CaptchaAppId: $data.CaptchaAppId,
35141
- onSuccess: $options.success
35142
- }, null, 8, ["CaptchaAppId", "onSuccess"])) : ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", verifyComponentsvue_type_template_id_7d804fae_hoisted_2, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createVNode)(_component_AliyunCaptchaModal, {
35143
- id: "clickButton",
35144
- ref: "aliyunCaptcha",
35145
- sceneId: $data.sceneId,
35146
- onSuccess: $options.success
35147
- }, null, 8, ["sceneId", "onSuccess"]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", verifyComponentsvue_type_template_id_7d804fae_hoisted_3, null, 512)]))]);
35148
- }
35149
- ;// ./src/components/verifyComponents.vue?vue&type=template&id=7d804fae
35150
-
35151
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/TJCaptcha.vue?vue&type=template&id=9e7b3c90
35152
-
35153
- var TJCaptchavue_type_template_id_9e7b3c90_hoisted_1 = {
35154
- "class": "TJCaptcha"
35155
- };
35156
- function TJCaptchavue_type_template_id_9e7b3c90_render(_ctx, _cache, $props, $setup, $data, $options) {
35157
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", TJCaptchavue_type_template_id_9e7b3c90_hoisted_1);
35158
- }
35159
- ;// ./src/components/TJCaptcha.vue?vue&type=template&id=9e7b3c90
35160
-
35161
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/TJCaptcha.vue?vue&type=script&lang=js
35162
-
35163
-
35164
-
35165
-
35166
-
35167
-
35168
- /* harmony default export */ const TJCaptchavue_type_script_lang_js = ({
35169
- name: "TJCaptcha",
35170
- props: {
35171
- CaptchaAppId: {
35172
- type: String,
35173
- "default": ""
35174
- }
35175
- },
35176
- data: function data() {
35177
- return {
35178
- captcha: null,
35179
- scriptLoaded: false
35180
- };
35181
- },
35182
- mounted: function mounted() {
35183
- // 动态加载腾讯验证码脚本
35184
- this.loadTencentCaptchaScript();
35185
- },
35186
- methods: {
35187
- // 动态加载腾讯验证码脚本
35188
- loadTencentCaptchaScript: function loadTencentCaptchaScript() {
35189
- var _this = this;
35190
- if (this.scriptLoaded || typeof window.TencentCaptcha !== 'undefined') {
35191
- this.scriptLoaded = true;
35192
- return;
35193
- }
35194
- var script = document.createElement('script');
35195
- script.src = 'https://turing.captcha.qcloud.com/TJCaptcha.js';
35196
- script.onload = function () {
35197
- _this.scriptLoaded = true;
35198
- };
35199
- script.onerror = function () {
35200
- console.error('腾讯验证码脚本加载失败');
35201
- };
35202
- document.head.appendChild(script);
35203
- },
35204
- // 获取验证码加密
35205
- getCaptchaAppid: function getCaptchaAppid() {
35206
- var _this2 = this;
35207
- if (typeof window.TencentCaptcha === 'undefined') {
35208
- console.warn('腾讯验证码库未加载,使用容错处理');
35209
- this.loadErrorCallback();
35210
- return;
35211
- }
35212
- login_getCaptchaAppid().then(function (res) {
35213
- _this2.init(res.data.data);
35214
- })["catch"](function (error) {
35215
- console.error('获取验证码AppId失败:', error);
35216
- _this2.loadErrorCallback();
35217
- });
35218
- },
35219
- init: function init(aidEncrypted) {
35220
- try {
35221
- // 检查环境是否支持腾讯验证码
35222
- if (typeof window.TencentCaptcha === 'undefined') {
35223
- console.warn('腾讯验证码库未加载,使用容错处理');
35224
- this.loadErrorCallback();
35225
- return;
35226
- }
35227
-
35228
- // 生成一个验证码对象
35229
- // CaptchaAppId:登录验证码控制台,从【验证管理】页面进行查看。如果未创建过验证,请先新建验证。注意:不可使用客户端类型为小程序的CaptchaAppId,会导致数据统计错误。
35230
- // callback:定义的回调函数
35231
- this.captcha = new window.TencentCaptcha(this.CaptchaAppId, this.callback, {
35232
- aidEncrypted: aidEncrypted
35233
- });
35234
- // 调用方法,显示验证码
35235
- this.captcha.show();
35236
- } catch (error) {
35237
- console.error("验证码初始化失败:", error);
35238
- // 加载异常,调用验证码js加载错误处理函数
35239
- this.loadErrorCallback();
35240
- }
35241
- },
35242
- loadErrorCallback: function loadErrorCallback() {
35243
- var appid = this.CaptchaAppId;
35244
- // 生成容灾票据或自行做其它处理
35245
- var ticket = "trerror_1001_" + appid + "_" + Math.floor(new Date().getTime() / 1000);
35246
- this.callback({
35247
- ret: 0,
35248
- randstr: "@" + Math.random().toString(36).substr(2),
35249
- ticket: ticket,
35250
- errorCode: 1001,
35251
- errorMessage: "jsload_error"
35252
- });
35253
- },
35254
- callback: function callback(res) {
35255
- // randstr
35256
- if (res.ret == 0) {
35257
- this.$emit("success", {
35258
- ticket: res.ticket,
35259
- randstr: res.randstr
35260
- });
35261
- }
35262
- }
35263
- }
35264
- });
35265
- ;// ./src/components/TJCaptcha.vue?vue&type=script&lang=js
35266
-
35267
- ;// ./src/components/TJCaptcha.vue
35268
-
35269
-
35270
-
35271
-
35272
- ;
35273
- const TJCaptcha_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(TJCaptchavue_type_script_lang_js, [['render',TJCaptchavue_type_template_id_9e7b3c90_render]])
35274
-
35275
- /* harmony default export */ const TJCaptcha = (TJCaptcha_exports_);
35276
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/AliyunCaptchaModal.vue?vue&type=template&id=1572512c
35277
-
35278
- var AliyunCaptchaModalvue_type_template_id_1572512c_hoisted_1 = ["id"];
35279
- function AliyunCaptchaModalvue_type_template_id_1572512c_render(_ctx, _cache, $props, $setup, $data, $options) {
35280
- return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", null, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
35281
- id: "captcha-element-".concat($data.uniqueId)
35282
- }, null, 8, AliyunCaptchaModalvue_type_template_id_1572512c_hoisted_1)]);
35126
+ function verifyComponentsvue_type_template_id_28be0eea_render(_ctx, _cache, $props, $setup, $data, $options) {
35127
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)("div", verifyComponentsvue_type_template_id_28be0eea_hoisted_1);
35283
35128
  }
35284
- ;// ./src/components/AliyunCaptchaModal.vue?vue&type=template&id=1572512c
35285
-
35286
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/AliyunCaptchaModal.vue?vue&type=script&lang=js
35287
-
35288
-
35289
-
35290
-
35291
-
35292
- /* harmony default export */ const AliyunCaptchaModalvue_type_script_lang_js = ({
35293
- props: {
35294
- id: {
35295
- type: String,
35296
- required: true
35297
- },
35298
- sceneId: {
35299
- type: String,
35300
- required: true
35301
- }
35302
- },
35303
- data: function data() {
35304
- return {
35305
- captcha: null,
35306
- uniqueId: '',
35307
- // Vue 3 兼容的唯一ID
35308
- scriptLoaded: false
35309
- };
35310
- },
35311
- mounted: function mounted() {
35312
- this.uniqueId = 'captcha-' + Math.random().toString(36).substr(2, 9);
35313
- try {
35314
- if (typeof window.initAliyunCaptcha === 'undefined') {
35315
- console.warn('阿里云验证码库未加载,尝试动态加载');
35316
- this.loadAliyunCaptchaScript();
35317
- return;
35318
- }
35319
- this.initAliyunCaptcha();
35320
- } catch (error) {
35321
- console.error('阿里云验证码初始化失败:', error);
35322
- }
35323
- },
35324
- methods: {
35325
- // 动态加载阿里云验证码脚本
35326
- loadAliyunCaptchaScript: function loadAliyunCaptchaScript() {
35327
- var _this = this;
35328
- if (this.scriptLoaded) return;
35329
-
35330
- // 先加载配置
35331
- if (!window.AliyunCaptchaConfig) {
35332
- window.AliyunCaptchaConfig = {
35333
- region: 'cn',
35334
- prefix: '106eu7'
35335
- };
35336
- }
35337
- var script = document.createElement('script');
35338
- script.src = 'https://o.alicdn.com/captcha-frontend/aliyunCaptcha/AliyunCaptcha.js';
35339
- script.onload = function () {
35340
- _this.scriptLoaded = true;
35341
- _this.initAliyunCaptcha();
35342
- };
35343
- script.onerror = function () {
35344
- console.error('阿里云验证码脚本加载失败');
35345
- };
35346
- document.head.appendChild(script);
35347
- },
35348
- initAliyunCaptcha: function initAliyunCaptcha() {
35349
- var _this2 = this;
35350
- try {
35351
- if (typeof window.initAliyunCaptcha === 'undefined') {
35352
- console.warn('阿里云验证码库未加载,跳过初始化');
35353
- return;
35354
- }
35355
- window.initAliyunCaptcha({
35356
- SceneId: this.sceneId,
35357
- // 场景ID。根据步骤二新建验证场景后,您可以在验证码场景列表,获取该场景的场景ID
35358
- mode: "popup",
35359
- // 验证码模式。popup表示要集成的验证码模式为弹出式。无需修改
35360
- element: "#captcha-element-".concat(this.uniqueId),
35361
- // 页面上预留的渲染验证码的元素,与原代码中预留的页面元素保持一致。
35362
- button: "#".concat(this.id),
35363
- captchaLogoImg: "https://file.icve.com.cn/app/site/prod/zyzyzx_components/zhzj_logo.webp",
35364
- // 验证码验证通过回调函数
35365
- success: function success(captchaVerifyParam) {
35366
- try {
35367
- // 入参为验签captchaVerifyParam
35368
- // 1.根据校验结果来进行业务处理
35369
- _this2.$emit("success", captchaVerifyParam);
35370
- _this2.initAliyunCaptcha();
35371
- } catch (error) {
35372
- console.error('验证码成功回调处理失败:', error);
35373
- }
35374
- },
35375
- // 验证码验证不通过回调函数
35376
- fail: function fail(result) {
35377
- // 入参为不通过信息
35378
- // 正常验证有效期内不需要做任何操作,验证码自动刷新,重新进行验证
35379
- console.error(result);
35380
- },
35381
- // 绑定验证码实例回调函数,该回调会在验证码初始化成功后调用
35382
- getInstance: function getInstance(instance) {
35383
- try {
35384
- _this2.$emit("getInstance", instance);
35385
- _this2.captcha = instance;
35386
- } catch (error) {
35387
- console.error('验证码实例绑定失败:', error);
35388
- }
35389
- },
35390
- slideStyle: {
35391
- width: 360,
35392
- height: 40
35393
- },
35394
- // 滑块验证码样式,支持自定义宽度和高度,单位为px。其中,width最小值为320 px
35395
- language: typeof localStorage !== 'undefined' ? localStorage.getItem("language") || "cn" : "cn" // 验证码语言类型,支持简体中文(cn)、繁体中文(tw)、英文(en)
35396
- });
35397
- } catch (error) {
35398
- console.error('阿里云验证码初始化失败:', error);
35399
- }
35400
- }
35401
- }
35402
- });
35403
- ;// ./src/components/AliyunCaptchaModal.vue?vue&type=script&lang=js
35404
-
35405
- ;// ./src/components/AliyunCaptchaModal.vue
35406
-
35407
-
35129
+ ;// ./src/components/verifyComponents.vue?vue&type=template&id=28be0eea
35408
35130
 
35409
-
35410
- ;
35411
- const AliyunCaptchaModal_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(AliyunCaptchaModalvue_type_script_lang_js, [['render',AliyunCaptchaModalvue_type_template_id_1572512c_render]])
35412
-
35413
- /* harmony default export */ const AliyunCaptchaModal = (AliyunCaptchaModal_exports_);
35414
35131
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/verifyComponents.vue?vue&type=script&lang=js
35415
35132
 
35416
-
35417
-
35418
35133
  /* harmony default export */ const verifyComponentsvue_type_script_lang_js = ({
35419
35134
  name: 'VerifySlide',
35420
- components: {
35421
- TJCaptcha: TJCaptcha,
35422
- AliyunCaptchaModal: AliyunCaptchaModal
35423
- },
35135
+ components: {},
35424
35136
  data: function data() {
35425
35137
  return {
35426
35138
  CaptchaAppId: '196632980',
@@ -35428,65 +35140,6 @@ const AliyunCaptchaModal_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)
35428
35140
  type: 'alibaba' // tencent 腾讯 alibaba阿里 none无需验证
35429
35141
  };
35430
35142
  },
35431
- methods: {
35432
- //获取验证码类型
35433
- getType: function getType() {
35434
- var _this = this;
35435
- getCaptcha().then(function (res) {
35436
- _this.type = res.data.data;
35437
- })["catch"](function (error) {
35438
- console.warn('获取验证码类型失败,使用默认类型:', error);
35439
- _this.type = 'alibaba'; // 默认使用阿里云验证码
35440
- });
35441
- },
35442
- // 验证成功
35443
- success: function success(captchaVerifyParam) {
35444
- try {
35445
- if (this.type === 'tencent') {
35446
- this.$emit('success', captchaVerifyParam);
35447
- } else {
35448
- var VerifyParam = captchaVerifyParam ? {
35449
- captchaVerifyParam: captchaVerifyParam,
35450
- sceneId: this.sceneId
35451
- } : {
35452
- specialKey: true
35453
- };
35454
- this.$emit('success', VerifyParam);
35455
- }
35456
- } catch (error) {
35457
- console.error('验证码处理失败:', error);
35458
- // 发送默认成功参数
35459
- this.$emit('success', {
35460
- specialKey: true
35461
- });
35462
- }
35463
- },
35464
- show: function show() {
35465
- try {
35466
- if (this.type === 'tencent') {
35467
- this.$refs.TJCaptcha.getCaptchaAppid();
35468
- } else if (this.type === 'alibaba') {
35469
- if (typeof window.AliyunCaptcha !== 'undefined' && this.$refs.aliyunCaptcha.captcha) {
35470
- this.$refs.aliyunCaptcha.captcha.show();
35471
- } else {
35472
- console.warn('阿里云验证码未加载,使用容错处理');
35473
- var VerifyParam = {
35474
- specialKey: true
35475
- };
35476
- this.$emit('success', VerifyParam);
35477
- }
35478
- } else {
35479
- this.$emit('success');
35480
- }
35481
- } catch (error) {
35482
- console.error('显示验证码失败:', error);
35483
- // 容错处理:直接发送成功信号
35484
- this.$emit('success', {
35485
- specialKey: true
35486
- });
35487
- }
35488
- }
35489
- },
35490
35143
  created: function created() {
35491
35144
  this.getType();
35492
35145
  }
@@ -35499,7 +35152,7 @@ const AliyunCaptchaModal_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)
35499
35152
 
35500
35153
 
35501
35154
  ;
35502
- const verifyComponents_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(verifyComponentsvue_type_script_lang_js, [['render',verifyComponentsvue_type_template_id_7d804fae_render]])
35155
+ const verifyComponents_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(verifyComponentsvue_type_script_lang_js, [['render',verifyComponentsvue_type_template_id_28be0eea_render]])
35503
35156
 
35504
35157
  /* harmony default export */ const verifyComponents = (verifyComponents_exports_);
35505
35158
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/QRCodeLogin.vue?vue&type=template&id=6badd114&scoped=true