vue-layout-gitcode 1.10.7 → 1.10.9
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.
- package/{GloabarSearch-DUu7obiA.js → GloabarSearch-ExbtF8-g.js} +3 -3
- package/{MenuItem-ujIilSrF.js → MenuItem-BAw5BtBb.js} +1 -1
- package/{ProjectMenuList-D2uxi4oW.js → ProjectMenuList-Ce9S11ma.js} +8 -8
- package/{ProjectMenuListV2-mnMTod5T.js → ProjectMenuListV2-BIFEaq9E.js} +3 -3
- package/{ProjectSearch-D4MwY5Fw.js → ProjectSearch-BaW9j7jM.js} +1 -1
- package/{SearchHistoryList-BvQDLSMb.js → SearchHistoryList-BHpQc4do.js} +5 -5
- package/{SearchPrefixTag-DZtrVxRU.js → SearchPrefixTag-DE_FH3nS.js} +3 -3
- package/{SearchRecommed-B4O6K3Fm.js → SearchRecommed-CuExGAND.js} +2 -2
- package/{SearchScopeList-DEtKWKOE.js → SearchScopeList-CBc-RbqA.js} +3 -3
- package/{UserSearch-F6iY0LiZ.js → UserSearch-B9f_e7lG.js} +1 -1
- package/{index-D3NiiLnR.js → index-B-WQyJsC.js} +2 -5
- package/index-B6hVcI95.js +120 -0
- package/{index-CuA6Xb62.js → index-DOhUtX7C.js} +1897 -1057
- package/{index-_UQNaVaL.js → index-u2_TEztk.js} +41 -41
- package/index.js +12 -12
- package/{notice-9_P4iSxY.js → notice-BM-9d-tw.js} +8 -8
- package/package.json +2 -2
- package/style.css +1 -1
- package/{transWebUrl-DgtOBXr_.js → transWebUrl-g9vRctZr.js} +1 -1
- package/index-BDUX6-za.js +0 -101
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent, inject, createElementBlock, openBlock, Fragment, createElementVNode, toDisplayString, createVNode, unref, renderList, withDirectives, createBlock, ref, watch, onMounted, createCommentVNode } from "vue";
|
|
2
2
|
import "vue-devui-lal/icon";
|
|
3
3
|
import "vue-devui-lal/icon/style.css";
|
|
4
|
-
import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-
|
|
4
|
+
import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-DOhUtX7C.js";
|
|
5
5
|
import "lodash/debounce";
|
|
6
|
-
import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-
|
|
7
|
-
import "./transWebUrl-
|
|
6
|
+
import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-u2_TEztk.js";
|
|
7
|
+
import "./transWebUrl-g9vRctZr.js";
|
|
8
8
|
import "vue-devui-lal/tooltip";
|
|
9
9
|
import "vue-devui-lal/tooltip/style.css";
|
|
10
10
|
import "vue-router";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, useSlots, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createTextVNode, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, z as useLayoutConfig, A as ThemeType, B as currentTheme, L as LANG_ZH, C as LANG_EN, x as getLocaleLang, G as GIcon, D as emitEvent, F as isHttps, b as REPO_EVENT, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { Popover } from "vue-devui-lal/popover";
|
|
5
5
|
import "vue-devui-lal/popover/style.css";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, reactive, watch, computed, createElementBlock, openBlock, createCommentVNode, createBlock, withDirectives, Fragment, createElementVNode, createVNode, toDisplayString, unref, withModifiers, normalizeClass, withCtx, renderList, createTextVNode, vShow } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, z as useLayoutConfig, G as GIcon, t as transformUrl, I as _sfc_main$1, J as loadAsideData, D as emitEvent, s as setLoginTriggerSource, f as useRequestReport, H as asideRequest, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-g9vRctZr.js";
|
|
5
5
|
import { Select, Option } from "vue-devui-lal/select";
|
|
6
6
|
import { Input } from "vue-devui-lal/input";
|
|
7
7
|
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
@@ -236,7 +236,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
236
236
|
};
|
|
237
237
|
return (_ctx, _cache) => {
|
|
238
238
|
return openBlock(), createElementBlock("ul", _hoisted_1, [
|
|
239
|
-
|
|
239
|
+
__props.type === "project" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
240
240
|
createElementVNode("div", _hoisted_2, [
|
|
241
241
|
_cache[12] || (_cache[12] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
242
242
|
createElementVNode("span", _hoisted_3, [
|
|
@@ -297,7 +297,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
297
297
|
}, 8, ["modelValue", "placeholder"])
|
|
298
298
|
], 2)
|
|
299
299
|
], 64)) : createCommentVNode("", true),
|
|
300
|
-
|
|
300
|
+
__props.type === "team" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
301
301
|
createElementVNode("div", _hoisted_4, [
|
|
302
302
|
_cache[13] || (_cache[13] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
303
303
|
createElementVNode("span", _hoisted_5, [
|
|
@@ -346,10 +346,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
346
346
|
"data-openBlank": true,
|
|
347
347
|
"data-href": unref(transformUrl)(unref(transWebUrl)(item.web_url)),
|
|
348
348
|
class: "text",
|
|
349
|
-
title:
|
|
349
|
+
title: __props.type === "project" ? `${item.namespace}/${item.label}` : item.label
|
|
350
350
|
}, {
|
|
351
351
|
icon: withCtx(() => [
|
|
352
|
-
|
|
352
|
+
__props.type === "project" ? (openBlock(), createBlock(GIcon, {
|
|
353
353
|
key: 0,
|
|
354
354
|
name: "gt-line-project",
|
|
355
355
|
color: "var(--theme-menu-icon-fill)",
|
|
@@ -364,7 +364,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
364
364
|
}, null, 8, ["src", "name", "class"]))
|
|
365
365
|
]),
|
|
366
366
|
default: withCtx(() => [
|
|
367
|
-
|
|
367
|
+
__props.type === "project" ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
|
368
368
|
createElementVNode("span", _hoisted_7, toDisplayString((item.namespace || "").slice(0, 10)) + toDisplayString((item.namespace || "").length > 10 ? "..." : ""), 1),
|
|
369
369
|
createElementVNode("span", _hoisted_8, "/" + toDisplayString(item.label), 1)
|
|
370
370
|
])) : (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(item.label), 1))
|
|
@@ -379,7 +379,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
379
379
|
onClick: withModifiers(createRepoOrOrg, ["stop"])
|
|
380
380
|
}, {
|
|
381
381
|
default: withCtx(() => [
|
|
382
|
-
createTextVNode(toDisplayString(
|
|
382
|
+
createTextVNode(toDisplayString(__props.buttonText), 1)
|
|
383
383
|
]),
|
|
384
384
|
_: 1
|
|
385
385
|
})) : createCommentVNode("", true),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, reactive, computed, watch, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, withDirectives, toDisplayString, unref, withModifiers, normalizeClass, withCtx, Fragment, renderList, createTextVNode, vShow } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, z as useLayoutConfig, t as transformUrl, H as asideRequest, G as GIcon, D as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-g9vRctZr.js";
|
|
5
5
|
import { Input } from "vue-devui-lal/input";
|
|
6
6
|
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
7
7
|
import { MenuItem } from "vue-devui-lal/menu";
|
|
@@ -220,7 +220,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
220
220
|
onClick: withModifiers(createRepoOrOrg, ["stop"])
|
|
221
221
|
}, {
|
|
222
222
|
default: withCtx(() => [
|
|
223
|
-
createTextVNode(toDisplayString(
|
|
223
|
+
createTextVNode(toDisplayString(__props.buttonText), 1)
|
|
224
224
|
]),
|
|
225
225
|
_: 1
|
|
226
226
|
})) : createCommentVNode("", true),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, inject, computed, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
|
|
2
|
-
import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-
|
|
2
|
+
import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-DOhUtX7C.js";
|
|
3
3
|
import { useRoute, useRouter } from "vue-router";
|
|
4
4
|
import "vue-devui-lal/icon";
|
|
5
5
|
import "vue-devui-lal/icon/style.css";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers } from "vue";
|
|
2
|
-
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = { class: "history-list" };
|
|
@@ -105,7 +105,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
105
105
|
};
|
|
106
106
|
return (_ctx, _cache) => {
|
|
107
107
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
108
|
-
|
|
108
|
+
__props.searchHistoryList.length ? (openBlock(), createElementBlock("ul", {
|
|
109
109
|
key: 0,
|
|
110
110
|
class: "history-list-box mt-[16px]",
|
|
111
111
|
onMouseleave: resetIndex
|
|
@@ -113,7 +113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
(openBlock(true), createElementBlock(Fragment, null, renderList(historyList.value, (item, index) => {
|
|
114
114
|
return openBlock(), createElementBlock("li", {
|
|
115
115
|
key: item,
|
|
116
|
-
class: normalizeClass(
|
|
116
|
+
class: normalizeClass(__props.activeIndex === index ? "hoverbg" : ""),
|
|
117
117
|
onClick: ($event) => toSearch(item),
|
|
118
118
|
onMouseenter: ($event) => onSearchEnter(index)
|
|
119
119
|
}, [
|
|
@@ -136,10 +136,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
136
136
|
]),
|
|
137
137
|
createElementVNode("div", _hoisted_8, [
|
|
138
138
|
createElementVNode("span", {
|
|
139
|
-
class: normalizeClass(
|
|
139
|
+
class: normalizeClass(__props.activeIndex === index ? "text-[var(--theme-text)]" : "text-[var(--theme-placeholder)]")
|
|
140
140
|
}, toDisplayString(getRepoType(item).text), 3),
|
|
141
141
|
createVNode(GIcon, {
|
|
142
|
-
name:
|
|
142
|
+
name: __props.activeIndex === index ? getRepoType(item).hoverIcon : getRepoType(item).icon
|
|
143
143
|
}, null, 8, ["name"])
|
|
144
144
|
])
|
|
145
145
|
]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, createElementVNode, withDirectives, toDisplayString, withModifiers, createVNode, vShow } from "vue";
|
|
2
|
-
import { G as GIcon, _ as _export_sfc } from "./index-
|
|
2
|
+
import { G as GIcon, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = { class: "ellipsis" };
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
class: "g-header-search-projectname flex items-center px-[16px]",
|
|
24
24
|
onClick: onInputClick
|
|
25
25
|
}, [
|
|
26
|
-
createElementVNode("span", _hoisted_1, toDisplayString(
|
|
26
|
+
createElementVNode("span", _hoisted_1, toDisplayString(__props.tag), 1),
|
|
27
27
|
withDirectives(createElementVNode("span", {
|
|
28
28
|
class: "g-header-search-projectname-close ml-[12px] flex",
|
|
29
29
|
onClick: withModifiers(onCloseTag, ["stop"])
|
|
@@ -34,7 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
34
|
size: "7px"
|
|
35
35
|
})
|
|
36
36
|
], 512), [
|
|
37
|
-
[vShow,
|
|
37
|
+
[vShow, __props.closeVisible]
|
|
38
38
|
])
|
|
39
39
|
]);
|
|
40
40
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, onMounted, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
|
|
2
|
-
import { u as useReportRepo, S as SearchRepoCard } from "./index-
|
|
3
|
-
import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-
|
|
2
|
+
import { u as useReportRepo, S as SearchRepoCard } from "./index-u2_TEztk.js";
|
|
3
|
+
import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
4
4
|
import { Row, Col } from "vue-devui-lal/grid";
|
|
5
5
|
import { SkeletonItem } from "vue-devui-lal/skeleton";
|
|
6
6
|
import "vue-devui-lal/grid/style.css";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, createElementBlock, openBlock, Fragment, renderList, createElementVNode, createVNode, createCommentVNode, toDisplayString, unref } from "vue";
|
|
2
|
-
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = ["onClick"];
|
|
@@ -27,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
};
|
|
28
28
|
return (_ctx, _cache) => {
|
|
29
29
|
return openBlock(), createElementBlock("ul", null, [
|
|
30
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
30
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.searchScopeList, (item, index) => {
|
|
31
31
|
return openBlock(), createElementBlock("li", {
|
|
32
32
|
key: index,
|
|
33
33
|
class: "g-header-search-scopechoose pt-[16px] px-[8px]",
|
|
@@ -41,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
}),
|
|
42
42
|
item.label ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(item.label) + ":", 1)) : createCommentVNode("", true),
|
|
43
43
|
item.value ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(item.value), 1)) : createCommentVNode("", true),
|
|
44
|
-
createElementVNode("span", _hoisted_6, toDisplayString(
|
|
44
|
+
createElementVNode("span", _hoisted_6, toDisplayString(__props.searchStr), 1)
|
|
45
45
|
]),
|
|
46
46
|
createElementVNode("p", _hoisted_7, [
|
|
47
47
|
createElementVNode("span", null, toDisplayString(item.label ? `${item.label}${unref($t)("gitCodeLayout.header.underSearch")}` : item.title), 1),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, ref, watch, withDirectives, createElementBlock, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
|
|
2
|
-
import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-
|
|
2
|
+
import { a as i18n, h as headRequest, G as GIcon, t as transformUrl } from "./index-DOhUtX7C.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = { class: "px-[8px] history-list-project pl-[8px]" };
|
|
@@ -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-
|
|
11
|
+
import { a as i18n, k as usePageResize, x as getLocaleLang, L as LANG_ZH, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
12
12
|
const _YunpianCaptchaManager = class _YunpianCaptchaManager {
|
|
13
13
|
constructor() {
|
|
14
14
|
__publicField(this, "ypRiddlerInstance", null);
|
|
@@ -60,7 +60,6 @@ const _YunpianCaptchaManager = class _YunpianCaptchaManager {
|
|
|
60
60
|
*/
|
|
61
61
|
async initYpRiddler(config) {
|
|
62
62
|
if (this.ypRiddlerInstance) {
|
|
63
|
-
console.log("YpRiddler 实例已存在,无需重复初始化");
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
66
65
|
if (!config.container) {
|
|
@@ -82,7 +81,6 @@ const _YunpianCaptchaManager = class _YunpianCaptchaManager {
|
|
|
82
81
|
throw new Error("YpRiddler 构造函数不可用");
|
|
83
82
|
}
|
|
84
83
|
this.ypRiddlerInstance = new window.YpRiddler(config);
|
|
85
|
-
console.log("YpRiddler 全局实例创建成功");
|
|
86
84
|
} catch (error) {
|
|
87
85
|
console.error("创建 YpRiddler 实例失败:", error);
|
|
88
86
|
this.ypRiddlerInstance = null;
|
|
@@ -99,7 +97,6 @@ const _YunpianCaptchaManager = class _YunpianCaptchaManager {
|
|
|
99
97
|
this.ypRiddlerInstance.destroy();
|
|
100
98
|
}
|
|
101
99
|
this.ypRiddlerInstance = null;
|
|
102
|
-
console.log("YpRiddler 实例已销毁");
|
|
103
100
|
} catch (error) {
|
|
104
101
|
console.error("销毁 YpRiddler 实例失败:", error);
|
|
105
102
|
}
|
|
@@ -246,7 +243,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
246
243
|
};
|
|
247
244
|
return (_ctx, _cache) => {
|
|
248
245
|
return openBlock(), createBlock(unref(FixedOverlay), {
|
|
249
|
-
class: "captcha-overlay",
|
|
246
|
+
class: "captcha-overlay-yunpian",
|
|
250
247
|
"close-on-click-overlay": ""
|
|
251
248
|
}, {
|
|
252
249
|
default: withCtx(() => [
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { defineComponent, onMounted, nextTick, onUnmounted, createBlock, openBlock, unref, withCtx, createElementVNode } from "vue";
|
|
2
|
+
import { x as getLocaleLang, L as LANG_ZH, y as slidCaptchaManager, z as useLayoutConfig, _ as _export_sfc } from "./index-DOhUtX7C.js";
|
|
3
|
+
import { FixedOverlay } from "vue-devui-lal/overlay";
|
|
4
|
+
import "vue-devui-lal/overlay/style.css";
|
|
5
|
+
const TARGET_TEXT = "Click in order:";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{ name: "tianaiCaptcha" },
|
|
8
|
+
__name: "index",
|
|
9
|
+
emits: ["close", "success"],
|
|
10
|
+
setup(__props, { emit: __emit }) {
|
|
11
|
+
const isZh = getLocaleLang() === LANG_ZH;
|
|
12
|
+
const emits = __emit;
|
|
13
|
+
let timer = null;
|
|
14
|
+
const captchaInit = async () => {
|
|
15
|
+
try {
|
|
16
|
+
const captchaBox = document.getElementById("captcha-box");
|
|
17
|
+
if (!captchaBox) {
|
|
18
|
+
console.error("验证码容器元素不存在");
|
|
19
|
+
emits("close");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const baseURL = useLayoutConfig().VITE_API_HOST;
|
|
23
|
+
const config = {
|
|
24
|
+
requestCaptchaDataUrl: `${baseURL}/uc/api/v1/captcha/gen`,
|
|
25
|
+
validCaptchaUrl: `${baseURL}/uc/api/v1/captcha/check`,
|
|
26
|
+
bindEl: "#captcha-box",
|
|
27
|
+
validSuccess: (res) => {
|
|
28
|
+
stopTimer();
|
|
29
|
+
slidCaptchaManager.destroyTAC();
|
|
30
|
+
emits("success", res.data);
|
|
31
|
+
},
|
|
32
|
+
validFail: () => {
|
|
33
|
+
slidCaptchaManager.reloadCaptcha();
|
|
34
|
+
stopTimer();
|
|
35
|
+
startTimer();
|
|
36
|
+
},
|
|
37
|
+
btnRefreshFun: () => {
|
|
38
|
+
slidCaptchaManager.reloadCaptcha();
|
|
39
|
+
stopTimer();
|
|
40
|
+
startTimer();
|
|
41
|
+
},
|
|
42
|
+
btnCloseFun: () => {
|
|
43
|
+
stopTimer();
|
|
44
|
+
slidCaptchaManager.destroyTAC();
|
|
45
|
+
emits("close");
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const style = {
|
|
49
|
+
logoUrl: null
|
|
50
|
+
// 去除logo
|
|
51
|
+
};
|
|
52
|
+
await slidCaptchaManager.initTAC(
|
|
53
|
+
"https://cdn-static.gitcode.com/js/tac/",
|
|
54
|
+
config,
|
|
55
|
+
style,
|
|
56
|
+
() => {
|
|
57
|
+
slidCaptchaManager.init();
|
|
58
|
+
nextTick(() => {
|
|
59
|
+
replaceEnglishTip();
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
(err) => {
|
|
63
|
+
console.error("初始化 TAC 失败:", err);
|
|
64
|
+
emits("close");
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error("初始化 TAC 失败:", error);
|
|
69
|
+
emits("close");
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const replaceEnglishTip = () => {
|
|
73
|
+
if (isZh) return false;
|
|
74
|
+
const tipDom = document.querySelector("#captcha-box #tianai-captcha-click-track-font");
|
|
75
|
+
if (tipDom && tipDom.textContent !== TARGET_TEXT) {
|
|
76
|
+
tipDom.textContent = TARGET_TEXT;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
if (tipDom && tipDom.textContent === TARGET_TEXT) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
};
|
|
84
|
+
const startTimer = () => {
|
|
85
|
+
if (isZh) return;
|
|
86
|
+
stopTimer();
|
|
87
|
+
timer = window.setInterval(() => {
|
|
88
|
+
replaceEnglishTip();
|
|
89
|
+
}, 100);
|
|
90
|
+
};
|
|
91
|
+
const stopTimer = () => {
|
|
92
|
+
if (timer) {
|
|
93
|
+
clearInterval(timer);
|
|
94
|
+
timer = null;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
onMounted(() => {
|
|
98
|
+
startTimer();
|
|
99
|
+
nextTick(() => {
|
|
100
|
+
captchaInit();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
onUnmounted(() => {
|
|
104
|
+
stopTimer();
|
|
105
|
+
slidCaptchaManager.destroyTAC();
|
|
106
|
+
});
|
|
107
|
+
return (_ctx, _cache) => {
|
|
108
|
+
return openBlock(), createBlock(unref(FixedOverlay), { class: "captcha-overlay-slid" }, {
|
|
109
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
110
|
+
createElementVNode("div", { id: "captcha-box" }, null, -1)
|
|
111
|
+
])]),
|
|
112
|
+
_: 1
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
118
|
+
export {
|
|
119
|
+
index as default
|
|
120
|
+
};
|