vue-layout-gitcode 1.7.4 → 1.7.6

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.
@@ -7683,6 +7683,7 @@ const gitCodeLayout$1 = {
7683
7683
  }
7684
7684
  },
7685
7685
  common: {
7686
+ close: "关闭",
7686
7687
  footerSetting: {
7687
7688
  lang: "语言",
7688
7689
  theme: "主题",
@@ -7984,6 +7985,7 @@ const gitCodeLayout = {
7984
7985
  }
7985
7986
  },
7986
7987
  common: {
7988
+ close: "close",
7987
7989
  footerSetting: {
7988
7990
  lang: "Language",
7989
7991
  theme: "Theme",
@@ -8393,6 +8395,16 @@ const transferNumber = ({ number: number2, fixed = 2, byte, gt100 }) => {
8393
8395
  const isHttps = (url) => {
8394
8396
  return url.startsWith("https://") || url.startsWith("http://");
8395
8397
  };
8398
+ function filterApiParams(obj) {
8399
+ const result2 = { ...obj };
8400
+ Object.keys(result2).forEach((key) => {
8401
+ const value = result2[key];
8402
+ if (value === void 0 || value === null || value === "") {
8403
+ delete result2[key];
8404
+ }
8405
+ });
8406
+ return result2;
8407
+ }
8396
8408
  function mitt(n) {
8397
8409
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(t2, e) {
8398
8410
  var i = n.get(t2);
@@ -8899,9 +8911,6 @@ function toFormData$1(obj, formData, options) {
8899
8911
  if (utils$1.isDate(value)) {
8900
8912
  return value.toISOString();
8901
8913
  }
8902
- if (utils$1.isBoolean(value)) {
8903
- return value.toString();
8904
- }
8905
8914
  if (!useBlob && utils$1.isBlob(value)) {
8906
8915
  throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
8907
8916
  }
@@ -10205,7 +10214,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
10205
10214
  duplex: "half",
10206
10215
  credentials: isCredentialsSupported ? withCredentials : void 0
10207
10216
  });
10208
- let response = await fetch(request, fetchOptions);
10217
+ let response = await fetch(request);
10209
10218
  const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
10210
10219
  if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
10211
10220
  const options = {};
@@ -10346,7 +10355,7 @@ function dispatchRequest(config) {
10346
10355
  return Promise.reject(reason);
10347
10356
  });
10348
10357
  }
10349
- const VERSION$1 = "1.10.0";
10358
+ const VERSION$1 = "1.9.0";
10350
10359
  const validators$1 = {};
10351
10360
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
10352
10361
  validators$1[type] = function validator2(thing) {
@@ -15802,38 +15811,46 @@ function headRequest(request) {
15802
15811
  },
15803
15812
  /** 获取gitcode手机号验证码 */
15804
15813
  verifyRegisterCode(data) {
15814
+ const { mobile, type, raw_data, captchaId, token, authenticate } = data;
15815
+ const requestData = filterApiParams({
15816
+ biz_enum: type,
15817
+ mobile,
15818
+ raw_data: raw_data || "",
15819
+ captcha_id: captchaId,
15820
+ token,
15821
+ authenticate
15822
+ });
15805
15823
  return reqCatch(
15806
15824
  () => request({
15807
15825
  url: "/api/v1/user/sms/send/codeByBiz",
15808
15826
  method: "post",
15809
- data: {
15810
- biz_enum: data.type,
15811
- mobile: data.mobile,
15812
- raw_data: data.raw_data || "",
15813
- captcha_id: data.captchaId
15814
- }
15827
+ data: requestData
15815
15828
  })
15816
15829
  );
15817
15830
  },
15818
15831
  /** 快捷注册短信验证 */
15819
15832
  getQuickLoginMsg(data) {
15833
+ const { mobile, biz_enum, captchaId, token, authenticate } = data;
15834
+ const requestData = filterApiParams({
15835
+ mobile,
15836
+ biz_enum: biz_enum || "LOGIN",
15837
+ captcha_id: captchaId,
15838
+ token,
15839
+ authenticate
15840
+ });
15820
15841
  return reqCatch(
15821
15842
  () => request({
15822
15843
  url: "/api/v1/user/sms/send/codeByBiz",
15823
15844
  method: "post",
15824
- data: {
15825
- mobile: data.mobile,
15826
- biz_enum: data.biz_enum || "LOGIN",
15827
- captcha_id: data.captchaId
15828
- }
15845
+ data: requestData
15829
15846
  })
15830
15847
  );
15831
15848
  },
15832
15849
  /** 重置密码 - 获取手机或者邮箱验证码 */
15833
- getMobileEmailCode({ mobile_email = "", captcha_id = "" }) {
15850
+ getMobileEmailCode({ mobile_email = "", captcha_id = "", token = "", authenticate = "" }) {
15834
15851
  return reqCatch(
15835
15852
  () => request({
15836
- url: `/api/v1/user/forgetCode?mobile_email=${mobile_email}&captcha_id=${captcha_id}`
15853
+ url: `/api/v1/user/forgetCode?mobile_email=${mobile_email}&captcha_id=${captcha_id}&token=${token}&authenticate=${authenticate}`
15837
15854
  })
15838
15855
  );
15839
15856
  },
@@ -15918,11 +15935,13 @@ function headRequest(request) {
15918
15935
  iv,
15919
15936
  padding: Pkcs7
15920
15937
  });
15921
- const userInfo = {
15938
+ const userInfo = filterApiParams({
15922
15939
  username: data.username,
15923
15940
  password: cryptoCode.toString(),
15924
- captcha_id: data.captchaId
15925
- };
15941
+ captcha_id: data == null ? void 0 : data.captchaId,
15942
+ token: data == null ? void 0 : data.token,
15943
+ authenticate: data == null ? void 0 : data.authenticate
15944
+ });
15926
15945
  return reqCatch(
15927
15946
  () => request({
15928
15947
  url: "/api/v1/user/oauth/login",
@@ -16808,13 +16827,13 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
16808
16827
  var _a;
16809
16828
  const layoutConfig2 = useLayoutConfig();
16810
16829
  const { t: $t } = i18n.global;
16811
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-CZCho-q9.js"));
16812
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-CWApOx0h.js"));
16813
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-DNaPDp6V.js"));
16814
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-CEDj3z51.js"));
16815
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-CJrxQ4Lp.js"));
16816
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-CpOxdIQ2.js"));
16817
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-Cuh5yNJx.js"));
16830
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-D8yfGnyE.js"));
16831
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-DdJNKYxV.js"));
16832
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-Be69-zoC.js"));
16833
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-Bz-nlsnk.js"));
16834
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-BNMqNY4_.js"));
16835
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-DqhMgR8-.js"));
16836
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-RuL7bZwW.js"));
16818
16837
  const props = __props;
16819
16838
  const repoInfo = inject("repoInfo");
16820
16839
  const orgInfo = inject("orgInfo");
@@ -17468,7 +17487,7 @@ const autoAvokeLogin = ({ isLogin, loginFunc, openHarmonyGuide, loginSuccess, lo
17468
17487
  loginFunc({ type: "login", triggerType: "", loginTriggerSource: "router_login_auth", ...loginFuncOpts }, loginSuccess, openHarmonyGuide);
17469
17488
  }
17470
17489
  };
17471
- const NoticeModal = defineAsyncComponent(() => import("./notice-CszZY9kn.js"));
17490
+ const NoticeModal = defineAsyncComponent(() => import("./notice-CugIbBpk.js"));
17472
17491
  function clearNotice() {
17473
17492
  if (localStorage$2.getItem("validator_email")) {
17474
17493
  localStorage$2.removeItem("validator_email");
@@ -17763,11 +17782,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17763
17782
  register_login_type: api.get("isRegister") === "true" ? "注册" : "登录",
17764
17783
  register_login_result: api.get("success") === "true" ? "成功" : "失败",
17765
17784
  register_login_source: "快应用",
17785
+ namespace: api.get("stateFrom") || "",
17766
17786
  register_login_method: registerLoginMethodMap[api.get("registerLoginMethod")] || "",
17767
17787
  article_id: reportParams["from_id"] || "",
17768
17788
  userid_fast_application: reportParams["uuid_tt_dd"] || "",
17769
17789
  gitcode_utm_source: reportParams["utm_source"] || "",
17770
- // page_url: location.href || '',
17790
+ page_url: location.href || "",
17771
17791
  env: layoutConfig2.VITE_ENV,
17772
17792
  ...reportParams
17773
17793
  };
@@ -17790,6 +17810,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17790
17810
  api.remove("isRegister", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
17791
17811
  api.remove("success", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
17792
17812
  api.remove("registerLoginMethod", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
17813
+ api.remove("stateFrom", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
17793
17814
  localStorage$2.removeItem("quickAppLoginReportParams");
17794
17815
  }
17795
17816
  };
@@ -18211,9 +18232,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
18211
18232
  const layoutConfig2 = useLayoutConfig();
18212
18233
  const { t: t2 } = i18n.global;
18213
18234
  const route = useRoute();
18214
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-DW23yYlt.js"));
18215
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-Cx2ooQpv.js"));
18216
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-CljXAnGU.js"));
18235
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-DgoyFaF6.js"));
18236
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-BJb8PuCW.js"));
18237
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-Bos9XzoY.js"));
18217
18238
  const props = __props;
18218
18239
  console.log("slotKeys", props.slotKeys);
18219
18240
  console.log("props", props);
@@ -19929,13 +19950,15 @@ async function csdnloginCheck(route, loginCallback, request) {
19929
19950
  const layoutConfig = useLayoutConfig();
19930
19951
  const { t: t$2 } = i18n.global;
19931
19952
  const GRAPH_CODE = 400007;
19953
+ const GRAPH_CODE_01 = 400017;
19954
+ const YUNPIAN_GRAPH_CODE = 400018;
19932
19955
  const REMOTE_LOGIN_CODE = 400015;
19933
19956
  const MAX_MOBILE_COUNT = 10;
19934
19957
  const createLoginConfig = (request) => {
19935
19958
  const API = headRequest(request);
19936
19959
  return {
19937
19960
  // 短信登录
19938
- async phone(param, loginParams) {
19961
+ async phone({ param, loginParams }) {
19939
19962
  const { validFunc, successFunc = () => {
19940
19963
  }, failFunc = () => {
19941
19964
  }, country = "" } = param;
@@ -19953,19 +19976,23 @@ const createLoginConfig = (request) => {
19953
19976
  }
19954
19977
  },
19955
19978
  // 密码登录
19956
- async password(param, loginParams, graphValidate, lintRemoteLogin) {
19957
- var _a, _b;
19979
+ async password({ param, loginParams, graphValidate, lintRemoteLogin, yunpianGraphValidate }) {
19980
+ var _a, _b, _c;
19958
19981
  const { validFunc, successFunc = () => {
19959
19982
  }, failFunc = () => {
19960
19983
  } } = param;
19961
19984
  const check = validFunc ? await validFunc() : true;
19962
19985
  if (!check) return;
19963
19986
  const result2 = await API.toLogin(loginParams);
19964
- if (((_a = result2 == null ? void 0 : result2.error) == null ? void 0 : _a.error_code) === GRAPH_CODE) {
19987
+ if ([GRAPH_CODE, GRAPH_CODE_01].includes((_a = result2 == null ? void 0 : result2.error) == null ? void 0 : _a.error_code)) {
19965
19988
  graphValidate();
19966
19989
  return;
19967
19990
  }
19968
- if (((_b = result2 == null ? void 0 : result2.error) == null ? void 0 : _b.error_code) === REMOTE_LOGIN_CODE) {
19991
+ if (((_b = result2 == null ? void 0 : result2.error) == null ? void 0 : _b.error_code) === YUNPIAN_GRAPH_CODE) {
19992
+ yunpianGraphValidate();
19993
+ return;
19994
+ }
19995
+ if (((_c = result2 == null ? void 0 : result2.error) == null ? void 0 : _c.error_code) === REMOTE_LOGIN_CODE) {
19969
19996
  lintRemoteLogin();
19970
19997
  return;
19971
19998
  }
@@ -23885,7 +23912,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
23885
23912
  }
23886
23913
  });
23887
23914
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-vue-layout-gitcode"]]);
23888
- const SlidCaptcha = defineAsyncComponent(() => import("./index-BPXRBWIR.js"));
23915
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-BqiXDeb-.js"));
23889
23916
  const useSlidCaptcha = () => {
23890
23917
  const { mount, unMount } = usePopup("slid-captcha-popup");
23891
23918
  const open = (config) => {
@@ -23904,6 +23931,32 @@ const useSlidCaptcha = () => {
23904
23931
  close: unMount
23905
23932
  };
23906
23933
  };
23934
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-BlxBg6VL.js"));
23935
+ const useYunpianCaptcha = () => {
23936
+ const { mount, unMount } = usePopup("yunpian-captcha-popup");
23937
+ const open = (config) => {
23938
+ mount(YunpianCaptcha, {
23939
+ onSuccess: (resData) => {
23940
+ var _a;
23941
+ unMount();
23942
+ (_a = config == null ? void 0 : config.onSuccess) == null ? void 0 : _a.call(config, resData);
23943
+ },
23944
+ modelValue: true,
23945
+ onClose: () => unMount(),
23946
+ onFallback: () => {
23947
+ unMount();
23948
+ nextTick(() => {
23949
+ var _a;
23950
+ (_a = config == null ? void 0 : config.onFallback) == null ? void 0 : _a.call(config, config == null ? void 0 : config.onSuccess);
23951
+ });
23952
+ }
23953
+ });
23954
+ };
23955
+ return {
23956
+ open,
23957
+ close: unMount
23958
+ };
23959
+ };
23907
23960
  const _sfc_main$3 = {};
23908
23961
  const _hoisted_1$2 = { class: "content-loading" };
23909
23962
  function _sfc_render(_ctx, _cache) {
@@ -24539,7 +24592,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24539
24592
  const handleMFALoginFail = () => {
24540
24593
  collectRegisterLoginEvent({ isRegister: false, registerLoginMethod: LoginMethodEnum.PASSWORD, success: false });
24541
24594
  };
24595
+ let captchaMode = "yunpian";
24542
24596
  const slidCaptcha = useSlidCaptcha();
24597
+ const yunpianCaptcha = useYunpianCaptcha();
24543
24598
  const LoginCheck = async () => {
24544
24599
  const formData = await FormRef.value.ValidateForm();
24545
24600
  let agreementFlag = false;
@@ -24608,6 +24663,23 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24608
24663
  loading.value = false;
24609
24664
  slidCaptcha.open({ onSuccess: (captchaData) => handleConfirm({ captchaId: captchaData.id }) });
24610
24665
  };
24666
+ const yunpianGraphValidate = () => {
24667
+ loading.value = false;
24668
+ yunpianCaptcha.open({
24669
+ onSuccess: (captchaData) => handleConfirm({
24670
+ token: captchaData == null ? void 0 : captchaData.token,
24671
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24672
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId
24673
+ }),
24674
+ onFallback: (originalOnSuccess) => {
24675
+ slidCaptcha.open({
24676
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
24677
+ captchaId: captchaData.id
24678
+ })
24679
+ });
24680
+ }
24681
+ });
24682
+ };
24611
24683
  const errForRemoteLogin = ref(false);
24612
24684
  const handleRemoteLogin = () => {
24613
24685
  errForRemoteLogin.value = true;
@@ -24630,17 +24702,33 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24630
24702
  if (!check) return;
24631
24703
  await registerAction(res, mobile);
24632
24704
  } else {
24633
- const loginFunction = tabPanel.value === "password" ? LoginConfig.password : LoginConfig.phone;
24634
- const params = tabPanel.value === "password" ? { ...res, captchaId: info == null ? void 0 : info.captchaId } : {
24635
- mobile,
24636
- code: res.code
24637
- };
24638
- await loginFunction(
24639
- { validFunc: LoginCheck, successFunc: loginSuccess, failFunc: loginFail, loginDeviceType: "pc", country },
24640
- params,
24641
- graphValidate,
24642
- handleRemoteLogin
24643
- );
24705
+ if (tabPanel.value === "password") {
24706
+ const passwordParams = {
24707
+ type: "password",
24708
+ ...res,
24709
+ captchaId: info == null ? void 0 : info.captchaId,
24710
+ token: info == null ? void 0 : info.token,
24711
+ authenticate: info == null ? void 0 : info.authenticate
24712
+ };
24713
+ await LoginConfig.password({
24714
+ param: { validFunc: LoginCheck, successFunc: loginSuccess, failFunc: loginFail, loginDeviceType: "pc", country },
24715
+ loginParams: passwordParams,
24716
+ graphValidate,
24717
+ lintRemoteLogin: handleRemoteLogin,
24718
+ yunpianGraphValidate
24719
+ });
24720
+ } else {
24721
+ const phoneParams = {
24722
+ type: "verifyCode",
24723
+ mobile,
24724
+ code: res.code,
24725
+ country: country || ""
24726
+ };
24727
+ await LoginConfig.phone({
24728
+ param: { validFunc: LoginCheck, successFunc: loginSuccess, failFunc: loginFail, loginDeviceType: "pc", country },
24729
+ loginParams: phoneParams
24730
+ });
24731
+ }
24644
24732
  }
24645
24733
  setTimeout(() => {
24646
24734
  loading.value = false;
@@ -24693,20 +24781,40 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24693
24781
  const handleCountDownSubmission = async (conf, mobile) => {
24694
24782
  let res;
24695
24783
  switch (formType.value) {
24696
- case "login":
24697
- res = await API.getQuickLoginMsg({ mobile, captchaId: conf.captchaId });
24784
+ case "login": {
24785
+ res = await API.getQuickLoginMsg({
24786
+ mobile,
24787
+ captchaId: conf == null ? void 0 : conf.captchaId,
24788
+ token: conf == null ? void 0 : conf.token,
24789
+ authenticate: conf == null ? void 0 : conf.authenticate
24790
+ });
24698
24791
  break;
24699
- case "forget":
24700
- res = await API.getMobileEmailCode({ mobile_email: mobile, captcha_id: conf.captchaId });
24792
+ }
24793
+ case "forget": {
24794
+ const requestData = filterApiParams({
24795
+ mobile_email: mobile,
24796
+ captcha_id: conf == null ? void 0 : conf.captchaId,
24797
+ token: conf == null ? void 0 : conf.token,
24798
+ authenticate: conf == null ? void 0 : conf.authenticate
24799
+ });
24800
+ res = await API.getMobileEmailCode(requestData);
24701
24801
  break;
24702
- default:
24703
- res = await API.verifyRegisterCode({ mobile, type: "REGISTER", captchaId: conf.captchaId });
24802
+ }
24803
+ default: {
24804
+ res = await API.verifyRegisterCode({
24805
+ mobile,
24806
+ type: "REGISTER",
24807
+ captchaId: conf == null ? void 0 : conf.captchaId,
24808
+ token: conf == null ? void 0 : conf.token,
24809
+ authenticate: conf == null ? void 0 : conf.authenticate
24810
+ });
24704
24811
  break;
24812
+ }
24705
24813
  }
24706
24814
  return res;
24707
24815
  };
24708
24816
  const handleCountDown = async (conf) => {
24709
- var _a, _b, _c;
24817
+ var _a, _b, _c, _d, _e;
24710
24818
  const formData = await FormRef.value.ValidateFormKeys([conf.key]);
24711
24819
  const mobile = getPhone(conf);
24712
24820
  if (formData.type === "success") {
@@ -24718,28 +24826,126 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24718
24826
  const isDomesticNumber = country === "CN" || !country;
24719
24827
  const isLoginOrRegister = formType.value === "login" || formType.value === "register";
24720
24828
  if (!isDomesticNumber && !conf.noVerificationRequired && isLoginOrRegister) {
24721
- slidCaptcha.open({
24722
- onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, noVerificationRequired: true, smsReported: true })
24723
- });
24724
- return;
24829
+ if (captchaMode === "yunpian") {
24830
+ yunpianCaptcha.open({
24831
+ onSuccess: (captchaData) => {
24832
+ handleCountDown({
24833
+ ...conf,
24834
+ token: captchaData == null ? void 0 : captchaData.token,
24835
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24836
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
24837
+ noVerificationRequired: true,
24838
+ smsReported: true
24839
+ });
24840
+ },
24841
+ onFallback: (originalOnSuccess) => {
24842
+ captchaMode = "tianai";
24843
+ slidCaptcha.open({
24844
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
24845
+ captchaId: captchaData.id
24846
+ })
24847
+ });
24848
+ }
24849
+ });
24850
+ return;
24851
+ } else if (captchaMode === "tianai") {
24852
+ slidCaptcha.open({
24853
+ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, noVerificationRequired: true, smsReported: true })
24854
+ });
24855
+ return;
24856
+ }
24725
24857
  }
24726
- if (formType.value === "forget" && !conf.captchaId) {
24727
- slidCaptcha.open({
24728
- onSuccess: (captchaData) => {
24729
- handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true });
24858
+ if (formType.value === "forget") {
24859
+ if (captchaMode === "yunpian") {
24860
+ if (!conf.token || !conf.authenticate) {
24861
+ yunpianCaptcha.open({
24862
+ onSuccess: (captchaData) => {
24863
+ handleCountDown({
24864
+ ...conf,
24865
+ token: captchaData == null ? void 0 : captchaData.token,
24866
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24867
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
24868
+ smsReported: true
24869
+ });
24870
+ },
24871
+ onFallback: (originalOnSuccess) => {
24872
+ captchaMode = "tianai";
24873
+ slidCaptcha.open({
24874
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
24875
+ captchaId: captchaData.id
24876
+ })
24877
+ });
24878
+ }
24879
+ });
24880
+ return;
24730
24881
  }
24731
- });
24732
- return;
24882
+ } else if (captchaMode === "tianai" && !conf.captchaId) {
24883
+ slidCaptcha.open({
24884
+ onSuccess: (captchaData) => {
24885
+ handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true });
24886
+ }
24887
+ });
24888
+ return;
24889
+ }
24733
24890
  }
24734
24891
  if (tabPanel.value === "verifyCode" || formType.value === "register" || formType.value === "forget") {
24735
24892
  const res = await handleCountDownSubmission(conf, mobile);
24736
- if (formType.value === "login" && ((_b = res == null ? void 0 : res.error) == null ? void 0 : _b.error_code) === 400007) {
24737
- slidCaptcha.open({ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true }) });
24738
- return;
24893
+ if (formType.value === "login") {
24894
+ if ([GRAPH_CODE, GRAPH_CODE_01].includes((_b = res == null ? void 0 : res.error) == null ? void 0 : _b.error_code)) {
24895
+ captchaMode = "tianai";
24896
+ slidCaptcha.open({ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true }) });
24897
+ return;
24898
+ }
24899
+ if (((_c = res == null ? void 0 : res.error) == null ? void 0 : _c.error_code) === YUNPIAN_GRAPH_CODE) {
24900
+ captchaMode = "yunpian";
24901
+ yunpianCaptcha.open({
24902
+ onSuccess: (captchaData) => handleCountDown({
24903
+ ...conf,
24904
+ token: captchaData == null ? void 0 : captchaData.token,
24905
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24906
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
24907
+ smsReported: true
24908
+ }),
24909
+ onFallback: (originalOnSuccess) => {
24910
+ captchaMode = "tianai";
24911
+ slidCaptcha.open({
24912
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
24913
+ captchaId: captchaData.id
24914
+ })
24915
+ });
24916
+ }
24917
+ });
24918
+ return;
24919
+ }
24739
24920
  }
24740
- if (formType.value === "register" && ((_c = res == null ? void 0 : res.error) == null ? void 0 : _c.error_code) === 400007) {
24741
- slidCaptcha.open({ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true }) });
24742
- return;
24921
+ if (formType.value === "register") {
24922
+ if ([GRAPH_CODE, GRAPH_CODE_01].includes((_d = res == null ? void 0 : res.error) == null ? void 0 : _d.error_code)) {
24923
+ captchaMode = "tianai";
24924
+ slidCaptcha.open({
24925
+ onSuccess: (captchaData) => handleCountDown({ ...conf, captchaId: captchaData.id, smsReported: true })
24926
+ });
24927
+ return;
24928
+ }
24929
+ if (((_e = res == null ? void 0 : res.error) == null ? void 0 : _e.error_code) === YUNPIAN_GRAPH_CODE) {
24930
+ captchaMode = "yunpian";
24931
+ yunpianCaptcha.open({
24932
+ onSuccess: (captchaData) => handleCountDown({
24933
+ ...conf,
24934
+ token: captchaData == null ? void 0 : captchaData.token,
24935
+ authenticate: captchaData == null ? void 0 : captchaData.authenticate,
24936
+ captchaId: captchaData == null ? void 0 : captchaData.captchaId,
24937
+ smsReported: true
24938
+ }),
24939
+ onFallback: (originalOnSuccess) => {
24940
+ captchaMode = "tianai";
24941
+ slidCaptcha.open({
24942
+ onSuccess: (captchaData) => originalOnSuccess == null ? void 0 : originalOnSuccess({
24943
+ captchaId: captchaData.id
24944
+ })
24945
+ });
24946
+ }
24947
+ });
24948
+ }
24743
24949
  }
24744
24950
  if (!res.error) {
24745
24951
  cacheForm.mobile = conf.value;
@@ -25639,11 +25845,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25639
25845
  register_login_type: api.get("isRegister") === "true" ? "注册" : "登录",
25640
25846
  register_login_result: api.get("success") === "true" ? "成功" : "失败",
25641
25847
  register_login_source: "快应用",
25848
+ namespace: api.get("stateFrom") || "",
25642
25849
  register_login_method: registerLoginMethodMap[api.get("registerLoginMethod")] || "",
25643
25850
  article_id: reportParams["from_id"] || "",
25644
25851
  userid_fast_application: reportParams["uuid_tt_dd"] || "",
25645
25852
  gitcode_utm_source: reportParams["utm_source"] || "",
25646
- // page_url: location.href || '',
25853
+ page_url: location.href || "",
25647
25854
  env: layoutConfig2.VITE_ENV,
25648
25855
  ...reportParams
25649
25856
  };
@@ -25659,6 +25866,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25659
25866
  api.remove("isRegister", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
25660
25867
  api.remove("success", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
25661
25868
  api.remove("registerLoginMethod", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
25869
+ api.remove("stateFrom", { domain: layoutConfig2.VITE_COOKIE_DOMAIN });
25662
25870
  localStorage$2.removeItem("quickAppLoginReportParams");
25663
25871
  }
25664
25872
  };
@@ -25770,8 +25978,8 @@ export {
25770
25978
  transferNumber as t,
25771
25979
  useModel as u,
25772
25980
  vElementExposure as v,
25773
- ThemeType as w,
25774
- currentTheme as x,
25775
- LANG_EN as y,
25776
- getLocaleLang as z
25981
+ getLocaleLang as w,
25982
+ ThemeType as x,
25983
+ currentTheme as y,
25984
+ LANG_EN as z
25777
25985
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { J, K, O, I, S, H, x, Q, N, P, M } from "./index-DqHll-Tt.js";
1
+ import { J, K, O, I, S, H, y, Q, N, P, M } from "./index-CXLBpjRe.js";
2
2
  export {
3
3
  J as GitCodeAside,
4
4
  K as GitCodeHeader,
@@ -6,7 +6,7 @@ export {
6
6
  I as Login,
7
7
  S as SceneValue,
8
8
  H as ToolsFloat,
9
- x as currentTheme,
9
+ y as currentTheme,
10
10
  Q as default,
11
11
  N as setLayoutConfig,
12
12
  P as setTheme,
@@ -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-DqHll-Tt.js";
2
+ import { i as isPhone, u as useModel } from "./index-CXLBpjRe.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.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "用于 gitcode 站点生产环境使用",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",