diff --git a/CHANGELOG.md b/CHANGELOG.md index 0270368..c626262 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 🎉🎉🔥 `vue-next-admin` 基于 vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支) +## 2.4.1 + +`2022.11.30` + +- 🎉 新增 版本升级提示 +- 🐞 修复 [先打开 F12 再登录进去,然后改变浏览器大小 js 报错](https://gitee.com/lyt-top/vue-next-admin/issues/I63ZZT),感谢[@Quber](https://gitee.com/quber) + ## 2.4.0 `2022.11.29` diff --git a/package.json b/package.json index 54b11a3..6997bc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-next-admin", - "version": "2.4.0", + "version": "2.4.1", "description": "vue3 vite next admin template", "author": "lyt_20201208", "license": "MIT", diff --git a/src/App.vue b/src/App.vue index 1d4cfc9..f83735f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,6 +4,7 @@ + @@ -23,6 +24,7 @@ import setIntroduction from '/@/utils/setIconfont'; const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index.vue')); const Setings = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/setings.vue')); const CloseFull = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/closeFull.vue')); +const Upgrade = defineAsyncComponent(() => import('/@/layout/upgrade/index.vue')); // 定义变量内容 const { messages, locale } = useI18n(); @@ -32,6 +34,15 @@ const stores = useTagsViewRoutes(); const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); +// 获取版本号 +const getVersion = computed(() => { + let isVersion = false; + if (route.path !== '/login') { + // @ts-ignore + if ((Local.get('version') && Local.get('version') !== __VERSION__) || !Local.get('version')) isVersion = true; + } + return isVersion; +}); // 获取全局组件大小 const getGlobalComponentSize = computed(() => { return other.globalComponentSize(); diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index b1de5a2..5cad04b 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -180,4 +180,12 @@ export default { copyTextSuccess: 'Copy succeeded!', copyTextError: 'Copy failed!', }, + upgrade: { + title: 'New version', + msg: 'The new version is available, please update it now! Dont worry, the update is fast!', + desc: 'Prompt: Update will restore the default configuration', + btnOne: 'Cruel refusal', + btnTwo: 'Update now', + btnTwoLoading: 'Updating', + }, }; diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index 3656b19..730c559 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -180,4 +180,12 @@ export default { copyTextSuccess: '复制成功!', copyTextError: '复制失败!', }, + upgrade: { + title: '新版本升级', + msg: '新版本来啦,马上更新尝鲜吧!不用担心,更新很快的哦!', + desc: '提示:更新会还原默认配置', + btnOne: '残忍拒绝', + btnTwo: '马上更新', + btnTwoLoading: '更新中', + }, }; diff --git a/src/i18n/lang/zh-tw.ts b/src/i18n/lang/zh-tw.ts index 1508b8a..63c5d44 100644 --- a/src/i18n/lang/zh-tw.ts +++ b/src/i18n/lang/zh-tw.ts @@ -180,4 +180,12 @@ export default { copyTextSuccess: '複製成功!', copyTextError: '複製失敗!', }, + upgrade: { + title: '新版本陞級', + msg: '新版本來啦,馬上更新嘗鮮吧! 不用擔心,更新很快的哦!', + desc: '提示:更新會還原默認配寘', + btnOne: '殘忍拒絕', + btnTwo: '馬上更新', + btnTwoLoading: '更新中', + }, }; diff --git a/src/layout/navBars/breadcrumb/setings.vue b/src/layout/navBars/breadcrumb/setings.vue index 31ce150..c59d20a 100644 --- a/src/layout/navBars/breadcrumb/setings.vue +++ b/src/layout/navBars/breadcrumb/setings.vue @@ -619,6 +619,8 @@ const onCopyConfigClick = () => { const onResetConfigClick = () => { Local.clear(); window.location.reload(); + // @ts-ignore + Local.set('version', __VERSION__); }; // 初始化菜单样式等 const initSetStyle = () => { diff --git a/src/layout/upgrade/index.vue b/src/layout/upgrade/index.vue new file mode 100644 index 0000000..890c070 --- /dev/null +++ b/src/layout/upgrade/index.vue @@ -0,0 +1,138 @@ + + + + + diff --git a/src/stores/themeConfig.ts b/src/stores/themeConfig.ts index 171af98..65ca13c 100644 --- a/src/stores/themeConfig.ts +++ b/src/stores/themeConfig.ts @@ -91,11 +91,11 @@ export const useThemeConfig = defineStore('themeConfig', { // 是否开启 Footer 底部版权信息 isFooter: true, // 是否开启灰色模式 - isGrayscale: false, + isGrayscale: true, // 是否开启色弱模式 isInvert: false, // 是否开启水印 - isWartermark: true, + isWartermark: false, // 水印文案 wartermarkText: 'vue-next-admin', diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 5094743..d351e1e 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -66,7 +66,7 @@