vue-layout-gitcode 1.10.11 → 1.10.13

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