Skip to content

Commit

Permalink
[*] 提取 Footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Oct 6, 2024
1 parent 2b99976 commit 680b0c4
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 146 deletions.
73 changes: 73 additions & 0 deletions src/components/TheFooter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup lang="ts">
import { GitAlt } from '@vicons/fa'
import { onMounted, ref } from 'vue'
import { get } from '@/utils/request'
const gitHash = GIT_COMMITHASH
const nowYear = new Date().getFullYear()
const hitokoto_content = ref('Loading')
onMounted(async () => {
let rs
try {
rs = await get('https://v1.hitokoto.cn/', {})
} catch (e) {
hitokoto_content.value = '加载失败'
}
if (!rs) {
hitokoto_content.value = '加载失败'
return
}
// 一言
let content = rs.data.hitokoto
let from = rs.data.from
hitokoto_content.value = content + ' —— ' + from
})
</script>

<template>
<div style="margin: 15px">
<div style="text-align: center">
<n-alert type="default" style="font-size: 20px; display: inline-block">
<template #icon>
<i class="twa-sm twa-speech-balloon"></i>
</template>
{{ hitokoto_content }}
</n-alert>
<br />
<br />
<span style="text-align: center">
<a target="_blank" href="https://内网穿透.中国/">
<n-button text>内网穿透联盟[CFU]</n-button>
</a>
识别码:
<b>JRXHB5D4</b>
</span>
<br />
<span style="text-align: center">© {{ nowYear }} LoCyanTeam。保留所有权利。</span>
<br />
<span style="text-align: center">
<a target="_blank" href="https://www.locyan.cn/doc/yhfw.html"> 服务条款 </a>
|
<a target="_blank" href="https://www.locyan.cn/doc/yszc.html"> 隐私政策 </a>
|
<a target="_blank" href="https://github.com/LoCyan-Team/LoCyanFrpPanel">
<n-button text style="transform: translateY(4.5px)">
<template #icon>
<n-icon>
<git-alt />
</n-icon>
</template>
{{ gitHash }}
</n-button>
</a>
</span>
<br />
<br />
<span style="text-align: center"
>"Minecraft" 为美国微软公司的商标,本站与其没有任何从属关系</span
>
<br />
</div>
</div>
</template>
77 changes: 3 additions & 74 deletions src/components/nav/GuestNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,98 +32,27 @@
</router-view>
</div>
<n-divider></n-divider>
<div style="margin: 15px">
<div style="text-align: center">
<n-alert type="default" style="font-size: 20px; display: inline-block">
<template #icon>
<i class="twa-sm twa-speech-balloon"></i>
</template>
{{ hitokoto_content }}
</n-alert>
<br />
<br />
<span style="text-align: center">
<a target="_blank" href="https://内网穿透.中国/">
<n-button text>内网穿透联盟[CFU]</n-button>
</a>
识别码:
<b>JRXHB5D4</b>
</span>
<br />
<span style="text-align: center">
© {{ nowYear }} LoCyanTeam。保留所有权利。 |
<a target="_blank" href="https://github.com/LoCyan-Team/LoCyanFrpPanel">
<n-button text style="transform: translateY(4.5px)">
<template #icon>
<n-icon>
<git-alt />
</n-icon>
</template>
{{ gitHash }}
</n-button>
</a>
</span>
<br />
<span style="text-align: center">
<a target="_blank" href="https://www.locyan.cn/doc/yhfw.html"> 服务条款 </a>
|
<a target="_blank" href="https://www.locyan.cn/doc/yszc.html"> 隐私政策 </a>
</span>
<br />
<br />
<span style="text-align: center"
>"Minecraft" 为美国微软公司的商标,本站与其没有任何从属关系</span
>
<br />
</div>
</div>
<the-footer></the-footer>
</n-layout>
</n-layout>
</n-layout>
</n-space>
</template>

<script setup>
import { h, ref, onMounted } from 'vue'
import { ref } from 'vue'
import { NGradientText } from 'naive-ui'
import { GitAlt } from '@vicons/fa'
import GuestSidebar from '@components/sidebar/GuestSidebar.vue'
import TheFooter from '@components/TheFooter.vue'
import router from '@router'
import { get } from '@/utils/request'
const gitHash = GIT_COMMITHASH
const nowYear = new Date().getFullYear()
// 手机状态下收缩菜单栏
const collapsed = ref(true)
if (document.body.clientWidth >= 1000) {
collapsed.value = false
}
const hitokoto_content = ref('Loading')
function renderIcon(icon) {
return () => h(NIcon, null, { default: () => h(icon) })
}
const inverted = false
onMounted(async () => {
let rs
try {
rs = await get('https://v1.hitokoto.cn/', {})
} catch (e) {
hitokoto_content.value = '加载失败'
}
if (!rs) {
hitokoto_content.value = '加载失败'
return
}
// 一言
let content = rs.data.hitokoto
let from = rs.data.from
hitokoto_content.value = content + ' —— ' + from
})
</script>
<script>
import { ref } from 'vue'
Expand Down
78 changes: 6 additions & 72 deletions src/components/nav/MainNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,51 +71,7 @@
</router-view>
</div>
<n-divider></n-divider>
<div style="margin: 15px">
<div style="text-align: center">
<n-alert type="default" style="font-size: 20px; display: inline-block">
<template #icon>
<i class="twa-sm twa-speech-balloon"></i>
</template>
{{ hitokoto_content }}
</n-alert>
<br />
<br />
<span style="text-align: center">
<a target="_blank" href="https://内网穿透.中国/">
<n-button text>内网穿透联盟[CFU]</n-button>
</a>
识别码:
<b>JRXHB5D4</b>
</span>
<br />
<span style="text-align: center">
© {{ nowYear }} LoCyanTeam。保留所有权利。 |
<a target="_blank" href="https://github.com/LoCyan-Team/LoCyanFrpPanel">
<n-button text style="transform: translateY(4.5px)">
<template #icon>
<n-icon>
<git-alt />
</n-icon>
</template>
{{ gitHash }}
</n-button>
</a>
</span>
<br />
<span style="text-align: center">
<a target="_blank" href="https://www.locyan.cn/doc/yhfw.html"> 服务条款 </a>
|
<a target="_blank" href="https://www.locyan.cn/doc/yszc.html"> 隐私政策 </a>
</span>
<br />
<br />
<span style="text-align: center"
>"Minecraft" 为美国微软公司的商标,本站与其没有任何从属关系</span
>
<br />
</div>
</div>
<the-footer></the-footer>
</n-layout>
</n-layout>
</n-layout>
Expand All @@ -130,24 +86,20 @@
<script setup>
import { ref, onMounted } from 'vue'
import { NGradientText } from 'naive-ui'
import SideBar from '@components/sidebar/MainSidebar.vue'
import userData from '@/utils/stores/userData/store'
import router from '@router'
import TheFooter from '@components/TheFooter.vue'
import UserInfo, { changeUserInfoShow } from '@components/UserInfo.vue'
import { get } from '@/utils/request'
import { GitAlt } from '@vicons/fa'
import SideBar from '@components/sidebar/MainSidebar.vue'
import { MdNotifications } from '@vicons/ionicons4'
import logger from '@/utils/logger'
import notice from '@/utils/notice'
const gitHash = GIT_COMMITHASH
const nowYear = new Date().getFullYear()
import { useRoute } from 'vue-router'
// 手机状态下收缩菜单栏
const collapsed = ref(true)
const avatar = ref('')
const inverted = false
const hitokoto_content = ref('Loading')
const route = useRoute()
if (document.body.clientWidth >= 1000) {
collapsed.value = false
Expand Down Expand Up @@ -189,25 +141,7 @@ function getStyle() {
}
}
if (location.pathname === '/') window.location = '/dashboard'
onMounted(async () => {
let rs
try {
rs = await get('https://v1.hitokoto.cn/', {})
} catch (e) {
logger.error(e)
hitokoto_content.value = '加载失败'
}
if (!rs) {
hitokoto_content.value = '加载失败'
return
}
// 一言
let content = rs.data.hitokoto
let from = rs.data.from
hitokoto_content.value = content + ' —— ' + from
})
if (route.path === '/') router.push('/dashboard')
</script>

<script>
Expand Down

0 comments on commit 680b0c4

Please sign in to comment.