File tree Expand file tree Collapse file tree
.vitepress/theme/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const runLoop = () => {
2525 timers .push (
2626 setTimeout (() => {
2727 phase .value = ' fade'
28- }, 6200 )
28+ }, 5800 )
2929 )
3030 timers .push (
3131 setTimeout (() => {
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ layout: home
66import { onMounted } from ' vue'
77import { withBase } from ' vitepress'
88
9+ const WELCOME_SEEN_KEY = ' easy-vibe-welcome-seen'
10+
911onMounted (() => {
1012 // 语言映射:浏览器语言代码 -> 网站路径
1113 const langMap = {
@@ -44,8 +46,23 @@ onMounted(() => {
4446 targetLang = ' /zh-cn/'
4547 }
4648
49+ const targetPath = withBase (targetLang)
50+ let hasSeenWelcome = false
51+ try {
52+ hasSeenWelcome = window .localStorage .getItem (WELCOME_SEEN_KEY ) === ' 1'
53+ } catch {
54+ hasSeenWelcome = false
55+ }
56+
57+ if (! hasSeenWelcome) {
58+ window .location .replace (
59+ withBase (` /welcome/?next=${ encodeURIComponent (targetPath)} ` )
60+ )
61+ return
62+ }
63+
4764 // 立即跳转,不显示任何内容
4865 // 使用 withBase 自动处理 base 路径(根据 config.mjs 中的配置)
49- window .location .replace (withBase (targetLang) )
66+ window .location .replace (targetPath )
5067})
5168</script >
You can’t perform that action at this time.
0 commit comments