vue-layout-gitcode 1.10.9 → 1.10.10

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.
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
1
  import { defineComponent, computed, createBlock, createElementBlock, openBlock, unref, normalizeProps, mergeProps, normalizeClass, renderSlot, normalizeStyle, createElementVNode, reactive, readonly, inject, effectScope, ref, shallowRef, watch, isRef, getCurrentInstance, h, Fragment, onBeforeMount, onMounted, onUnmounted, createVNode, Text, provide, createCommentVNode, withCtx, toDisplayString as toDisplayString$1, renderList, createTextVNode, Transition, withModifiers, resolveComponent, watchEffect, guardReactiveProps, onBeforeUnmount, resolveDynamicComponent, nextTick, defineAsyncComponent, withDirectives, vShow, withKeys, useCssVars, createSlots, render, toRaw, mergeModels, useModel as useModel$1, watchPostEffect, useSlots } from "vue";
5
2
  import { Button } from "vue-devui-lal/button";
6
3
  import { Popover } from "vue-devui-lal/popover";
@@ -7709,6 +7706,7 @@ const gitCodeLayout$1 = {
7709
7706
  preContent: "亲爱的 {siteName} 开发者:平台正在进行系统化融合与升级,预计将于10月28日12:00完成。之后,您将体验更强大、更稳定的平台。",
7710
7707
  content: "亲爱的开发者:GitCode 与 AtomGit 已完成深度融合升级,您将体验更稳定、更精彩的开源社区服务!",
7711
7708
  viewDetail: "【查看详情】",
7709
+ viewDetail_mobile: "查看详情",
7712
7710
  closePermanently: "不再提醒",
7713
7711
  close: "关闭"
7714
7712
  },
@@ -8055,6 +8053,7 @@ const gitCodeLayout = {
8055
8053
  preContent: "Dear {siteName} developer, the platform is undergoing integration, expected to be completed on October 28, 12:00. You will experience a more powerful platform.",
8056
8054
  content: "GitCode and AtomGit are now fully integrated. Enjoy a more stable and vibrant open source community!",
8057
8055
  viewDetail: "[View detail]",
8056
+ viewDetail_mobile: "View detail",
8058
8057
  closePermanently: "Don't remind again",
8059
8058
  close: "Close"
8060
8059
  },
@@ -13775,15 +13774,14 @@ function headRequest(request) {
13775
13774
  },
13776
13775
  /** 获取gitcode手机号验证码 */
13777
13776
  verifyRegisterCode(data) {
13778
- const { mobile, type, raw_data, captchaId, token, authenticate, validate } = data;
13777
+ const { mobile, type, raw_data, captchaId, token, authenticate } = data;
13779
13778
  const requestData = filterApiParams({
13780
13779
  biz_enum: type,
13781
13780
  mobile,
13782
13781
  raw_data: raw_data || "",
13783
13782
  captcha_id: captchaId,
13784
13783
  token,
13785
- authenticate,
13786
- validate
13784
+ authenticate
13787
13785
  });
13788
13786
  return reqCatch(
13789
13787
  () => request({
@@ -13795,14 +13793,13 @@ function headRequest(request) {
13795
13793
  },
13796
13794
  /** 快捷注册短信验证 */
13797
13795
  getQuickLoginMsg(data) {
13798
- const { mobile, biz_enum, captchaId, token, authenticate, validate } = data;
13796
+ const { mobile, biz_enum, captchaId, token, authenticate } = data;
13799
13797
  const requestData = filterApiParams({
13800
13798
  mobile,
13801
13799
  biz_enum: biz_enum || "LOGIN",
13802
13800
  captcha_id: captchaId,
13803
13801
  token,
13804
- authenticate,
13805
- validate
13802
+ authenticate
13806
13803
  });
13807
13804
  return reqCatch(
13808
13805
  () => request({
@@ -13813,10 +13810,10 @@ function headRequest(request) {
13813
13810
  );
13814
13811
  },
13815
13812
  /** 重置密码 - 获取手机或者邮箱验证码 */
13816
- getMobileEmailCode({ mobile_email = "", captcha_id = "", token = "", authenticate = "", validate = "" }) {
13813
+ getMobileEmailCode({ mobile_email = "", captcha_id = "", token = "", authenticate = "" }) {
13817
13814
  return reqCatch(
13818
13815
  () => request({
13819
- url: `/api/v1/user/forgetCode?mobile_email=${mobile_email}&captcha_id=${captcha_id}&token=${token}&authenticate=${authenticate}&validate=${validate}`
13816
+ url: `/api/v1/user/forgetCode?mobile_email=${mobile_email}&captcha_id=${captcha_id}&token=${token}&authenticate=${authenticate}`
13820
13817
  })
13821
13818
  );
13822
13819
  },
@@ -13906,8 +13903,7 @@ function headRequest(request) {
13906
13903
  password: cryptoCode.toString(),
13907
13904
  captcha_id: data == null ? void 0 : data.captchaId,
13908
13905
  token: data == null ? void 0 : data.token,
13909
- authenticate: data == null ? void 0 : data.authenticate,
13910
- validate: data == null ? void 0 : data.validate
13906
+ authenticate: data == null ? void 0 : data.authenticate
13911
13907
  });
13912
13908
  return reqCatch(
13913
13909
  () => request({
@@ -14008,15 +14004,6 @@ function headRequest(request) {
14008
14004
  })
14009
14005
  );
14010
14006
  },
14011
- /** 获取配置的图片验证码类型 */
14012
- getCaptchaType() {
14013
- return reqCatch(
14014
- () => request({
14015
- url: `/uc/api/v1/captcha/config`,
14016
- method: "get"
14017
- })
14018
- );
14019
- },
14020
14007
  // mfa 恢复码登陆
14021
14008
  postMfaRecover(data) {
14022
14009
  return reqCatchV2(
@@ -14930,13 +14917,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14930
14917
  var _a;
14931
14918
  const layoutConfig2 = useLayoutConfig();
14932
14919
  const { t: $t } = i18n.global;
14933
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-BaW9j7jM.js"));
14934
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-B9f_e7lG.js"));
14935
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-ExbtF8-g.js"));
14936
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-BHpQc4do.js"));
14937
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-CBc-RbqA.js"));
14938
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-DE_FH3nS.js"));
14939
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-CuExGAND.js"));
14920
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-CMugJqjv.js"));
14921
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-Cwly5mnk.js"));
14922
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-DUL5Nl5N.js"));
14923
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-CJTLkNg0.js"));
14924
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-oo4vAXER.js"));
14925
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-I3wSahrr.js"));
14926
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-CRgflbzl.js"));
14940
14927
  const props = __props;
14941
14928
  const repoInfo = inject("repoInfo");
14942
14929
  const orgInfo = inject("orgInfo");
@@ -15653,7 +15640,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
15653
15640
  createElementVNode("a", {
15654
15641
  class: "announce-detail",
15655
15642
  href: migrationAnnounceUrl.value
15656
- }, toDisplayString$1(unref(t2)("gitCodeLayout.home.migrationAnnounce.viewDetail")), 9, _hoisted_3$f),
15643
+ }, toDisplayString$1(unref(t2)("gitCodeLayout.home.migrationAnnounce.viewDetail_mobile")), 9, _hoisted_3$f),
15657
15644
  createElementVNode("span", {
15658
15645
  class: "announce-handle",
15659
15646
  onClick: _cache[0] || (_cache[0] = ($event) => handleClose())
@@ -15709,7 +15696,7 @@ const autoAvokeLogin = ({ isLogin, loginFunc, openHarmonyGuide, loginSuccess, lo
15709
15696
  loginFunc({ type: "login", triggerType: "", loginTriggerSource: "router_login_auth", ...loginFuncOpts }, loginSuccess, openHarmonyGuide);
15710
15697
  }
15711
15698
  };
15712
- const NoticeModal = defineAsyncComponent(() => import("./notice-BM-9d-tw.js"));
15699
+ const NoticeModal = defineAsyncComponent(() => import("./notice-BxIpPFCN.js"));
15713
15700
  function clearNotice() {
15714
15701
  if (localStorage$2.getItem("validator_email")) {
15715
15702
  localStorage$2.removeItem("validator_email");
@@ -16511,9 +16498,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
16511
16498
  const layoutConfig2 = useLayoutConfig();
16512
16499
  const { t: t2 } = i18n.global;
16513
16500
  const route = useRoute();
16514
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-BAw5BtBb.js"));
16515
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-BIFEaq9E.js"));
16516
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-Ce9S11ma.js"));
16501
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-Dd8w-uJG.js"));
16502
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-QUm3X2t0.js"));
16503
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-DBXLtG2G.js"));
16517
16504
  const props = __props;
16518
16505
  console.log("slotKeys", props.slotKeys);
16519
16506
  console.log("props", props);
@@ -18288,10 +18275,6 @@ const layoutConfig = useLayoutConfig();
18288
18275
  const { t: t$2 } = i18n.global;
18289
18276
  const GRAPH_CODE = 400017;
18290
18277
  const YUNPIAN_GRAPH_CODE = 400018;
18291
- const needGraphCode = (errorCode) => {
18292
- if (!errorCode) return false;
18293
- return [GRAPH_CODE, YUNPIAN_GRAPH_CODE].includes(errorCode);
18294
- };
18295
18278
  const REMOTE_LOGIN_CODE = 400015;
18296
18279
  const MAX_MOBILE_COUNT = 10;
18297
18280
  const createLoginConfig = (request) => {
@@ -18321,34 +18304,23 @@ const createLoginConfig = (request) => {
18321
18304
  }
18322
18305
  },
18323
18306
  // 密码登录
18324
- async password({
18325
- param,
18326
- loginParams,
18327
- graphValidate,
18328
- lintRemoteLogin,
18329
- yunpianGraphValidate,
18330
- yiDunGraphValidate
18331
- }) {
18332
- var _a, _b, _c, _d;
18307
+ async password({ param, loginParams, graphValidate, lintRemoteLogin, yunpianGraphValidate }) {
18308
+ var _a, _b, _c;
18333
18309
  const { validFunc, successFunc = () => {
18334
18310
  }, failFunc = () => {
18335
- }, captchaType } = param;
18311
+ } } = param;
18336
18312
  const check = validFunc ? await validFunc() : true;
18337
18313
  if (!check) return;
18338
18314
  const result2 = await API.toLogin(loginParams);
18339
- if (needGraphCode((_a = result2 == null ? void 0 : result2.error) == null ? void 0 : _a.error_code) && (captchaType == null ? void 0 : captchaType.provider) === "SELF") {
18315
+ if (((_a = result2 == null ? void 0 : result2.error) == null ? void 0 : _a.error_code) === GRAPH_CODE) {
18340
18316
  graphValidate();
18341
18317
  return;
18342
18318
  }
18343
- if (needGraphCode((_b = result2 == null ? void 0 : result2.error) == null ? void 0 : _b.error_code) && (captchaType == null ? void 0 : captchaType.provider) === "YUNPIAN") {
18319
+ if (((_b = result2 == null ? void 0 : result2.error) == null ? void 0 : _b.error_code) === YUNPIAN_GRAPH_CODE) {
18344
18320
  yunpianGraphValidate();
18345
18321
  return;
18346
18322
  }
18347
- if (needGraphCode((_c = result2 == null ? void 0 : result2.error) == null ? void 0 : _c.error_code) && (captchaType == null ? void 0 : captchaType.provider) === "YIDUN") {
18348
- yiDunGraphValidate();
18349
- return;
18350
- }
18351
- if (((_d = result2 == null ? void 0 : result2.error) == null ? void 0 : _d.error_code) === REMOTE_LOGIN_CODE) {
18323
+ if (((_c = result2 == null ? void 0 : result2.error) == null ? void 0 : _c.error_code) === REMOTE_LOGIN_CODE) {
18352
18324
  lintRemoteLogin();
18353
18325
  return;
18354
18326
  }
@@ -22471,200 +22443,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
22471
22443
  }
22472
22444
  });
22473
22445
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-vue-layout-gitcode"]]);
22474
- const _SlidCaptchaManager = class _SlidCaptchaManager {
22475
- constructor() {
22476
- __publicField(this, "tacInstance", null);
22477
- __publicField(this, "isScriptLoaded", false);
22478
- }
22479
- static getInstance() {
22480
- if (!_SlidCaptchaManager.instance) {
22481
- _SlidCaptchaManager.instance = new _SlidCaptchaManager();
22482
- }
22483
- return _SlidCaptchaManager.instance;
22484
- }
22485
- /**
22486
- * 等待 TAC 脚本加载
22487
- * 脚本通常在 index.html 中通过 load.min.js 加载
22488
- */
22489
- waitForTACScript(retryCount = 0) {
22490
- return new Promise((resolve, reject) => {
22491
- if (this.isScriptLoaded && window.initTAC) {
22492
- resolve();
22493
- return;
22494
- }
22495
- if (window.initTAC) {
22496
- this.isScriptLoaded = true;
22497
- resolve();
22498
- return;
22499
- }
22500
- const checkInterval = setInterval(() => {
22501
- if (window.initTAC) {
22502
- this.isScriptLoaded = true;
22503
- clearInterval(checkInterval);
22504
- resolve();
22505
- }
22506
- }, 100);
22507
- setTimeout(() => {
22508
- clearInterval(checkInterval);
22509
- if (window.initTAC) {
22510
- this.isScriptLoaded = true;
22511
- resolve();
22512
- } else {
22513
- if (retryCount < 1) {
22514
- console.warn("TAC 脚本未加载,尝试动态加载");
22515
- this.loadScriptElement(retryCount, resolve, reject);
22516
- } else {
22517
- reject(new Error("TAC 脚本加载失败,initTAC 方法不可用"));
22518
- }
22519
- }
22520
- }, 1e4);
22521
- });
22522
- }
22523
- /**
22524
- * 动态加载脚本元素(备用方案)
22525
- */
22526
- loadScriptElement(_retryCount, resolve, reject) {
22527
- const script = document.createElement("script");
22528
- script.type = "text/javascript";
22529
- script.src = "https://cdn-static.gitcode.com/js/tac/load.min.js";
22530
- script.onload = () => {
22531
- setTimeout(() => {
22532
- if (window.initTAC) {
22533
- this.isScriptLoaded = true;
22534
- resolve();
22535
- } else {
22536
- reject(new Error("TAC SDK 初始化失败"));
22537
- }
22538
- }, 500);
22539
- };
22540
- script.onerror = () => {
22541
- reject(new Error("TAC 脚本加载失败"));
22542
- };
22543
- document.head.appendChild(script);
22544
- }
22545
- /**
22546
- * 初始化 TAC 实例
22547
- */
22548
- async initTAC(path, config, style, onload, onerror) {
22549
- if (!config.requestCaptchaDataUrl) {
22550
- throw new Error("TAC 配置缺少必需的 requestCaptchaDataUrl");
22551
- }
22552
- if (!config.validCaptchaUrl) {
22553
- throw new Error("TAC 配置缺少必需的 validCaptchaUrl");
22554
- }
22555
- if (!config.bindEl) {
22556
- throw new Error("TAC 配置缺少必需的 bindEl 元素");
22557
- }
22558
- if (!config.validSuccess) {
22559
- throw new Error("TAC 配置缺少必需的 validSuccess 回调函数");
22560
- }
22561
- if (!window.initTAC) {
22562
- try {
22563
- await this.waitForTACScript();
22564
- } catch (error) {
22565
- console.error("等待 TAC 脚本加载失败:", error);
22566
- if (onerror) {
22567
- onerror(error);
22568
- }
22569
- throw error;
22570
- }
22571
- }
22572
- if (this.tacInstance) {
22573
- this.destroyTAC();
22574
- }
22575
- return new Promise((resolve, reject) => {
22576
- if (!window.initTAC) {
22577
- const error = new Error("initTAC 方法不可用");
22578
- if (onerror) {
22579
- onerror(error);
22580
- }
22581
- reject(error);
22582
- return;
22583
- }
22584
- try {
22585
- window.initTAC(path, config, style || {}).then((tac) => {
22586
- this.tacInstance = tac;
22587
- if (onload) {
22588
- onload(tac);
22589
- }
22590
- resolve();
22591
- }).catch((err) => {
22592
- console.error("创建 TAC 实例失败:", err);
22593
- this.tacInstance = null;
22594
- if (onerror) {
22595
- onerror(err);
22596
- }
22597
- reject(err);
22598
- });
22599
- } catch (error) {
22600
- console.error("创建 TAC 实例失败:", error);
22601
- this.tacInstance = null;
22602
- if (onerror) {
22603
- onerror(error);
22604
- }
22605
- reject(error);
22606
- }
22607
- });
22608
- }
22609
- /**
22610
- * 销毁 TAC 实例
22611
- */
22612
- destroyTAC() {
22613
- if (this.tacInstance) {
22614
- try {
22615
- if (typeof this.tacInstance.destroyWindow === "function") {
22616
- this.tacInstance.destroyWindow();
22617
- }
22618
- this.tacInstance = null;
22619
- } catch (error) {
22620
- console.error("销毁 TAC 实例失败:", error);
22621
- }
22622
- }
22623
- }
22624
- /**
22625
- * 获取当前实例状态
22626
- */
22627
- hasInstance() {
22628
- return !!this.tacInstance;
22629
- }
22630
- /**
22631
- * 获取当前实例
22632
- */
22633
- getInstance() {
22634
- return this.tacInstance;
22635
- }
22636
- /**
22637
- * 初始化验证码(如果实例存在)
22638
- */
22639
- init() {
22640
- if (this.tacInstance && typeof this.tacInstance.init === "function") {
22641
- this.tacInstance.init();
22642
- } else {
22643
- console.warn("TAC 实例不存在或 init 方法不可用");
22644
- }
22645
- }
22646
- /**
22647
- * 重新加载验证码(如果实例存在)
22648
- */
22649
- reloadCaptcha() {
22650
- if (this.tacInstance && typeof this.tacInstance.reloadCaptcha === "function") {
22651
- this.tacInstance.reloadCaptcha();
22652
- } else {
22653
- console.warn("TAC 实例不存在或 reloadCaptcha 方法不可用");
22654
- }
22655
- }
22656
- };
22657
- __publicField(_SlidCaptchaManager, "instance");
22658
- let SlidCaptchaManager = _SlidCaptchaManager;
22659
- const slidCaptchaManager = SlidCaptchaManager.getInstance();
22660
- const SlidCaptcha = defineAsyncComponent(() => import("./index-B6hVcI95.js"));
22446
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-De4SI5w4.js"));
22661
22447
  const useSlidCaptcha = () => {
22662
- const { mount, unMount, isMounted } = usePopup("slid-captcha-popup");
22448
+ const { mount, unMount } = usePopup("slid-captcha-popup");
22663
22449
  const open = (config) => {
22664
- if (isMounted()) {
22665
- unMount();
22666
- slidCaptchaManager.destroyTAC();
22667
- }
22668
22450
  mount(SlidCaptcha, {
22669
22451
  onSuccess: (resData) => {
22670
22452
  var _a;
@@ -22672,22 +22454,15 @@ const useSlidCaptcha = () => {
22672
22454
  (_a = config == null ? void 0 : config.onSuccess) == null ? void 0 : _a.call(config, resData);
22673
22455
  },
22674
22456
  modelValue: true,
22675
- onClose: () => {
22676
- unMount();
22677
- slidCaptchaManager.destroyTAC();
22678
- }
22457
+ onClose: () => unMount()
22679
22458
  });
22680
22459
  };
22681
- const close = () => {
22682
- unMount();
22683
- slidCaptchaManager.destroyTAC();
22684
- };
22685
22460
  return {
22686
22461
  open,
22687
- close
22462
+ close: unMount
22688
22463
  };
22689
22464
  };
22690
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-B-WQyJsC.js"));
22465
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-DPDJvnHe.js"));
22691
22466
  const useYunpianCaptcha = () => {
22692
22467
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
22693
22468
  const open = (config) => {
@@ -22713,370 +22488,6 @@ const useYunpianCaptcha = () => {
22713
22488
  close: unMount
22714
22489
  };
22715
22490
  };
22716
- const _YidunCaptchaManager = class _YidunCaptchaManager {
22717
- constructor() {
22718
- __publicField(this, "neCaptchaInstance", null);
22719
- __publicField(this, "isScriptLoaded", false);
22720
- }
22721
- static getInstance() {
22722
- if (!_YidunCaptchaManager.instance) {
22723
- _YidunCaptchaManager.instance = new _YidunCaptchaManager();
22724
- }
22725
- return _YidunCaptchaManager.instance;
22726
- }
22727
- /**
22728
- * 加载易盾验证码脚本
22729
- */
22730
- loadNECaptchaScript(retryCount = 0) {
22731
- return new Promise((resolve, reject) => {
22732
- if (this.isScriptLoaded && window.initNECaptchaWithFallback) {
22733
- resolve();
22734
- return;
22735
- }
22736
- const existingScript = document.querySelector('script[src*="yidun-captcha.js"]');
22737
- if (existingScript) {
22738
- const checkInterval = setInterval(() => {
22739
- if (window.initNECaptchaWithFallback) {
22740
- this.isScriptLoaded = true;
22741
- clearInterval(checkInterval);
22742
- resolve();
22743
- }
22744
- }, 100);
22745
- setTimeout(() => {
22746
- clearInterval(checkInterval);
22747
- if (window.initNECaptchaWithFallback) {
22748
- this.isScriptLoaded = true;
22749
- resolve();
22750
- } else {
22751
- if (existingScript.parentNode) {
22752
- existingScript.parentNode.removeChild(existingScript);
22753
- }
22754
- this.loadScriptElement(retryCount, resolve, reject);
22755
- }
22756
- }, 5e3);
22757
- return;
22758
- }
22759
- this.loadScriptElement(retryCount, resolve, reject);
22760
- });
22761
- }
22762
- /**
22763
- * 创建并加载脚本元素
22764
- */
22765
- loadScriptElement(retryCount, resolve, reject) {
22766
- const script = document.createElement("script");
22767
- script.type = "text/javascript";
22768
- script.src = "https://cdn-static.gitcode.com/js/yidun/yidun-captcha.js";
22769
- script.onload = () => {
22770
- setTimeout(() => {
22771
- if (window.initNECaptchaWithFallback) {
22772
- this.isScriptLoaded = true;
22773
- resolve();
22774
- } else {
22775
- reject(new Error("易盾验证码 SDK 初始化失败"));
22776
- }
22777
- }, 200);
22778
- };
22779
- script.onerror = () => {
22780
- if (retryCount < 2) {
22781
- console.warn(`易盾验证码脚本加载失败,正在重试 (${retryCount + 1}/2)`);
22782
- setTimeout(() => {
22783
- this.loadNECaptchaScript(retryCount + 1).then(resolve).catch(reject);
22784
- }, 1e3);
22785
- } else {
22786
- reject(new Error("易盾验证码脚本加载失败,已达到最大重试次数"));
22787
- }
22788
- };
22789
- document.head.appendChild(script);
22790
- }
22791
- /**
22792
- * 初始化易盾验证码实例
22793
- */
22794
- async initNECaptcha(config, onload, onerror) {
22795
- if (!config.captchaId) {
22796
- throw new Error("易盾验证码配置缺少必需的 captchaId");
22797
- }
22798
- if (!config.element) {
22799
- throw new Error("易盾验证码配置缺少必需的 element 元素");
22800
- }
22801
- if (!config.onVerify) {
22802
- throw new Error("易盾验证码配置缺少必需的 onVerify 回调函数");
22803
- }
22804
- if (!window.initNECaptchaWithFallback) {
22805
- try {
22806
- await this.loadNECaptchaScript();
22807
- } catch (error) {
22808
- console.error("加载易盾验证码脚本失败:", error);
22809
- if (onerror) {
22810
- onerror(error);
22811
- }
22812
- throw error;
22813
- }
22814
- }
22815
- if (this.neCaptchaInstance) {
22816
- this.destroyNECaptcha();
22817
- }
22818
- return new Promise((resolve, reject) => {
22819
- if (!window.initNECaptchaWithFallback) {
22820
- const error = new Error("initNECaptchaWithFallback 方法不可用");
22821
- if (onerror) {
22822
- onerror(error);
22823
- }
22824
- reject(error);
22825
- return;
22826
- }
22827
- try {
22828
- window.initNECaptchaWithFallback(
22829
- config,
22830
- (instance) => {
22831
- this.neCaptchaInstance = instance;
22832
- if (onload) {
22833
- onload(instance);
22834
- }
22835
- resolve();
22836
- },
22837
- (err) => {
22838
- console.error("易盾验证码初始化失败:", err);
22839
- this.neCaptchaInstance = null;
22840
- if (onerror) {
22841
- onerror(err);
22842
- }
22843
- reject(err);
22844
- }
22845
- );
22846
- } catch (error) {
22847
- console.error("创建易盾验证码实例失败:", error);
22848
- this.neCaptchaInstance = null;
22849
- if (onerror) {
22850
- onerror(error);
22851
- }
22852
- reject(error);
22853
- }
22854
- });
22855
- }
22856
- /**
22857
- * 销毁易盾验证码实例
22858
- */
22859
- destroyNECaptcha() {
22860
- if (this.neCaptchaInstance) {
22861
- try {
22862
- if (typeof this.neCaptchaInstance.destroy === "function") {
22863
- this.neCaptchaInstance.destroy();
22864
- }
22865
- this.neCaptchaInstance = null;
22866
- } catch (error) {
22867
- console.error("销毁易盾验证码实例失败:", error);
22868
- }
22869
- }
22870
- }
22871
- /**
22872
- * 获取当前实例状态
22873
- */
22874
- hasInstance() {
22875
- return !!this.neCaptchaInstance;
22876
- }
22877
- /**
22878
- * 获取当前实例
22879
- */
22880
- getInstance() {
22881
- return this.neCaptchaInstance;
22882
- }
22883
- /**
22884
- * 触发验证码验证
22885
- */
22886
- verify() {
22887
- if (this.neCaptchaInstance && typeof this.neCaptchaInstance.verify === "function") {
22888
- this.neCaptchaInstance.verify();
22889
- } else {
22890
- console.warn("验证码实例不存在或 verify 方法不可用");
22891
- }
22892
- }
22893
- /**
22894
- * 刷新验证码
22895
- */
22896
- refresh() {
22897
- if (this.neCaptchaInstance && typeof this.neCaptchaInstance.refresh === "function") {
22898
- this.neCaptchaInstance.refresh();
22899
- } else {
22900
- console.warn("验证码实例不存在或 refresh 方法不可用");
22901
- }
22902
- }
22903
- /**
22904
- * 重新初始化(用于更新配置)
22905
- */
22906
- async reinitialize(config, onload, onerror) {
22907
- this.destroyNECaptcha();
22908
- await this.initNECaptcha(config, onload, onerror);
22909
- }
22910
- };
22911
- __publicField(_YidunCaptchaManager, "instance");
22912
- let YidunCaptchaManager = _YidunCaptchaManager;
22913
- const yidunCaptchaManager = YidunCaptchaManager.getInstance();
22914
- let globalStyleElement = null;
22915
- let globalStyleRefCount = 0;
22916
- const useYiDunCaptcha = () => {
22917
- const { isMobile } = usePageResize();
22918
- const captchaInstance = ref(null);
22919
- const hiddenElement = ref(null);
22920
- const verifyTimeoutId = ref(null);
22921
- const injectStyle = () => {
22922
- if (globalStyleElement) {
22923
- globalStyleRefCount++;
22924
- return;
22925
- }
22926
- const style = document.createElement("style");
22927
- style.id = "yidun-captcha-trigger-style";
22928
- style.textContent = `
22929
- #yidun-captcha-trigger .yidun_tips__img {
22930
- max-width: unset;
22931
- }
22932
- #yidun-captcha-trigger .yidun_modal {
22933
- top: 36% !important;
22934
- }
22935
- `;
22936
- document.head.appendChild(style);
22937
- globalStyleElement = style;
22938
- globalStyleRefCount = 1;
22939
- };
22940
- const removeStyle = () => {
22941
- globalStyleRefCount--;
22942
- if (globalStyleRefCount <= 0 && globalStyleElement && globalStyleElement.parentNode) {
22943
- globalStyleElement.parentNode.removeChild(globalStyleElement);
22944
- globalStyleElement = null;
22945
- globalStyleRefCount = 0;
22946
- }
22947
- };
22948
- const createHiddenElement = () => {
22949
- if (hiddenElement.value) {
22950
- return hiddenElement.value;
22951
- }
22952
- injectStyle();
22953
- const el = document.createElement("div");
22954
- el.id = "yidun-captcha-trigger";
22955
- el.style.position = "absolute";
22956
- el.style.left = "-9999px";
22957
- el.style.top = "-9999px";
22958
- el.style.width = "1px";
22959
- el.style.height = "1px";
22960
- el.style.overflow = "hidden";
22961
- document.body.appendChild(el);
22962
- hiddenElement.value = el;
22963
- return el;
22964
- };
22965
- const removeHiddenElement = () => {
22966
- if (hiddenElement.value && hiddenElement.value.parentNode) {
22967
- hiddenElement.value.parentNode.removeChild(hiddenElement.value);
22968
- hiddenElement.value = null;
22969
- }
22970
- };
22971
- const cleanup = () => {
22972
- if (verifyTimeoutId.value !== null) {
22973
- clearTimeout(verifyTimeoutId.value);
22974
- verifyTimeoutId.value = null;
22975
- }
22976
- if (captchaInstance.value) {
22977
- yidunCaptchaManager.destroyNECaptcha();
22978
- captchaInstance.value = null;
22979
- }
22980
- removeHiddenElement();
22981
- removeStyle();
22982
- };
22983
- const open = (config) => {
22984
- if (!(config == null ? void 0 : config.captchaId)) {
22985
- console.error("captcha captchaId 不能为空");
22986
- return;
22987
- }
22988
- cleanup();
22989
- const isZh = getLocaleLang() === LANG_ZH;
22990
- const hiddenEl = createHiddenElement();
22991
- const captchaConfig = {
22992
- captchaId: config.captchaId,
22993
- apiVersion: 2,
22994
- element: hiddenEl,
22995
- width: isMobile.value ? "80%" : "400px",
22996
- mode: "popup",
22997
- lang: isZh ? "zh-CN" : "en",
22998
- feedbackEnable: false,
22999
- defaultFallback: false,
23000
- popupStyles: {
23001
- position: "fixed",
23002
- top: "20%"
23003
- },
23004
- onVerify: (err, data) => {
23005
- var _a;
23006
- if (err) {
23007
- console.warn("验证失败:", err);
23008
- return;
23009
- }
23010
- (_a = config == null ? void 0 : config.onSuccess) == null ? void 0 : _a.call(config, data);
23011
- cleanup();
23012
- },
23013
- onClose: () => {
23014
- cleanup();
23015
- },
23016
- onError: (error) => {
23017
- var _a;
23018
- console.error("captcha初始化失败:", error);
23019
- (_a = config == null ? void 0 : config.onFallback) == null ? void 0 : _a.call(config, config == null ? void 0 : config.onSuccess);
23020
- removeHiddenElement();
23021
- captchaInstance.value = null;
23022
- },
23023
- // 当行为验证码所需静态资源或者接口不可用时,且请求验证码失败次数达到阈值(默认为 3 次,可根据需求配置),最后一次会触发降级逻辑
23024
- onFallback: (_data) => {
23025
- var _a;
23026
- console.warn("captcha触发降级");
23027
- (_a = config == null ? void 0 : config.onFallback) == null ? void 0 : _a.call(config, config == null ? void 0 : config.onSuccess);
23028
- removeHiddenElement();
23029
- captchaInstance.value = null;
23030
- }
23031
- };
23032
- yidunCaptchaManager.initNECaptcha(
23033
- captchaConfig,
23034
- (instance) => {
23035
- if (!yidunCaptchaManager.hasInstance()) {
23036
- return;
23037
- }
23038
- captchaInstance.value = instance;
23039
- verifyTimeoutId.value = window.setTimeout(() => {
23040
- if (yidunCaptchaManager.hasInstance() && captchaInstance.value) {
23041
- yidunCaptchaManager.verify();
23042
- }
23043
- verifyTimeoutId.value = null;
23044
- }, 0);
23045
- },
23046
- (err) => {
23047
- var _a;
23048
- console.error("captcha初始化失败:", err);
23049
- (_a = config == null ? void 0 : config.onFallback) == null ? void 0 : _a.call(config, config == null ? void 0 : config.onSuccess);
23050
- removeHiddenElement();
23051
- captchaInstance.value = null;
23052
- }
23053
- ).catch((error) => {
23054
- var _a;
23055
- console.error("captcha初始化异常:", error);
23056
- (_a = config == null ? void 0 : config.onFallback) == null ? void 0 : _a.call(config, config == null ? void 0 : config.onSuccess);
23057
- removeHiddenElement();
23058
- captchaInstance.value = null;
23059
- });
23060
- };
23061
- const verify = () => {
23062
- if (yidunCaptchaManager.hasInstance()) {
23063
- yidunCaptchaManager.verify();
23064
- } else {
23065
- console.warn("captcha实例不存在,请先调用 open 方法初始化");
23066
- }
23067
- };
23068
- const close = () => {
23069
- cleanup();
23070
- };
23071
- onBeforeUnmount(() => {
23072
- cleanup();
23073
- });
23074
- return {
23075
- open,
23076
- verify,
23077
- close
23078
- };
23079
- };
23080
22491
  const _sfc_main$3 = {};
23081
22492
  const _hoisted_1$2 = { class: "content-loading" };
23082
22493
  function _sfc_render(_ctx, _cache) {
@@ -23812,34 +23223,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23812
23223
  extraData: {}
23813
23224
  });
23814
23225
  };
23815
- const captchaLocalMode = ref("yidun");
23226
+ let captchaMode = "yunpian";
23816
23227
  const slidCaptcha = useSlidCaptcha();
23817
23228
  const yunpianCaptcha = useYunpianCaptcha();
23818
- const yiDunCaptcha = useYiDunCaptcha();
23819
- const captchaType = ref({
23820
- provider: "SELF"
23821
- });
23822
- const getCurrentCaptchaType = async () => {
23823
- var _a;
23824
- const res = await API.getCaptchaType();
23825
- if (!res.error) {
23826
- captchaType.value = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || { provider: "SELF" };
23827
- switch (captchaType.value.provider) {
23828
- case "SELF":
23829
- captchaLocalMode.value = "tianai";
23830
- break;
23831
- case "YUNPIAN":
23832
- captchaLocalMode.value = "yunpian";
23833
- break;
23834
- case "YIDUN":
23835
- captchaLocalMode.value = "yidun";
23836
- break;
23837
- default:
23838
- captchaLocalMode.value = "tianai";
23839
- break;
23840
- }
23841
- }
23842
- };
23843
23229
  const LoginCheck = async () => {
23844
23230
  let agreementFlag = false;
23845
23231
  if (!status.value || !dataShareChecked.value) {
@@ -23949,180 +23335,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23949
23335
  }
23950
23336
  });
23951
23337
  };
23952
- const yiDunGraphValidate = () => {
23953
- loading.value = false;
23954
- const currentCaptchaId = getYiDunCaptchaId({ scene: "password" });
23955
- if (!currentCaptchaId) {
23956
- console.error("验证码 ID 未获取到");
23957
- return;
23958
- }
23959
- yiDunCaptcha.open({
23960
- captchaId: currentCaptchaId,
23961
- onSuccess: (captchaData) => {
23962
- const captchaId = (captchaData == null ? void 0 : captchaData.fallback) ? (captchaData == null ? void 0 : captchaData.captchaId) || (captchaData == null ? void 0 : captchaData.id) : currentCaptchaId;
23963
- if (!captchaId) {
23964
- console.error("验证码 ID 无效");
23965
- return;
23966
- }
23967
- handleConfirm({
23968
- validate: captchaData == null ? void 0 : captchaData.validate,
23969
- token: captchaData == null ? void 0 : captchaData.token,
23970
- authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23971
- captchaId
23972
- });
23973
- },
23974
- onFallback: (originalOnSuccess) => {
23975
- slidCaptcha.open({
23976
- onSuccess: (captchaData) => {
23977
- if (!(captchaData == null ? void 0 : captchaData.id)) {
23978
- console.error("天爱验证码返回数据无效,缺少 id 字段");
23979
- return;
23980
- }
23981
- originalOnSuccess == null ? void 0 : originalOnSuccess({
23982
- captchaId: captchaData.id,
23983
- fallback: true
23984
- });
23985
- }
23986
- });
23987
- }
23988
- });
23989
- };
23990
- const getYiDunCaptchaId = ({ scene, isDomesticNumber = true }) => {
23991
- var _a, _b, _c;
23992
- if (captchaType.value.provider !== "YIDUN") {
23993
- return "";
23994
- }
23995
- if (scene === "password") {
23996
- return (_a = captchaType.value.international) == null ? void 0 : _a.captcha_id;
23997
- }
23998
- if (scene === "sendCode") {
23999
- return isDomesticNumber ? (_b = captchaType.value.domestic) == null ? void 0 : _b.captcha_id : (_c = captchaType.value.international) == null ? void 0 : _c.captcha_id;
24000
- }
24001
- return "";
24002
- };
24003
- const handleCaptchaVerification = (conf, options = {}) => {
24004
- try {
24005
- const { isDomesticNumber = true, checkCondition, extraParams = {} } = options;
24006
- if (checkCondition && !checkCondition(conf)) {
24007
- return false;
24008
- }
24009
- if (captchaLocalMode.value === "yunpian") {
24010
- yunpianCaptcha.open({
24011
- onSuccess: (captchaData) => {
24012
- handleCountDown({
24013
- ...conf,
24014
- token: captchaData == null ? void 0 : captchaData.token,
24015
- authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24016
- captchaId: captchaData == null ? void 0 : captchaData.captchaId,
24017
- ...extraParams
24018
- });
24019
- },
24020
- onFallback: (originalOnSuccess) => {
24021
- captchaLocalMode.value = "tianai";
24022
- slidCaptcha.open({
24023
- onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
24024
- captchaId: captchaData.id
24025
- })
24026
- });
24027
- }
24028
- });
24029
- return true;
24030
- }
24031
- if (captchaLocalMode.value === "tianai") {
24032
- slidCaptcha.open({
24033
- onSuccess: (captchaData) => {
24034
- handleCountDown({
24035
- ...conf,
24036
- captchaId: captchaData.id,
24037
- ...extraParams
24038
- });
24039
- }
24040
- });
24041
- return true;
24042
- }
24043
- if (captchaLocalMode.value === "yidun") {
24044
- const currentCaptchaId = getYiDunCaptchaId({ scene: "sendCode", isDomesticNumber });
24045
- if (!currentCaptchaId) {
24046
- console.error("易盾验证码 ID 未获取到,降级到天爱验证码");
24047
- captchaLocalMode.value = "tianai";
24048
- slidCaptcha.open({
24049
- onSuccess: (captchaData) => {
24050
- handleCountDown({
24051
- ...conf,
24052
- captchaId: captchaData.id,
24053
- ...extraParams
24054
- });
24055
- }
24056
- });
24057
- return true;
24058
- }
24059
- yiDunCaptcha.open({
24060
- captchaId: currentCaptchaId,
24061
- onSuccess: (captchaData) => {
24062
- const captchaId = (captchaData == null ? void 0 : captchaData.fallback) ? (captchaData == null ? void 0 : captchaData.captchaId) || (captchaData == null ? void 0 : captchaData.id) : currentCaptchaId;
24063
- if (!captchaId) {
24064
- console.error("验证码 ID 无效");
24065
- return;
24066
- }
24067
- handleCountDown({
24068
- ...conf,
24069
- token: captchaData == null ? void 0 : captchaData.token,
24070
- authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24071
- captchaId,
24072
- validate: captchaData == null ? void 0 : captchaData.validate,
24073
- ...extraParams
24074
- });
24075
- },
24076
- onFallback: (originalOnSuccess) => {
24077
- captchaLocalMode.value = "tianai";
24078
- slidCaptcha.open({
24079
- onSuccess: (captchaData) => {
24080
- if (!(captchaData == null ? void 0 : captchaData.id)) {
24081
- console.error("天爱验证码返回数据无效,缺少 id 字段");
24082
- return;
24083
- }
24084
- originalOnSuccess == null ? void 0 : originalOnSuccess({
24085
- captchaId: captchaData.id,
24086
- fallback: true
24087
- });
24088
- }
24089
- });
24090
- }
24091
- });
24092
- return true;
24093
- }
24094
- console.warn(`未知的验证码模式: ${captchaLocalMode.value},降级到天爱验证码`);
24095
- captchaLocalMode.value = "tianai";
24096
- slidCaptcha.open({
24097
- onSuccess: (captchaData) => {
24098
- handleCountDown({
24099
- ...conf,
24100
- captchaId: captchaData.id,
24101
- ...extraParams
24102
- });
24103
- }
24104
- });
24105
- return true;
24106
- } catch (error) {
24107
- console.error("处理验证码时发生错误:", error);
24108
- try {
24109
- captchaLocalMode.value = "tianai";
24110
- slidCaptcha.open({
24111
- onSuccess: (captchaData) => {
24112
- handleCountDown({
24113
- ...conf,
24114
- captchaId: captchaData.id,
24115
- ...options.extraParams
24116
- });
24117
- }
24118
- });
24119
- return true;
24120
- } catch (fallbackError) {
24121
- console.error("降级验证码也失败:", fallbackError);
24122
- return false;
24123
- }
24124
- }
24125
- };
24126
23338
  const errForRemoteLogin = ref(false);
24127
23339
  const handleRemoteLogin = () => {
24128
23340
  errForRemoteLogin.value = true;
@@ -24171,7 +23383,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24171
23383
  const passwordParams = {
24172
23384
  type: "password",
24173
23385
  ...res,
24174
- validate: info == null ? void 0 : info.validate,
24175
23386
  captchaId: info == null ? void 0 : info.captchaId,
24176
23387
  token: info == null ? void 0 : info.token,
24177
23388
  authenticate: info == null ? void 0 : info.authenticate
@@ -24182,14 +23393,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24182
23393
  successFunc: loginSuccess,
24183
23394
  failFunc: loginFail,
24184
23395
  loginDeviceType: "pc",
24185
- country,
24186
- captchaType: captchaType.value
23396
+ country
24187
23397
  },
24188
23398
  loginParams: passwordParams,
24189
- lintRemoteLogin: handleRemoteLogin,
24190
23399
  graphValidate,
24191
- yunpianGraphValidate,
24192
- yiDunGraphValidate
23400
+ lintRemoteLogin: handleRemoteLogin,
23401
+ yunpianGraphValidate
24193
23402
  });
24194
23403
  break;
24195
23404
  }
@@ -24274,8 +23483,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24274
23483
  mobile,
24275
23484
  captchaId: conf == null ? void 0 : conf.captchaId,
24276
23485
  token: conf == null ? void 0 : conf.token,
24277
- authenticate: conf == null ? void 0 : conf.authenticate,
24278
- validate: conf == null ? void 0 : conf.validate
23486
+ authenticate: conf == null ? void 0 : conf.authenticate
24279
23487
  });
24280
23488
  break;
24281
23489
  }
@@ -24284,8 +23492,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24284
23492
  mobile_email: mobile,
24285
23493
  captcha_id: conf == null ? void 0 : conf.captchaId,
24286
23494
  token: conf == null ? void 0 : conf.token,
24287
- authenticate: conf == null ? void 0 : conf.authenticate,
24288
- validate: conf == null ? void 0 : conf.validate
23495
+ authenticate: conf == null ? void 0 : conf.authenticate
24289
23496
  });
24290
23497
  res = await API.getMobileEmailCode(requestData);
24291
23498
  break;
@@ -24296,8 +23503,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24296
23503
  type: "BINDING_MOBILE",
24297
23504
  captchaId: conf == null ? void 0 : conf.captchaId,
24298
23505
  token: conf == null ? void 0 : conf.token,
24299
- authenticate: conf == null ? void 0 : conf.authenticate,
24300
- validate: conf == null ? void 0 : conf.validate
23506
+ authenticate: conf == null ? void 0 : conf.authenticate
24301
23507
  });
24302
23508
  break;
24303
23509
  }
@@ -24307,8 +23513,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24307
23513
  type: "REGISTER",
24308
23514
  captchaId: conf == null ? void 0 : conf.captchaId,
24309
23515
  token: conf == null ? void 0 : conf.token,
24310
- authenticate: conf == null ? void 0 : conf.authenticate,
24311
- validate: conf == null ? void 0 : conf.validate
23516
+ authenticate: conf == null ? void 0 : conf.authenticate
24312
23517
  });
24313
23518
  break;
24314
23519
  }
@@ -24316,7 +23521,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24316
23521
  return res;
24317
23522
  };
24318
23523
  const handleCountDown = async (conf) => {
24319
- var _a, _b, _c, _d, _e;
23524
+ var _a, _b, _c;
24320
23525
  const formData = await FormRef.value.ValidateFormKeys([conf.key]);
24321
23526
  const mobile = getPhone(conf);
24322
23527
  if (formData.type === "success") {
@@ -24328,49 +23533,98 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24328
23533
  const isDomesticNumber = country === "CN" || !country;
24329
23534
  const isLoginOrRegister = formType.value === "login" || formType.value === "register";
24330
23535
  if (!isDomesticNumber && !conf.noVerificationRequired && isLoginOrRegister) {
24331
- if (handleCaptchaVerification(conf, {
24332
- isDomesticNumber,
24333
- extraParams: {
24334
- noVerificationRequired: true,
24335
- smsReported: true
24336
- }
24337
- })) {
23536
+ if (captchaMode === "yunpian") {
23537
+ yunpianCaptcha.open({
23538
+ onSuccess: (captchaData) => {
23539
+ handleCountDown({
23540
+ ...conf,
23541
+ token: captchaData == null ? void 0 : captchaData.token,
23542
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23543
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
23544
+ noVerificationRequired: true,
23545
+ smsReported: true
23546
+ });
23547
+ },
23548
+ onFallback: (originalOnSuccess) => {
23549
+ captchaMode = "tianai";
23550
+ slidCaptcha.open({
23551
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23552
+ captchaId: captchaData.id
23553
+ })
23554
+ });
23555
+ }
23556
+ });
23557
+ return;
23558
+ } else if (captchaMode === "tianai") {
23559
+ slidCaptcha.open({
23560
+ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, noVerificationRequired: true, smsReported: true })
23561
+ });
24338
23562
  return;
24339
23563
  }
24340
23564
  }
24341
23565
  if (formType.value === "forget") {
24342
- const needVerification = captchaLocalMode.value === "yunpian" && (!conf.token || !conf.authenticate) || captchaLocalMode.value === "tianai" && !conf.captchaId || captchaLocalMode.value === "yidun" && !conf.validate;
24343
- if (needVerification) {
24344
- if (handleCaptchaVerification(conf, {
24345
- isDomesticNumber,
24346
- checkCondition: () => needVerification,
24347
- extraParams: {
24348
- smsReported: true
24349
- }
24350
- })) {
23566
+ if (captchaMode === "yunpian") {
23567
+ if (!conf.token || !conf.authenticate) {
23568
+ yunpianCaptcha.open({
23569
+ onSuccess: (captchaData) => {
23570
+ handleCountDown({
23571
+ ...conf,
23572
+ token: captchaData == null ? void 0 : captchaData.token,
23573
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23574
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
23575
+ smsReported: true
23576
+ });
23577
+ },
23578
+ onFallback: (originalOnSuccess) => {
23579
+ captchaMode = "tianai";
23580
+ slidCaptcha.open({
23581
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23582
+ captchaId: captchaData.id
23583
+ })
23584
+ });
23585
+ }
23586
+ });
24351
23587
  return;
24352
23588
  }
23589
+ } else if (captchaMode === "tianai" && !conf.captchaId) {
23590
+ slidCaptcha.open({
23591
+ onSuccess: (captchaData) => {
23592
+ handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true });
23593
+ }
23594
+ });
23595
+ return;
24353
23596
  }
24354
23597
  }
24355
23598
  if (tabPanel.value === "verifyCode" || ["register", "forget", "bindPhone"].includes(formType.value)) {
24356
23599
  const verifyCodeRes = await handleCountDownSubmission(conf, mobile);
24357
23600
  if (["login", "register", "bindPhone"].includes(formType.value)) {
24358
- if (needGraphCode((_b = verifyCodeRes == null ? void 0 : verifyCodeRes.error) == null ? void 0 : _b.error_code)) {
24359
- if (((_c = captchaType.value) == null ? void 0 : _c.provider) === "SELF") {
24360
- captchaLocalMode.value = "tianai";
24361
- } else if (((_d = captchaType.value) == null ? void 0 : _d.provider) === "YUNPIAN") {
24362
- captchaLocalMode.value = "yunpian";
24363
- } else if (((_e = captchaType.value) == null ? void 0 : _e.provider) === "YIDUN") {
24364
- captchaLocalMode.value = "yidun";
24365
- }
24366
- if (handleCaptchaVerification(conf, {
24367
- isDomesticNumber,
24368
- extraParams: {
23601
+ if (((_b = verifyCodeRes == null ? void 0 : verifyCodeRes.error) == null ? void 0 : _b.error_code) === GRAPH_CODE) {
23602
+ captchaMode = "tianai";
23603
+ slidCaptcha.open({
23604
+ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true })
23605
+ });
23606
+ return;
23607
+ }
23608
+ if (((_c = verifyCodeRes == null ? void 0 : verifyCodeRes.error) == null ? void 0 : _c.error_code) === YUNPIAN_GRAPH_CODE) {
23609
+ captchaMode = "yunpian";
23610
+ yunpianCaptcha.open({
23611
+ onSuccess: (captchaData) => handleCountDown({
23612
+ ...conf,
23613
+ token: captchaData == null ? void 0 : captchaData.token,
23614
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23615
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
24369
23616
  smsReported: true
23617
+ }),
23618
+ onFallback: (originalOnSuccess) => {
23619
+ captchaMode = "tianai";
23620
+ slidCaptcha.open({
23621
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23622
+ captchaId: captchaData.id
23623
+ })
23624
+ });
24370
23625
  }
24371
- })) {
24372
- return;
24373
- }
23626
+ });
23627
+ return;
24374
23628
  }
24375
23629
  }
24376
23630
  if (!(verifyCodeRes == null ? void 0 : verifyCodeRes.error)) {
@@ -24805,7 +24059,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24805
24059
  const resetPwdDirectly = ref(false);
24806
24060
  const resetPwdWhiteList = ["change_password"];
24807
24061
  onMounted(() => {
24808
- getCurrentCaptchaType();
24809
24062
  if (tabPanel.value === "miniProgram" && formType.value === "login") {
24810
24063
  getMiniProgramQrCode();
24811
24064
  }
@@ -25526,30 +24779,29 @@ const index = {
25526
24779
  }
25527
24780
  };
25528
24781
  export {
25529
- ThemeType as A,
25530
- currentTheme as B,
25531
- LANG_EN as C,
25532
- emitEvent as D,
24782
+ currentTheme as A,
24783
+ LANG_EN as B,
24784
+ emitEvent as C,
24785
+ isHttps as D,
25533
24786
  EVENT_NAME as E,
25534
- isHttps as F,
24787
+ asideRequest as F,
25535
24788
  GIcon as G,
25536
- asideRequest as H,
25537
- _sfc_main$A as I,
25538
- loadAsideData as J,
25539
- ToolsFloat as K,
24789
+ _sfc_main$A as H,
24790
+ loadAsideData as I,
24791
+ ToolsFloat as J,
24792
+ _sfc_main as K,
25540
24793
  LANG_ZH as L,
25541
- _sfc_main as M,
25542
- GitCodeAside as N,
25543
- GitCodeHeader as O,
25544
- SiteAnnouncement as P,
25545
- useLogin as Q,
24794
+ GitCodeAside as M,
24795
+ GitCodeHeader as N,
24796
+ SiteAnnouncement as O,
24797
+ useLogin as P,
24798
+ setLayoutConfig as Q,
25546
24799
  REPO_MODULE as R,
25547
24800
  SceneValue as S,
25548
24801
  TOPIC_TYPE as T,
25549
- setLayoutConfig as U,
25550
- GitCodeLayoutEmitter as V,
25551
- setTheme as W,
25552
- index as X,
24802
+ GitCodeLayoutEmitter as U,
24803
+ setTheme as V,
24804
+ index as W,
25553
24805
  _export_sfc as _,
25554
24806
  i18n as a,
25555
24807
  REPO_EVENT as b,
@@ -25575,6 +24827,6 @@ export {
25575
24827
  vElementExposure as v,
25576
24828
  LANG_KEY as w,
25577
24829
  getLocaleLang as x,
25578
- slidCaptchaManager as y,
25579
- useLayoutConfig as z
24830
+ useLayoutConfig as y,
24831
+ ThemeType as z
25580
24832
  };