mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-25 01:59:49 +08:00
feat: add COPYRIGHT (#183)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
<script setup>
|
||||
import { darkTheme, NGlobalStyle, zhCN } from 'naive-ui'
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { useDark, useToggle } from '@vueuse/core'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useGlobalState } from './store'
|
||||
import { useIsMobile } from './utils/composables'
|
||||
import Header from './views/Header.vue';
|
||||
import Footer from './views/Footer.vue';
|
||||
|
||||
|
||||
const { localeCache, isDark, loading } = useGlobalState()
|
||||
const theme = computed(() => isDark.value ? darkTheme : null)
|
||||
@@ -42,8 +43,11 @@ onMounted(async () => {
|
||||
<n-gi :span="isMobile ? 12 : 10">
|
||||
<div class="main">
|
||||
<n-space vertical>
|
||||
<Header />
|
||||
<router-view></router-view>
|
||||
<n-layout style="min-height: 80vh;">
|
||||
<Header />
|
||||
<router-view></router-view>
|
||||
</n-layout>
|
||||
<Footer />
|
||||
</n-space>
|
||||
</div>
|
||||
</n-gi>
|
||||
|
||||
@@ -49,7 +49,7 @@ const apiFetch = async (path, options = {}) => {
|
||||
const getOpenSettings = async (message) => {
|
||||
try {
|
||||
const res = await api.fetch("/open_api/settings");
|
||||
openSettings.value = {
|
||||
Object.assign(openSettings.value, {
|
||||
prefix: res["prefix"] || "",
|
||||
needAuth: res["needAuth"] || false,
|
||||
domains: res["domains"].map((domain) => {
|
||||
@@ -62,7 +62,8 @@ const getOpenSettings = async (message) => {
|
||||
enableUserCreateEmail: res["enableUserCreateEmail"] || false,
|
||||
enableUserDeleteEmail: res["enableUserDeleteEmail"] || false,
|
||||
enableAutoReply: res["enableAutoReply"] || false,
|
||||
};
|
||||
copyright: res["copyright"] || openSettings.value.copyright,
|
||||
});
|
||||
if (openSettings.value.needAuth) {
|
||||
showAuth.value = true;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ export const useGlobalState = createGlobalState(
|
||||
enableUserCreateEmail: false,
|
||||
enableUserDeleteEmail: false,
|
||||
enableAutoReply: false,
|
||||
domains: []
|
||||
domains: [],
|
||||
copyright: 'Dream Hunter',
|
||||
})
|
||||
const settings = ref({
|
||||
fetched: false,
|
||||
|
||||
38
frontend/src/views/Footer.vue
Normal file
38
frontend/src/views/Footer.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<script setup>
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useGlobalState } from '../store'
|
||||
const { localeCache, openSettings } = useGlobalState()
|
||||
|
||||
|
||||
const { t } = useI18n({
|
||||
locale: localeCache.value || 'zh',
|
||||
messages: {
|
||||
en: {
|
||||
copyright: "Copyright"
|
||||
},
|
||||
zh: {
|
||||
copyright: "版权所有"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<n-divider class="footer-divider" />
|
||||
<div style="text-align: center; padding: 20px">
|
||||
<n-text depth="3">
|
||||
{{ t('copyright') }} © 2023-{{ new Date().getFullYear() }} {{ openSettings.copyright }}
|
||||
</n-text>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.footer-divider {
|
||||
margin: 0;
|
||||
padding: 0 var(--x-padding);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user