feat: 新增License过期提示

This commit is contained in:
wangdan-fit2cloud 2024-07-10 18:04:38 +08:00
parent 9b1a384a44
commit 18e9d2182c
3 changed files with 24 additions and 1 deletions

View File

@ -1,5 +1,13 @@
·
<template>
<el-alert
v-if="user.isExpire()"
title="未上传 License 或 License 已过期。"
type="warning"
class="border-b"
show-icon
:closable="false"
/>
<div class="top-bar-container border-b flex-between">
<div class="flex-center h-full">
<div class="app-title-container cursor" @click="router.push('/')">
@ -63,8 +71,10 @@ import Avatar from './avatar/index.vue'
import { useRouter } from 'vue-router'
import { langList } from '@/locales/index'
import { useLocale } from '@/locales/useLocale'
import useStore from '@/stores'
const router = useRouter()
const defaultTitle = import.meta.env.VITE_APP_TITLE
const { user } = useStore()
const { changeLocale } = useLocale()
const changeLang = (lang: string) => {

View File

@ -23,6 +23,9 @@ const useUserStore = defineStore({
isXPack: false
}),
actions: {
isExpire() {
return this.isXPack && !this.XPACK_LICENSE_IS_VALID
},
isEnterprise() {
return this.isXPack && this.XPACK_LICENSE_IS_VALID
},

View File

@ -361,3 +361,13 @@
line-height: 30px;
}
}
// 提示横幅
.el-alert--warning.is-light {
background-color: #ffe7cc;
color: var(--app-text-color);
font-weight: 400;
.el-alert__icon {
color: #ff8800;
}
}