From 1ca85735058dbb6be824108f1a9635868db79492 Mon Sep 17 00:00:00 2001
From: Double-_-Z <2492419643@qq.com>
Date: Mon, 18 Nov 2024 15:59:53 +0800
Subject: [PATCH] =?UTF-8?q?log=E3=80=81=E5=90=8D=E7=A7=B0=E3=80=81?=
=?UTF-8?q?=E5=BA=95=E6=A0=8F=E8=87=AA=E5=AE=9A=E4=B9=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 9 +++
src/i18n/lang/en.ts | 4 ++
src/i18n/lang/zh-cn.ts | 4 ++
src/i18n/lang/zh-tw.ts | 4 ++
src/layout/footer/index.vue | 11 ++-
src/layout/logo/index.vue | 4 +-
src/layout/navBars/topBar/setings.vue | 100 +++++++++++++++++++++++++-
src/stores/themeConfig.ts | 6 ++
src/types/pinia.d.ts | 3 +
9 files changed, 137 insertions(+), 8 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index 8007417..eec7b04 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -20,6 +20,7 @@ import other from '/@/utils/other';
import { Local, Session } from '/@/utils/storage';
import mittBus from '/@/utils/mitt';
import setIntroduction from '/@/utils/setIconfont';
+import logoMini from '/@/assets/logo-mini.svg';
// 引入组件
const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index.vue'));
@@ -59,6 +60,14 @@ const getGlobalComponentSize = computed(() => {
const getGlobalI18n = computed(() => {
return messages.value[locale.value];
});
+
+// 动态设置网站图标
+let link: any = document.querySelector("link[rel*='icon']") || document.createElement("link");
+link.type = "image/x-icon";
+link.rel = "shortcut icon";
+link.href = themeConfig.logoMini||logoMini;
+document.getElementsByTagName("head")[0].appendChild(link);
+
// 设置初始化,防止刷新时恢复默认
onBeforeMount(() => {
// 设置批量第三方 icon 图标
diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts
index b035c38..20d5bbd 100644
--- a/src/i18n/lang/en.ts
+++ b/src/i18n/lang/en.ts
@@ -170,6 +170,10 @@ export default {
fourIsDark: 'Dark Mode',
fourIsWartermark: 'Turn on watermark',
fourWartermarkText: 'Watermark copy',
+ logoTitle: 'Logo title',
+ footTitle: 'Foot title',
+ footTip: 'Foot tip',
+ logoSetting: 'Logo setting',
fiveTitle: 'Other settings',
fiveTagsStyle: 'Tagsview style',
fiveAnimation: 'page animation',
diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts
index 8719692..56e3674 100644
--- a/src/i18n/lang/zh-cn.ts
+++ b/src/i18n/lang/zh-cn.ts
@@ -170,6 +170,10 @@ export default {
fourIsDark: '深色模式',
fourIsWartermark: '开启水印',
fourWartermarkText: '水印文案',
+ logoTitle: 'Logo名称',
+ footTitle: '页脚版权说明',
+ logoSetting: 'Logo设置',
+ footTip: '页脚Tip',
fiveTitle: '其它设置',
fiveTagsStyle: 'Tagsview 风格',
fiveAnimation: '主页面切换动画',
diff --git a/src/i18n/lang/zh-tw.ts b/src/i18n/lang/zh-tw.ts
index cf32a65..de761a0 100644
--- a/src/i18n/lang/zh-tw.ts
+++ b/src/i18n/lang/zh-tw.ts
@@ -170,6 +170,10 @@ export default {
fourIsDark: '深色模式',
fourIsWartermark: '開啟浮水印',
fourWartermarkText: '浮水印文案',
+ logoTitle: 'Logo 標題',
+ footTitle: '頁腳版權說明',
+ footTip: '頁腳tip',
+ logoSetting: 'Logo 配置',
fiveTitle: '其它設定',
fiveTagsStyle: 'Tagsview 風格',
fiveAnimation: '主頁面切換動畫',
diff --git a/src/layout/footer/index.vue b/src/layout/footer/index.vue
index 97cffbf..cd58efb 100644
--- a/src/layout/footer/index.vue
+++ b/src/layout/footer/index.vue
@@ -1,14 +1,19 @@
diff --git a/src/stores/themeConfig.ts b/src/stores/themeConfig.ts
index 3e8e683..364167b 100644
--- a/src/stores/themeConfig.ts
+++ b/src/stores/themeConfig.ts
@@ -105,6 +105,10 @@ export const useThemeConfig = defineStore('themeConfig', {
isWartermark: true,
// 水印文案
wartermarkText: 'vue-next-admin',
+ // 页脚版权信息内容
+ globalFootTitleMsg: '深圳市 xxx 公司版权所有',
+ // 页脚tip
+ globalFootTipMsg: 'vue-next-admin,Made by lyt with ❤️',
/**
* 其它设置
@@ -146,6 +150,8 @@ export const useThemeConfig = defineStore('themeConfig', {
globalI18n: 'zh-cn',
// 默认全局组件大小,可选值"",默认 'large'
globalComponentSize: 'large',
+ // 网站logo
+ logoMini: '/@/assets/logo-mini.svg',
},
}),
actions: {
diff --git a/src/types/pinia.d.ts b/src/types/pinia.d.ts
index f7c32ad..5d57588 100644
--- a/src/types/pinia.d.ts
+++ b/src/types/pinia.d.ts
@@ -77,6 +77,8 @@ declare interface ThemeConfigState {
isIsDark: boolean;
isWartermark: boolean;
wartermarkText: string;
+ globalFootTitleMsg: string;
+ globalFootTipMsg: string;
tagsStyle: string;
animation: string;
columnsAsideStyle: string;
@@ -88,5 +90,6 @@ declare interface ThemeConfigState {
globalViceTitleMsg: string;
globalI18n: string;
globalComponentSize: string;
+ logoMini: string;
};
}