mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复权限判断错误
This commit is contained in:
parent
d8f9622931
commit
bd976a7368
|
|
@ -20,7 +20,7 @@
|
|||
<span class="label">过期时间</span>
|
||||
<span
|
||||
>{{ licenseInfo?.expired || '-' }}
|
||||
<span class="danger" v-if="fromNowDate(licenseInfo?.expired)"
|
||||
<span class="danger" v-if="licenseInfo?.expired && fromNowDate(licenseInfo?.expired)"
|
||||
>({{ fromNowDate(licenseInfo?.expired) }})</span
|
||||
></span
|
||||
>
|
||||
|
|
@ -28,11 +28,14 @@
|
|||
<div class="flex">
|
||||
<span class="label">版本</span
|
||||
><span>{{
|
||||
licenseInfo?.edition ? EditionType[licenseInfo.edition as keyof typeof EditionType] : '-'
|
||||
licenseInfo?.edition
|
||||
? EditionType[licenseInfo.edition as keyof typeof EditionType]
|
||||
: '社区版'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<span class="label">版本号</span><span>{{ licenseInfo?.licenseVersion || '-' }}</span>
|
||||
<span class="label">版本号</span
|
||||
><span>{{ licenseInfo?.licenseVersion || user.version }}</span>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<span class="label">序列号</span><span>{{ licenseInfo?.serialNo || '-' }}</span>
|
||||
|
|
@ -41,7 +44,10 @@
|
|||
<span class="label">备注</span><span>{{ licenseInfo?.remark || '-' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="mt-16 flex align-center" v-hasPermission="new Role('ADMIN')">
|
||||
<div
|
||||
class="mt-16 flex align-center"
|
||||
v-hasPermission="new ComplexPermission(['ADMIN'], ['x-pack'], 'AND')"
|
||||
>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
action="#"
|
||||
|
|
@ -55,15 +61,13 @@
|
|||
<el-button class="border-primary ml-16" @click="toSupport">获取技术支持</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="text-center">{{ $t('layout.topbar.avatar.version') }}:{{ user.version }}</div> -->
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import licenseApi from '@/api/license'
|
||||
import { EditionType } from '@/enums/common'
|
||||
import { Role } from '@/utils/permission/type'
|
||||
import { ComplexPermission } from '@/utils/permission/type'
|
||||
import { fromNowDate } from '@/utils/time'
|
||||
import useStore from '@/stores'
|
||||
const { user } = useStore()
|
||||
|
|
@ -76,7 +80,10 @@ const loading = ref(false)
|
|||
const licenseInfo = ref<any>(null)
|
||||
|
||||
const open = () => {
|
||||
getLicenseInfo()
|
||||
if (user.isEnterprise()) {
|
||||
getLicenseInfo()
|
||||
}
|
||||
|
||||
aboutDialogVisible.value = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,10 +78,13 @@ const useUserStore = defineStore({
|
|||
async asyncGetProfile() {
|
||||
return new Promise((resolve, reject) => {
|
||||
UserApi.getProfile()
|
||||
.then((ok) => {
|
||||
.then(async (ok) => {
|
||||
this.version = ok.data?.version || '-'
|
||||
this.isXPack = ok.data?.IS_XPACK
|
||||
this.XPACK_LICENSE_IS_VALID = ok.data?.XPACK_LICENSE_IS_VALID
|
||||
if (this.isEnterprise()) {
|
||||
await this.theme()
|
||||
}
|
||||
resolve(ok)
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
@ -104,7 +107,6 @@ const useUserStore = defineStore({
|
|||
async profile() {
|
||||
return UserApi.profile().then(async (ok) => {
|
||||
this.userInfo = ok.data
|
||||
await this.theme()
|
||||
return this.asyncGetProfile()
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue