feat:添加域名检查提示

This commit is contained in:
zyronon
2025-07-11 20:26:33 +08:00
parent a179710ba2
commit 627107d930
4 changed files with 4410 additions and 3527 deletions

1
components.d.ts vendored
View File

@@ -44,6 +44,7 @@ declare module 'vue' {
Empty: typeof import('./src/components/Empty.vue')['default']
FeedbackModal: typeof import('./src/components/toolbar/FeedbackModal.vue')['default']
Fireworks: typeof import('./src/components/Fireworks.vue')['default']
HostNotice: typeof import('./src/components/HostNotice.vue')['default']
IconWrapper: typeof import('./src/components/IconWrapper.vue')['default']
Input: typeof import('./src/components/Input.vue')['default']
List: typeof import('./src/components/list/List.vue')['default']

7794
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@ import CollectNotice from "@/components/CollectNotice.vue";
import {SAVE_SETTING_KEY, SAVE_DICT_KEY} from "@/utils/const.ts";
import {shakeCommonDict} from "@/utils";
import router from "@/router.ts";
import HostNotice from "@/components/HostNotice.vue";
const store = useBaseStore()
const runtimeStore = useRuntimeStore()
@@ -83,6 +84,7 @@ onMounted(() => {
<Backgorund/>
<router-view/>
<CollectNotice/>
<HostNotice/>
<ArticleContentDialog/>
<SettingDialog/>
</template>

View File

@@ -0,0 +1,140 @@
<script setup lang="ts">
import BaseButton from "@/components/BaseButton.vue";
import {watch} from "vue";
import {useSettingStore} from "@/stores/setting.ts";
let settingStore = useSettingStore()
let show = $ref(false)
function toggleNotice() {
show = false
}
watch(() => settingStore.load, (n) => {
const params = new URLSearchParams(window.location.search);
if (params.get('from') === 'redirect') {
show = true
}
})
</script>
<template>
<transition name="right">
<div class="HostNotice" v-if="show">
<div class="notice">
<div>检查到您是通过老域名 typing-word.ttentau.top 访问的本网站特此弹窗提示</div>
<p>老域名已不再续费7天后过期将无法访问请更换为新域名 <span class="active"><a href="https://2study.top">2study.top</a></span>
访问</p>
</div>
<div class="wrapper">
<BaseButton size="large" @click="toggleNotice">关闭</BaseButton>
</div>
</div>
</transition>
</template>
<style scoped lang="scss">
.right-enter-active,
.right-leave-active {
transition: all .5s ease;
}
.right-enter-from,
.right-leave-to {
transform: translateX(110%);
}
.HostNotice {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 2;
font-size: 20rem;
display: flex;
flex-direction: column;
align-items: center;
background: var(--color-second-bg);
padding: 30rem;
border-radius: 12rem;
width: 500rem;
color: var(--color-font-1);
line-height: 1.5;
border: 1px solid var(--color-item-border);
box-shadow: var(--shadow);
.notice {
margin-top: 30rem;
}
.active {
color: var(--color-main-active);
}
.wrapper {
.collect {
display: flex;
flex-direction: column;
align-items: center;
.href-wrapper {
display: flex;
font-size: 16rem;
align-items: center;
gap: 10rem;
.round {
color: var(--color-font-1);
border-radius: 50rem;
padding: 10rem 10rem;
padding-left: 20rem;
gap: 30rem;
display: flex;
align-items: center;
justify-content: space-between;
background: var(--color-main-bg);
.href {
font-size: 14rem;
}
}
.star {
color: var(--color-main-active);
}
.right {
display: flex;
align-items: center;
}
}
.collect-keyboard {
margin-top: 20rem;
font-size: 16rem;
span {
margin-left: 10rem;
}
}
}
}
.close-wrapper {
right: var(--space);
top: var(--space);
position: absolute;
font-size: 14rem;
display: flex;
justify-content: flex-end;
align-items: center;
color: var(--color-font-1);
gap: 10rem;
}
}
</style>