vue-layout-gitcode 1.10.2 → 1.10.4

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.
@@ -13770,14 +13770,15 @@ function headRequest(request) {
13770
13770
  },
13771
13771
  /** 获取gitcode手机号验证码 */
13772
13772
  verifyRegisterCode(data) {
13773
- const { mobile, type, raw_data, captchaId, token, authenticate } = data;
13773
+ const { mobile, type, raw_data, captchaId, token, authenticate, validate } = data;
13774
13774
  const requestData = filterApiParams({
13775
13775
  biz_enum: type,
13776
13776
  mobile,
13777
13777
  raw_data: raw_data || "",
13778
13778
  captcha_id: captchaId,
13779
13779
  token,
13780
- authenticate
13780
+ authenticate,
13781
+ validate
13781
13782
  });
13782
13783
  return reqCatch(
13783
13784
  () => request({
@@ -13789,13 +13790,14 @@ function headRequest(request) {
13789
13790
  },
13790
13791
  /** 快捷注册短信验证 */
13791
13792
  getQuickLoginMsg(data) {
13792
- const { mobile, biz_enum, captchaId, token, authenticate } = data;
13793
+ const { mobile, biz_enum, captchaId, token, authenticate, validate } = data;
13793
13794
  const requestData = filterApiParams({
13794
13795
  mobile,
13795
13796
  biz_enum: biz_enum || "LOGIN",
13796
13797
  captcha_id: captchaId,
13797
13798
  token,
13798
- authenticate
13799
+ authenticate,
13800
+ validate
13799
13801
  });
13800
13802
  return reqCatch(
13801
13803
  () => request({
@@ -13806,10 +13808,10 @@ function headRequest(request) {
13806
13808
  );
13807
13809
  },
13808
13810
  /** 重置密码 - 获取手机或者邮箱验证码 */
13809
- getMobileEmailCode({ mobile_email = "", captcha_id = "", token = "", authenticate = "" }) {
13811
+ getMobileEmailCode({ mobile_email = "", captcha_id = "", token = "", authenticate = "", validate = "" }) {
13810
13812
  return reqCatch(
13811
13813
  () => request({
13812
- url: `/api/v1/user/forgetCode?mobile_email=${mobile_email}&captcha_id=${captcha_id}&token=${token}&authenticate=${authenticate}`
13814
+ url: `/api/v1/user/forgetCode?mobile_email=${mobile_email}&captcha_id=${captcha_id}&token=${token}&authenticate=${authenticate}&validate=${validate}`
13813
13815
  })
13814
13816
  );
13815
13817
  },
@@ -13899,7 +13901,8 @@ function headRequest(request) {
13899
13901
  password: cryptoCode.toString(),
13900
13902
  captcha_id: data == null ? void 0 : data.captchaId,
13901
13903
  token: data == null ? void 0 : data.token,
13902
- authenticate: data == null ? void 0 : data.authenticate
13904
+ authenticate: data == null ? void 0 : data.authenticate,
13905
+ validate: data == null ? void 0 : data.validate
13903
13906
  });
13904
13907
  return reqCatch(
13905
13908
  () => request({
@@ -14000,6 +14003,15 @@ function headRequest(request) {
14000
14003
  })
14001
14004
  );
14002
14005
  },
14006
+ /** 获取配置的图片验证码类型 */
14007
+ getCaptchaType() {
14008
+ return reqCatch(
14009
+ () => request({
14010
+ url: `/uc/api/v1/captcha/config `,
14011
+ method: "get"
14012
+ })
14013
+ );
14014
+ },
14003
14015
  // mfa 恢复码登陆
14004
14016
  postMfaRecover(data) {
14005
14017
  return reqCatchV2(
@@ -14911,13 +14923,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14911
14923
  var _a;
14912
14924
  const layoutConfig2 = useLayoutConfig();
14913
14925
  const { t: $t } = i18n.global;
14914
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-b7TWB0sB.js"));
14915
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-BVtBkkaq.js"));
14916
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-n_sB8C-2.js"));
14917
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-21OaNkz6.js"));
14918
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-BlUc_hNL.js"));
14919
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-B0Bi-rAQ.js"));
14920
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-q8c6mPy2.js"));
14926
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-Dn7KpEXq.js"));
14927
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-B9_DTuGr.js"));
14928
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-By3gMqr5.js"));
14929
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-BhGjwV79.js"));
14930
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-RzX52eKP.js"));
14931
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-DnMJrNAb.js"));
14932
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-DrJjIXTk.js"));
14921
14933
  const props = __props;
14922
14934
  const repoInfo = inject("repoInfo");
14923
14935
  const orgInfo = inject("orgInfo");
@@ -15666,7 +15678,7 @@ const autoAvokeLogin = ({ isLogin, loginFunc, openHarmonyGuide, loginSuccess, lo
15666
15678
  loginFunc({ type: "login", triggerType: "", loginTriggerSource: "router_login_auth", ...loginFuncOpts }, loginSuccess, openHarmonyGuide);
15667
15679
  }
15668
15680
  };
15669
- const NoticeModal = defineAsyncComponent(() => import("./notice-CXSuArHd.js"));
15681
+ const NoticeModal = defineAsyncComponent(() => import("./notice-IqJyqZQT.js"));
15670
15682
  function clearNotice() {
15671
15683
  if (localStorage$2.getItem("validator_email")) {
15672
15684
  localStorage$2.removeItem("validator_email");
@@ -16468,9 +16480,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
16468
16480
  const layoutConfig2 = useLayoutConfig();
16469
16481
  const { t: t2 } = i18n.global;
16470
16482
  const route = useRoute();
16471
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-Cfu7fhsT.js"));
16472
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-M5VbMFyV.js"));
16473
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-BFNabcVk.js"));
16483
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-Cm9MfzFK.js"));
16484
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-hrS6FDx2.js"));
16485
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-Bc9kQJxY.js"));
16474
16486
  const props = __props;
16475
16487
  console.log("slotKeys", props.slotKeys);
16476
16488
  console.log("props", props);
@@ -18243,8 +18255,6 @@ async function csdnloginCheck(route, loginCallback, request) {
18243
18255
  }
18244
18256
  const layoutConfig = useLayoutConfig();
18245
18257
  const { t: t$2 } = i18n.global;
18246
- const GRAPH_CODE = 400017;
18247
- const YUNPIAN_GRAPH_CODE = 400018;
18248
18258
  const REMOTE_LOGIN_CODE = 400015;
18249
18259
  const MAX_MOBILE_COUNT = 10;
18250
18260
  const createLoginConfig = (request) => {
@@ -18274,23 +18284,34 @@ const createLoginConfig = (request) => {
18274
18284
  }
18275
18285
  },
18276
18286
  // 密码登录
18277
- async password({ param, loginParams, graphValidate, lintRemoteLogin, yunpianGraphValidate }) {
18278
- var _a, _b, _c;
18287
+ async password({
18288
+ param,
18289
+ loginParams,
18290
+ graphValidate,
18291
+ lintRemoteLogin,
18292
+ yunpianGraphValidate,
18293
+ yiDunGraphValidate
18294
+ }) {
18295
+ var _a, _b, _c, _d;
18279
18296
  const { validFunc, successFunc = () => {
18280
18297
  }, failFunc = () => {
18281
- } } = param;
18298
+ }, captchaType } = param;
18282
18299
  const check = validFunc ? await validFunc() : true;
18283
18300
  if (!check) return;
18284
18301
  const result2 = await API.toLogin(loginParams);
18285
- if (((_a = result2 == null ? void 0 : result2.error) == null ? void 0 : _a.error_code) === GRAPH_CODE) {
18302
+ if (((_a = result2 == null ? void 0 : result2.error) == null ? void 0 : _a.error_code) && (captchaType == null ? void 0 : captchaType.provider) === "SELF") {
18286
18303
  graphValidate();
18287
18304
  return;
18288
18305
  }
18289
- if (((_b = result2 == null ? void 0 : result2.error) == null ? void 0 : _b.error_code) === YUNPIAN_GRAPH_CODE) {
18306
+ if (((_b = result2 == null ? void 0 : result2.error) == null ? void 0 : _b.error_code) && (captchaType == null ? void 0 : captchaType.provider) === "YUNPIAN") {
18290
18307
  yunpianGraphValidate();
18291
18308
  return;
18292
18309
  }
18293
- if (((_c = result2 == null ? void 0 : result2.error) == null ? void 0 : _c.error_code) === REMOTE_LOGIN_CODE) {
18310
+ if (((_c = result2 == null ? void 0 : result2.error) == null ? void 0 : _c.error_code) && (captchaType == null ? void 0 : captchaType.provider) === "YIDUN") {
18311
+ yiDunGraphValidate();
18312
+ return;
18313
+ }
18314
+ if (((_d = result2 == null ? void 0 : result2.error) == null ? void 0 : _d.error_code) === REMOTE_LOGIN_CODE) {
18294
18315
  lintRemoteLogin();
18295
18316
  return;
18296
18317
  }
@@ -18373,6 +18394,11 @@ const createLoginConfig = (request) => {
18373
18394
  success: true,
18374
18395
  extraData: {}
18375
18396
  });
18397
+ const resultData = result2.data.data;
18398
+ const { user_status_enum } = resultData;
18399
+ if (user_status_enum === "EMPTY_MOBILE") {
18400
+ return { success: true, data: resultData };
18401
+ }
18376
18402
  phoneAndPasswordLogin(result2.data.data, API, LoginMethodEnum.MINI_PROGRAM);
18377
18403
  return { success: true, data: result2.data.data };
18378
18404
  }
@@ -22408,7 +22434,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
22408
22434
  }
22409
22435
  });
22410
22436
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-vue-layout-gitcode"]]);
22411
- const SlidCaptcha = defineAsyncComponent(() => import("./index-BTc_UFDF.js"));
22437
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-vy7s96fo.js"));
22412
22438
  const useSlidCaptcha = () => {
22413
22439
  const { mount, unMount } = usePopup("slid-captcha-popup");
22414
22440
  const open = (config) => {
@@ -22427,7 +22453,7 @@ const useSlidCaptcha = () => {
22427
22453
  close: unMount
22428
22454
  };
22429
22455
  };
22430
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-COjVjar2.js"));
22456
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-iC2vZB0n.js"));
22431
22457
  const useYunpianCaptcha = () => {
22432
22458
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
22433
22459
  const open = (config) => {
@@ -22453,6 +22479,37 @@ const useYunpianCaptcha = () => {
22453
22479
  close: unMount
22454
22480
  };
22455
22481
  };
22482
+ const YiDunCaptcha = defineAsyncComponent(() => import("./index-dzjfyxs4.js"));
22483
+ const useYiDunCaptcha = () => {
22484
+ const { mount, unMount } = usePopup("yidun-captcha-popup");
22485
+ const open = (config) => {
22486
+ if (!(config == null ? void 0 : config.captchaId)) {
22487
+ console.error("易盾验证码 captchaId 不能为空");
22488
+ return;
22489
+ }
22490
+ mount(YiDunCaptcha, {
22491
+ captchaId: config.captchaId,
22492
+ modelValue: true,
22493
+ onSuccess: (resData) => {
22494
+ var _a;
22495
+ unMount();
22496
+ (_a = config == null ? void 0 : config.onSuccess) == null ? void 0 : _a.call(config, resData);
22497
+ },
22498
+ onClose: () => unMount(),
22499
+ onFallback: () => {
22500
+ unMount();
22501
+ nextTick(() => {
22502
+ var _a;
22503
+ (_a = config == null ? void 0 : config.onFallback) == null ? void 0 : _a.call(config, config == null ? void 0 : config.onSuccess);
22504
+ });
22505
+ }
22506
+ });
22507
+ };
22508
+ return {
22509
+ open,
22510
+ close: unMount
22511
+ };
22512
+ };
22456
22513
  const _sfc_main$3 = {};
22457
22514
  const _hoisted_1$2 = { class: "content-loading" };
22458
22515
  function _sfc_render(_ctx, _cache) {
@@ -23188,9 +23245,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23188
23245
  extraData: {}
23189
23246
  });
23190
23247
  };
23191
- let captchaMode = "yunpian";
23248
+ const captchaType = ref({
23249
+ provider: "SELF"
23250
+ });
23251
+ const getCurrentCaptchaType = async () => {
23252
+ var _a;
23253
+ const res = await API.getCaptchaType();
23254
+ if (!res.error) {
23255
+ captchaType.value = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || { provider: "SELF" };
23256
+ }
23257
+ };
23258
+ const captchaMode = ref("yunpian");
23192
23259
  const slidCaptcha = useSlidCaptcha();
23193
23260
  const yunpianCaptcha = useYunpianCaptcha();
23261
+ const yiDunCaptcha = useYiDunCaptcha();
23194
23262
  const LoginCheck = async () => {
23195
23263
  let agreementFlag = false;
23196
23264
  if (!status.value || !dataShareChecked.value) {
@@ -23300,6 +23368,156 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23300
23368
  }
23301
23369
  });
23302
23370
  };
23371
+ const getYiDunCaptchaId = ({ scene, isDomesticNumber = true }) => {
23372
+ var _a, _b, _c;
23373
+ if (captchaType.value.provider !== "YIDUN") {
23374
+ return "";
23375
+ }
23376
+ if (scene === "password") {
23377
+ return (_a = captchaType.value.international) == null ? void 0 : _a.captcha_id;
23378
+ }
23379
+ if (scene === "sendCode") {
23380
+ return isDomesticNumber ? (_b = captchaType.value.domestic) == null ? void 0 : _b.captcha_id : (_c = captchaType.value.international) == null ? void 0 : _c.captcha_id;
23381
+ }
23382
+ return "";
23383
+ };
23384
+ const handleCaptchaVerification = (conf, options = {}) => {
23385
+ try {
23386
+ const { isDomesticNumber = true, checkCondition, extraParams = {} } = options;
23387
+ if (checkCondition && !checkCondition(conf)) {
23388
+ return false;
23389
+ }
23390
+ if (captchaMode.value === "yunpian") {
23391
+ yunpianCaptcha.open({
23392
+ onSuccess: (captchaData) => {
23393
+ handleCountDown({
23394
+ ...conf,
23395
+ token: captchaData == null ? void 0 : captchaData.token,
23396
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23397
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
23398
+ ...extraParams
23399
+ });
23400
+ },
23401
+ onFallback: (originalOnSuccess) => {
23402
+ captchaMode.value = "tianai";
23403
+ slidCaptcha.open({
23404
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23405
+ captchaId: captchaData.id
23406
+ })
23407
+ });
23408
+ }
23409
+ });
23410
+ return true;
23411
+ }
23412
+ if (captchaMode.value === "tianai") {
23413
+ slidCaptcha.open({
23414
+ onSuccess: (captchaData) => {
23415
+ handleCountDown({
23416
+ ...conf,
23417
+ captchaId: captchaData.id,
23418
+ ...extraParams
23419
+ });
23420
+ }
23421
+ });
23422
+ return true;
23423
+ }
23424
+ if (captchaMode.value === "yidun") {
23425
+ const currentCaptchaId = getYiDunCaptchaId({ scene: "sendCode", isDomesticNumber });
23426
+ if (!currentCaptchaId) {
23427
+ console.error("易盾验证码 ID 未获取到,降级到天爱验证码");
23428
+ captchaMode.value = "tianai";
23429
+ slidCaptcha.open({
23430
+ onSuccess: (captchaData) => {
23431
+ handleCountDown({
23432
+ ...conf,
23433
+ captchaId: captchaData.id,
23434
+ ...extraParams
23435
+ });
23436
+ }
23437
+ });
23438
+ return true;
23439
+ }
23440
+ yiDunCaptcha.open({
23441
+ captchaId: currentCaptchaId,
23442
+ onSuccess: (captchaData) => {
23443
+ handleCountDown({
23444
+ ...conf,
23445
+ token: captchaData == null ? void 0 : captchaData.token,
23446
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23447
+ captchaId: currentCaptchaId,
23448
+ validate: captchaData == null ? void 0 : captchaData.validate,
23449
+ ...extraParams
23450
+ });
23451
+ },
23452
+ onFallback: (originalOnSuccess) => {
23453
+ captchaMode.value = "tianai";
23454
+ slidCaptcha.open({
23455
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23456
+ captchaId: captchaData.id
23457
+ })
23458
+ });
23459
+ }
23460
+ });
23461
+ return true;
23462
+ }
23463
+ console.warn(`未知的验证码模式: ${captchaMode.value},降级到天爱验证码`);
23464
+ captchaMode.value = "tianai";
23465
+ slidCaptcha.open({
23466
+ onSuccess: (captchaData) => {
23467
+ handleCountDown({
23468
+ ...conf,
23469
+ captchaId: captchaData.id,
23470
+ ...extraParams
23471
+ });
23472
+ }
23473
+ });
23474
+ return true;
23475
+ } catch (error) {
23476
+ console.error("处理验证码时发生错误:", error);
23477
+ try {
23478
+ captchaMode.value = "tianai";
23479
+ slidCaptcha.open({
23480
+ onSuccess: (captchaData) => {
23481
+ handleCountDown({
23482
+ ...conf,
23483
+ captchaId: captchaData.id,
23484
+ ...options.extraParams
23485
+ });
23486
+ }
23487
+ });
23488
+ return true;
23489
+ } catch (fallbackError) {
23490
+ console.error("降级验证码也失败:", fallbackError);
23491
+ return false;
23492
+ }
23493
+ }
23494
+ };
23495
+ const yiDunGraphValidate = () => {
23496
+ loading.value = false;
23497
+ const currentCaptchaId = getYiDunCaptchaId({ scene: "password" });
23498
+ if (!currentCaptchaId) {
23499
+ console.error("验证码 ID 未获取到");
23500
+ return;
23501
+ }
23502
+ yiDunCaptcha.open({
23503
+ captchaId: currentCaptchaId,
23504
+ onSuccess: (captchaData) => {
23505
+ handleConfirm({
23506
+ validate: captchaData == null ? void 0 : captchaData.validate,
23507
+ token: captchaData == null ? void 0 : captchaData.token,
23508
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23509
+ captchaId: currentCaptchaId
23510
+ });
23511
+ },
23512
+ onFallback: (originalOnSuccess) => {
23513
+ slidCaptcha.open({
23514
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23515
+ captchaId: captchaData.id
23516
+ })
23517
+ });
23518
+ }
23519
+ });
23520
+ };
23303
23521
  const errForRemoteLogin = ref(false);
23304
23522
  const handleRemoteLogin = () => {
23305
23523
  errForRemoteLogin.value = true;
@@ -23348,6 +23566,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23348
23566
  const passwordParams = {
23349
23567
  type: "password",
23350
23568
  ...res,
23569
+ validate: info == null ? void 0 : info.validate,
23351
23570
  captchaId: info == null ? void 0 : info.captchaId,
23352
23571
  token: info == null ? void 0 : info.token,
23353
23572
  authenticate: info == null ? void 0 : info.authenticate
@@ -23358,12 +23577,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23358
23577
  successFunc: loginSuccess,
23359
23578
  failFunc: loginFail,
23360
23579
  loginDeviceType: "pc",
23361
- country
23580
+ country,
23581
+ captchaType: captchaType.value
23362
23582
  },
23363
23583
  loginParams: passwordParams,
23364
- graphValidate,
23365
23584
  lintRemoteLogin: handleRemoteLogin,
23366
- yunpianGraphValidate
23585
+ graphValidate,
23586
+ yunpianGraphValidate,
23587
+ yiDunGraphValidate
23367
23588
  });
23368
23589
  break;
23369
23590
  }
@@ -23448,7 +23669,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23448
23669
  mobile,
23449
23670
  captchaId: conf == null ? void 0 : conf.captchaId,
23450
23671
  token: conf == null ? void 0 : conf.token,
23451
- authenticate: conf == null ? void 0 : conf.authenticate
23672
+ authenticate: conf == null ? void 0 : conf.authenticate,
23673
+ validate: conf == null ? void 0 : conf.validate
23452
23674
  });
23453
23675
  break;
23454
23676
  }
@@ -23457,7 +23679,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23457
23679
  mobile_email: mobile,
23458
23680
  captcha_id: conf == null ? void 0 : conf.captchaId,
23459
23681
  token: conf == null ? void 0 : conf.token,
23460
- authenticate: conf == null ? void 0 : conf.authenticate
23682
+ authenticate: conf == null ? void 0 : conf.authenticate,
23683
+ validate: conf == null ? void 0 : conf.validate
23461
23684
  });
23462
23685
  res = await API.getMobileEmailCode(requestData);
23463
23686
  break;
@@ -23468,7 +23691,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23468
23691
  type: "BINDING_MOBILE",
23469
23692
  captchaId: conf == null ? void 0 : conf.captchaId,
23470
23693
  token: conf == null ? void 0 : conf.token,
23471
- authenticate: conf == null ? void 0 : conf.authenticate
23694
+ authenticate: conf == null ? void 0 : conf.authenticate,
23695
+ validate: conf == null ? void 0 : conf.validate
23472
23696
  });
23473
23697
  break;
23474
23698
  }
@@ -23478,7 +23702,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23478
23702
  type: "REGISTER",
23479
23703
  captchaId: conf == null ? void 0 : conf.captchaId,
23480
23704
  token: conf == null ? void 0 : conf.token,
23481
- authenticate: conf == null ? void 0 : conf.authenticate
23705
+ authenticate: conf == null ? void 0 : conf.authenticate,
23706
+ validate: conf == null ? void 0 : conf.validate
23482
23707
  });
23483
23708
  break;
23484
23709
  }
@@ -23486,7 +23711,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23486
23711
  return res;
23487
23712
  };
23488
23713
  const handleCountDown = async (conf) => {
23489
- var _a, _b, _c;
23714
+ var _a, _b, _c, _d, _e;
23490
23715
  const formData = await FormRef.value.ValidateFormKeys([conf.key]);
23491
23716
  const mobile = getPhone(conf);
23492
23717
  if (formData.type === "success") {
@@ -23498,98 +23723,49 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23498
23723
  const isDomesticNumber = country === "CN" || !country;
23499
23724
  const isLoginOrRegister = formType.value === "login" || formType.value === "register";
23500
23725
  if (!isDomesticNumber && !conf.noVerificationRequired && isLoginOrRegister) {
23501
- if (captchaMode === "yunpian") {
23502
- yunpianCaptcha.open({
23503
- onSuccess: (captchaData) => {
23504
- handleCountDown({
23505
- ...conf,
23506
- token: captchaData == null ? void 0 : captchaData.token,
23507
- authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23508
- captchaId: captchaData == null ? void 0 : captchaData.captchaId,
23509
- noVerificationRequired: true,
23510
- smsReported: true
23511
- });
23512
- },
23513
- onFallback: (originalOnSuccess) => {
23514
- captchaMode = "tianai";
23515
- slidCaptcha.open({
23516
- onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23517
- captchaId: captchaData.id
23518
- })
23519
- });
23520
- }
23521
- });
23522
- return;
23523
- } else if (captchaMode === "tianai") {
23524
- slidCaptcha.open({
23525
- onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, noVerificationRequired: true, smsReported: true })
23526
- });
23726
+ if (handleCaptchaVerification(conf, {
23727
+ isDomesticNumber,
23728
+ extraParams: {
23729
+ noVerificationRequired: true,
23730
+ smsReported: true
23731
+ }
23732
+ })) {
23527
23733
  return;
23528
23734
  }
23529
23735
  }
23530
23736
  if (formType.value === "forget") {
23531
- if (captchaMode === "yunpian") {
23532
- if (!conf.token || !conf.authenticate) {
23533
- yunpianCaptcha.open({
23534
- onSuccess: (captchaData) => {
23535
- handleCountDown({
23536
- ...conf,
23537
- token: captchaData == null ? void 0 : captchaData.token,
23538
- authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23539
- captchaId: captchaData == null ? void 0 : captchaData.captchaId,
23540
- smsReported: true
23541
- });
23542
- },
23543
- onFallback: (originalOnSuccess) => {
23544
- captchaMode = "tianai";
23545
- slidCaptcha.open({
23546
- onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23547
- captchaId: captchaData.id
23548
- })
23549
- });
23550
- }
23551
- });
23737
+ const needVerification = captchaMode.value === "yunpian" && (!conf.token || !conf.authenticate) || captchaMode.value === "tianai" && !conf.captchaId || captchaMode.value === "yidun" && !conf.validate;
23738
+ if (needVerification) {
23739
+ if (handleCaptchaVerification(conf, {
23740
+ isDomesticNumber,
23741
+ checkCondition: () => needVerification,
23742
+ extraParams: {
23743
+ smsReported: true
23744
+ }
23745
+ })) {
23552
23746
  return;
23553
23747
  }
23554
- } else if (captchaMode === "tianai" && !conf.captchaId) {
23555
- slidCaptcha.open({
23556
- onSuccess: (captchaData) => {
23557
- handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true });
23558
- }
23559
- });
23560
- return;
23561
23748
  }
23562
23749
  }
23563
23750
  if (tabPanel.value === "verifyCode" || ["register", "forget", "bindPhone"].includes(formType.value)) {
23564
23751
  const verifyCodeRes = await handleCountDownSubmission(conf, mobile);
23565
23752
  if (["login", "register", "bindPhone"].includes(formType.value)) {
23566
- if (((_b = verifyCodeRes == null ? void 0 : verifyCodeRes.error) == null ? void 0 : _b.error_code) === GRAPH_CODE) {
23567
- captchaMode = "tianai";
23568
- slidCaptcha.open({
23569
- onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true })
23570
- });
23571
- return;
23572
- }
23573
- if (((_c = verifyCodeRes == null ? void 0 : verifyCodeRes.error) == null ? void 0 : _c.error_code) === YUNPIAN_GRAPH_CODE) {
23574
- captchaMode = "yunpian";
23575
- yunpianCaptcha.open({
23576
- onSuccess: (captchaData) => handleCountDown({
23577
- ...conf,
23578
- token: captchaData == null ? void 0 : captchaData.token,
23579
- authenticate: captchaData == null ? void 0 : captchaData.authenticate,
23580
- captchaId: captchaData == null ? void 0 : captchaData.captchaId,
23753
+ if ((_b = verifyCodeRes == null ? void 0 : verifyCodeRes.error) == null ? void 0 : _b.error_code) {
23754
+ if (((_c = captchaType.value) == null ? void 0 : _c.provider) === "SELF") {
23755
+ captchaMode.value = "tianai";
23756
+ } else if (((_d = captchaType.value) == null ? void 0 : _d.provider) === "YUNPIAN") {
23757
+ captchaMode.value = "yunpian";
23758
+ } else if (((_e = captchaType.value) == null ? void 0 : _e.provider) === "YIDUN") {
23759
+ captchaMode.value = "yidun";
23760
+ }
23761
+ if (handleCaptchaVerification(conf, {
23762
+ isDomesticNumber,
23763
+ extraParams: {
23581
23764
  smsReported: true
23582
- }),
23583
- onFallback: (originalOnSuccess) => {
23584
- captchaMode = "tianai";
23585
- slidCaptcha.open({
23586
- onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
23587
- captchaId: captchaData.id
23588
- })
23589
- });
23590
23765
  }
23591
- });
23592
- return;
23766
+ })) {
23767
+ return;
23768
+ }
23593
23769
  }
23594
23770
  }
23595
23771
  if (!(verifyCodeRes == null ? void 0 : verifyCodeRes.error)) {
@@ -23950,7 +24126,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23950
24126
  cacheForm.mask = mask ?? "";
23951
24127
  newUsername.value = username || "";
23952
24128
  formType.value = "bindPhone";
23953
- tabPanel.value = "password";
23954
24129
  return;
23955
24130
  }
23956
24131
  if (!loginResult.success) {
@@ -24025,6 +24200,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24025
24200
  const resetPwdDirectly = ref(false);
24026
24201
  const resetPwdWhiteList = ["change_password"];
24027
24202
  onMounted(() => {
24203
+ getCurrentCaptchaType();
24028
24204
  if (tabPanel.value === "miniProgram" && formType.value === "login") {
24029
24205
  getMiniProgramQrCode();
24030
24206
  }
@@ -8,7 +8,7 @@ import { Message } from "vue-devui-lal/message";
8
8
  import "vue-devui-lal/message/style.css";
9
9
  import { FixedOverlay } from "vue-devui-lal/overlay";
10
10
  import "vue-devui-lal/overlay/style.css";
11
- import { a as i18n, k as usePageResize, x as getLocaleLang, L as LANG_ZH, _ as _export_sfc } from "./index-CUU2k728.js";
11
+ import { a as i18n, k as usePageResize, x as getLocaleLang, L as LANG_ZH, _ as _export_sfc } from "./index-hbNP7Gxd.js";
12
12
  const _YunpianCaptchaManager = class _YunpianCaptchaManager {
13
13
  constructor() {
14
14
  __publicField(this, "ypRiddlerInstance", null);
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, onMounted, onUnmounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
2
- import { x as getLocaleLang, L as LANG_ZH, y as useLayoutConfig, _ as _export_sfc } from "./index-CUU2k728.js";
2
+ import { x as getLocaleLang, L as LANG_ZH, y as useLayoutConfig, _ as _export_sfc } from "./index-hbNP7Gxd.js";
3
3
  import { FixedOverlay } from "vue-devui-lal/overlay";
4
4
  import "vue-devui-lal/overlay/style.css";
5
5
  const TARGET_TEXT = "Click in order:";
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { M, N, U, K, S, O, J, A, W, Q, V, P } from "./index-CUU2k728.js";
1
+ import { M, N, U, K, S, O, J, A, W, Q, V, P } from "./index-hbNP7Gxd.js";
2
2
  export {
3
3
  M as GitCodeAside,
4
4
  N as GitCodeHeader,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createBlock, openBlock, unref, isRef, withCtx, createElementVNode, normalizeClass, createVNode, createTextVNode } from "vue";
2
- import { i as isPhone, u as useModel } from "./index-CUU2k728.js";
2
+ import { i as isPhone, u as useModel } from "./index-hbNP7Gxd.js";
3
3
  import { Notification } from "vue-devui-lal/notification";
4
4
  import { Button } from "vue-devui-lal/button";
5
5
  import "vue-devui-lal/notification/style.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-layout-gitcode",
3
- "version": "1.10.2",
3
+ "version": "1.10.4",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",