fix: 修改登录页跳转问题 (#4487)

This commit is contained in:
ssongliu 2024-04-12 16:20:07 +08:00 committed by GitHub
parent 9edafc13a3
commit 62bead5c50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 15 additions and 10 deletions

View file

@ -1489,6 +1489,7 @@ const message = {
}, },
license: { license: {
community: 'Community Edition: ', community: 'Community Edition: ',
community2: 'Community Edition',
pro: 'Professional Edition: ', pro: 'Professional Edition: ',
trial: 'Trial Edition', trial: 'Trial Edition',
office: 'Official Edition', office: 'Official Edition',
@ -1514,6 +1515,7 @@ const message = {
advice: 'Consultation', advice: 'Consultation',
indefinitePeriod: 'Indefinite Period', indefinitePeriod: 'Indefinite Period',
levelUpPro: 'Upgrade to Professional Edition', levelUpPro: 'Upgrade to Professional Edition',
licenseSync: 'License Sync',
knowMorePro: 'Learn More', knowMorePro: 'Learn More',
closeAlert: 'The current page can be closed in the panel settings', closeAlert: 'The current page can be closed in the panel settings',
introduce: 'Feature Introduction', introduce: 'Feature Introduction',

View file

@ -1388,6 +1388,7 @@ const message = {
}, },
license: { license: {
community: '社區版', community: '社區版',
community2: '社區版',
pro: '專業版', pro: '專業版',
trial: '試用版', trial: '試用版',
office: '正式版', office: '正式版',
@ -1412,6 +1413,7 @@ const message = {
advice: '諮詢', advice: '諮詢',
indefinitePeriod: '無限期', indefinitePeriod: '無限期',
levelUpPro: '升級專業版', levelUpPro: '升級專業版',
licenseSync: '許可證同步',
knowMorePro: '了解更多', knowMorePro: '了解更多',
closeAlert: '當前頁面可在面板設置中關閉顯示', closeAlert: '當前頁面可在面板設置中關閉顯示',
introduce: '功能介紹', introduce: '功能介紹',

View file

@ -1389,6 +1389,7 @@ const message = {
}, },
license: { license: {
community: '社区版', community: '社区版',
community2: '社区版',
pro: '专业版', pro: '专业版',
trial: '试用版', trial: '试用版',
office: '正式版', office: '正式版',
@ -1413,6 +1414,7 @@ const message = {
advice: '咨询', advice: '咨询',
indefinitePeriod: '无限期', indefinitePeriod: '无限期',
levelUpPro: '升级专业版', levelUpPro: '升级专业版',
licenseSync: '许可证同步',
knowMorePro: '了解更多', knowMorePro: '了解更多',
closeAlert: '当前页面可在面板设置中关闭显示', closeAlert: '当前页面可在面板设置中关闭显示',
introduce: '功能介绍', introduce: '功能介绍',

View file

@ -13,7 +13,7 @@ router.beforeEach((to, from, next) => {
if (to.name !== 'entrance' && !globalStore.isLogin) { if (to.name !== 'entrance' && !globalStore.isLogin) {
next({ next({
name: 'entrance', name: 'entrance',
params: { code: globalStore.entrance }, params: to.params,
}); });
NProgress.done(); NProgress.done();
return; return;

View file

@ -32,7 +32,7 @@ const screenWidth = ref(null);
const getStatus = async () => { const getStatus = async () => {
const res = await checkIsSafety(globalStore.entrance); const res = await checkIsSafety(globalStore.entrance);
if (res.data === 'unpass') { if (res.data === 'unpass') {
router.replace({ name: 'entrance', params: { code: 0 } }); router.replace({ name: 'entrance', params: { code: globalStore.entrance } });
} }
}; };

View file

@ -4,7 +4,7 @@
<template #main> <template #main>
<el-row :gutter="20" class="mt-5; mb-10"> <el-row :gutter="20" class="mt-5; mb-10">
<el-col :xs="24" :sm="24" :md="15" :lg="15" :xl="15"> <el-col :xs="24" :sm="24" :md="15" :lg="15" :xl="15">
<div class="descriptions" v-if="hasLicense()"> <div class="descriptions" v-if="hasLicense">
<el-descriptions :column="1" direction="horizontal" size="large" border> <el-descriptions :column="1" direction="horizontal" size="large" border>
<el-descriptions-item :label="$t('license.authorizationId')"> <el-descriptions-item :label="$t('license.authorizationId')">
{{ license.licenseName || '-' }} {{ license.licenseName || '-' }}
@ -48,7 +48,7 @@
</el-descriptions> </el-descriptions>
</div> </div>
<CardWithHeader :header="$t('home.overview')" height="160px" v-if="!hasLicense()"> <CardWithHeader :header="$t('home.overview')" height="160px" v-if="!hasLicense">
<template #body> <template #body>
<div class="h-app-card"> <div class="h-app-card">
<el-row> <el-row>
@ -56,7 +56,7 @@
<span>{{ $t('setting.license') }}</span> <span>{{ $t('setting.license') }}</span>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<span>{{ $t('license.community') }}</span> <span>{{ $t('license.community2') }}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -113,6 +113,7 @@ import { GlobalStore } from '@/store';
const loading = ref(); const loading = ref();
const licenseRef = ref(); const licenseRef = ref();
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const hasLicense = ref();
const license = reactive({ const license = reactive({
licenseName: '', licenseName: '',
@ -165,9 +166,11 @@ const search = async () => {
license.status = res.data.status; license.status = res.data.status;
globalStore.isProductPro = globalStore.isProductPro =
res.data.status === 'Enable' || res.data.status === 'Lost01' || res.data.status === 'Lost02'; res.data.status === 'Enable' || res.data.status === 'Lost01' || res.data.status === 'Lost02';
if (!globalStore.isProductPro || res.data.status === 'Lost03') { if (res.data.status === '') {
hasLicense.value = false;
return; return;
} }
hasLicense.value = true;
if (globalStore.isProductPro) { if (globalStore.isProductPro) {
globalStore.productProExpires = Number(res.data.productPro); globalStore.productProExpires = Number(res.data.productPro);
} }
@ -187,10 +190,6 @@ const search = async () => {
}); });
}; };
const hasLicense = () => {
return globalStore.isProductPro;
};
const showSync = () => { const showSync = () => {
return license.status.indexOf('Lost') !== -1 || license.status === 'Disable'; return license.status.indexOf('Lost') !== -1 || license.status === 'Disable';
}; };