vue-layout-gitcode 1.10.8 → 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-DKCXfZGU.js → GloabarSearch-ExbtF8-g.js} +3 -3
- package/{MenuItem-5nvII1-H.js → MenuItem-BAw5BtBb.js} +1 -1
- package/{ProjectMenuList-D4XsZQj3.js → ProjectMenuList-Ce9S11ma.js} +2 -2
- package/{ProjectMenuListV2-J07632cN.js → ProjectMenuListV2-BIFEaq9E.js} +2 -2
- package/{ProjectSearch-BySngJUv.js → ProjectSearch-BaW9j7jM.js} +1 -1
- package/{SearchHistoryList-CHdkZ8FO.js → SearchHistoryList-BHpQc4do.js} +1 -1
- package/{SearchPrefixTag-DP1LYFTn.js → SearchPrefixTag-DE_FH3nS.js} +1 -1
- package/{SearchRecommed-CvDllUte.js → SearchRecommed-CuExGAND.js} +2 -2
- package/{SearchScopeList-BmfJjVtL.js → SearchScopeList-CBc-RbqA.js} +1 -1
- package/{UserSearch-BzW_dJiy.js → UserSearch-B9f_e7lG.js} +1 -1
- package/{index-Br3aHHVv.js → index-B-WQyJsC.js} +2 -5
- package/index-B6hVcI95.js +120 -0
- package/{index-0KJy9paC.js → index-DOhUtX7C.js} +886 -136
- package/{index-B8XBtYoE.js → index-u2_TEztk.js} +2 -2
- package/index.js +12 -12
- package/{notice-Bm6PXt-o.js → notice-BM-9d-tw.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/{transWebUrl-CXAIc112.js → transWebUrl-g9vRctZr.js} +1 -1
- package/index-B5_lp60l.js +0 -101
package/index-B5_lp60l.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
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-0KJy9paC.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 = () => {
|
|
15
|
-
if (!window.initTAC) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const baseURL = useLayoutConfig().VITE_API_HOST;
|
|
19
|
-
const config = {
|
|
20
|
-
requestCaptchaDataUrl: `${baseURL}/uc/api/v1/captcha/gen`,
|
|
21
|
-
validCaptchaUrl: `${baseURL}/uc/api/v1/captcha/check`,
|
|
22
|
-
bindEl: "#captcha-box",
|
|
23
|
-
validSuccess: (res, c, tac) => {
|
|
24
|
-
stopTimer();
|
|
25
|
-
tac.destroyWindow();
|
|
26
|
-
emits("success", res.data);
|
|
27
|
-
},
|
|
28
|
-
validFail: (res, c, tac) => {
|
|
29
|
-
tac.reloadCaptcha();
|
|
30
|
-
stopTimer();
|
|
31
|
-
startTimer();
|
|
32
|
-
},
|
|
33
|
-
btnRefreshFun: (el, tac) => {
|
|
34
|
-
tac.reloadCaptcha();
|
|
35
|
-
stopTimer();
|
|
36
|
-
startTimer();
|
|
37
|
-
},
|
|
38
|
-
btnCloseFun: (el, tac) => {
|
|
39
|
-
stopTimer();
|
|
40
|
-
tac.destroyWindow();
|
|
41
|
-
emits("close");
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const style = {
|
|
45
|
-
logoUrl: null
|
|
46
|
-
// 去除logo
|
|
47
|
-
};
|
|
48
|
-
window.initTAC("https://cdn-static.gitcode.com/js/tac/", config, style).then((tac) => {
|
|
49
|
-
tac.init();
|
|
50
|
-
}).then(() => {
|
|
51
|
-
replaceEnglishTip();
|
|
52
|
-
}).catch((e) => {
|
|
53
|
-
console.error("初始化tac失败", e);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
const replaceEnglishTip = () => {
|
|
57
|
-
if (isZh) return false;
|
|
58
|
-
const tipDom = document.querySelector("#captcha-box #tianai-captcha-click-track-font");
|
|
59
|
-
if (tipDom && tipDom.textContent !== TARGET_TEXT) {
|
|
60
|
-
tipDom.textContent = TARGET_TEXT;
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
if (tipDom && tipDom.textContent === TARGET_TEXT) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
};
|
|
68
|
-
const startTimer = () => {
|
|
69
|
-
if (isZh) return;
|
|
70
|
-
stopTimer();
|
|
71
|
-
timer = window.setInterval(() => {
|
|
72
|
-
replaceEnglishTip();
|
|
73
|
-
}, 100);
|
|
74
|
-
};
|
|
75
|
-
const stopTimer = () => {
|
|
76
|
-
if (timer) {
|
|
77
|
-
clearInterval(timer);
|
|
78
|
-
timer = null;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
onMounted(() => {
|
|
82
|
-
startTimer();
|
|
83
|
-
captchaInit();
|
|
84
|
-
});
|
|
85
|
-
onUnmounted(() => {
|
|
86
|
-
stopTimer();
|
|
87
|
-
});
|
|
88
|
-
return (_ctx, _cache) => {
|
|
89
|
-
return openBlock(), createBlock(unref(FixedOverlay), { class: "captcha-overlay" }, {
|
|
90
|
-
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
91
|
-
createElementVNode("div", { id: "captcha-box" }, null, -1)
|
|
92
|
-
])]),
|
|
93
|
-
_: 1
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
99
|
-
export {
|
|
100
|
-
index as default
|
|
101
|
-
};
|