perf: 优化系统设置加载时机

This commit is contained in:
xiaojunnuo
2024-10-12 14:59:12 +08:00
parent 38be8d84b2
commit 73962536d5
16 changed files with 171 additions and 185 deletions
@@ -5,7 +5,7 @@
</template>
<div class="p-10">
<a-descriptions title="" bordered>
<a-descriptions-item label="用户名">{{ userInfo.userInfoname }}</a-descriptions-item>
<a-descriptions-item label="用户名">{{ userInfo.username }}</a-descriptions-item>
<a-descriptions-item label="昵称">{{ userInfo.nickName }}</a-descriptions-item>
<a-descriptions-item label="邮箱">{{ userInfo.email }}</a-descriptions-item>
<a-descriptions-item label="手机号">{{ userInfo.phoneCode }}{{ userInfo.mobile }}</a-descriptions-item>
@@ -6,7 +6,7 @@
</div>
</div>
<p class="d2-page-cover__sub-title">{{ siteInfo.slogan }}</p>
<div v-if="siteInfo.warningOff !== true && settingStore.siteEnv?.agent?.enabled === false" class="warning">
<div v-if="!settingStore.isCommOrAgent" class="warning">
<a-alert type="warning" show-icon>
<template #description>
<div class="flex">
@@ -17,10 +17,10 @@
</template>
</a-alert>
</div>
<div class="content">
<div v-if="!settingStore.isCommOrAgent" class="content">
<img src="/static/images/preview.png" class="preview_img" />
</div>
<div v-if="!settingStore.isComm" class="footer_box">
<div v-if="!settingStore.isCommOrAgent" class="footer_box">
<div>如果觉得好用请不要吝啬你的star哟</div>
<a href="https://gitee.com/certd/certd" target="_blank"><img src="https://gitee.com/certd/certd/badge/star.svg?theme=dark" alt="star" /></a>
<a href="https://github.com/certd/certd" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/certd/certd?logo=github" /></a>
@@ -29,7 +29,8 @@
</template>
<script lang="ts" setup>
import { computed, ref, Ref } from "vue";
import { SiteInfo, useSettingStore } from "/@/store/modules/settings";
import { useSettingStore } from "/@/store/modules/settings";
import { SiteInfo } from "/@/api/modules/api.basic";
const version = ref(import.meta.env.VITE_APP_VERSION);
const settingStore = useSettingStore();
@@ -54,11 +54,13 @@ defineOptions({
interface FormState {
registerEnabled: boolean;
managerOtherUserPipeline: boolean;
icpNo: string;
}
const formState = reactive<Partial<FormState>>({
registerEnabled: false,
managerOtherUserPipeline: false
managerOtherUserPipeline: false,
icpNo: ""
});
async function loadSysPublicSettings() {
@@ -37,9 +37,6 @@
:build-url="buildUrl"
/>
</a-form-item>
<a-form-item label="关闭首页告警" name="warningOff">
<a-switch v-model:checked="formState.warningOff" />
</a-form-item>
<a-form-item label="你的主体名称" name="licenseTo">
<a-input v-model:value="formState.licenseTo" />
<div class="helper">将会显示在底部</div>
@@ -77,7 +74,6 @@ interface FormState {
slogan: string;
logo: string;
loginLogo: string;
warningOff: boolean;
licenseTo: string;
licenseToUrl: string;
}