fix the
This commit is contained in:
1 parent
40f5066586
commit
a20f3a423c
2 files changed
+8
-3
No files matched your search
@@ -21,3 +21,4 @@ src/Jiaowu.Api/wwwroot/
|
||||
certs/
|
||||
publish/
|
||||
tools/Jiaowu.LicenseTool/
|
||||
/license-keys/
|
||||
+7
-3
@@ -8,12 +8,14 @@ import SmartLaunchScreen from './components/SmartLaunchScreen.vue'
|
||||
import { currentLocale } from './i18n'
|
||||
import http from './api/http'
|
||||
const route = useRoute()
|
||||
const licenseExpired = ref(false)
|
||||
const licenseNotice = ref<'unlicensed' | 'expired' | 'machine-mismatch' | null>(null)
|
||||
let licenseTimer: ReturnType<typeof setInterval> | undefined
|
||||
async function refreshLicenseStatus() {
|
||||
try {
|
||||
const { data } = await http.get('/licenses/status')
|
||||
licenseExpired.value = Boolean(data.isExpired)
|
||||
if (data.isExpired) licenseNotice.value = 'expired'
|
||||
else if (!data.isLicensed) licenseNotice.value = data.expiresAt ? 'machine-mismatch' : 'unlicensed'
|
||||
else licenseNotice.value = null
|
||||
} catch { /* preserve the app when status is temporarily unavailable */ }
|
||||
}
|
||||
onMounted(() => {
|
||||
@@ -29,7 +31,9 @@ const elementLocale = computed(() => currentLocale.value === 'en-US' ? en : zhCn
|
||||
<el-config-provider :locale="elementLocale">
|
||||
<SmartLaunchScreen />
|
||||
<RouterView />
|
||||
<div v-if="licenseExpired" class="license-expired-notice" role="status">系统授权已过期,请联系超级管理员处理。</div>
|
||||
<div v-if="licenseNotice" class="license-expired-notice" role="status">
|
||||
{{ licenseNotice === 'expired' ? '系统授权已过期,请联系超级管理员处理。' : licenseNotice === 'machine-mismatch' ? '系统授权与当前机器不匹配,请联系超级管理员处理。' : '系统尚未激活,请联系超级管理员处理。' }}
|
||||
</div>
|
||||
<SiteFooter v-if="!isVenueDisplay" />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
Reference in new issue
Block a user