后端版本获取
This commit is contained in:
parent
ed7e8a7768
commit
895a902d96
2
components.d.ts
vendored
2
components.d.ts
vendored
@ -13,6 +13,8 @@ declare module '@vue/runtime-core' {
|
|||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
|
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||||
|
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||||
|
|||||||
@ -83,12 +83,6 @@ html, body, #app, .layout {
|
|||||||
flex-basis: 0;
|
flex-basis: 0;
|
||||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||||
}
|
}
|
||||||
> .layout-copy {
|
|
||||||
text-align: center;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
color: var(--el-text-color-placeholder);
|
|
||||||
font-size: var(--el-font-size-extra-small);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===== 页面布局(用于带分页的表格页面)===== */
|
/* ===== 页面布局(用于带分页的表格页面)===== */
|
||||||
.page-wrapper {
|
.page-wrapper {
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item command="home">返回首页</el-dropdown-item>
|
<el-dropdown-item command="home">返回首页</el-dropdown-item>
|
||||||
<el-dropdown-item command="changePassword">修改密码</el-dropdown-item>
|
<el-dropdown-item command="changePassword">修改密码</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="about">关于</el-dropdown-item>
|
||||||
<el-dropdown-item command="logout" divided>退出</el-dropdown-item>
|
<el-dropdown-item command="logout" divided>退出</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
@ -51,7 +52,6 @@
|
|||||||
</keep-alive>
|
</keep-alive>
|
||||||
</router-view>
|
</router-view>
|
||||||
</div>
|
</div>
|
||||||
<div class="layout-copy">2016-{{currentYear}} © colorfulsweet 上次更新:{{ version }}</div>
|
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
@ -75,6 +75,17 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog v-model="aboutModal" title="关于" width="420px">
|
||||||
|
<el-descriptions :column="1" border>
|
||||||
|
<el-descriptions-item label="前端版本">
|
||||||
|
{{ version }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="后端版本">
|
||||||
|
{{ backendVersion }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -93,12 +104,13 @@ const router = useRouter()
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const version = __APP_VERSION__
|
const version = __APP_VERSION__
|
||||||
const currentYear = new Date().getFullYear()
|
|
||||||
const defaultActiveMenuKey = ref<string | null>(null)
|
const defaultActiveMenuKey = ref<string | null>(null)
|
||||||
const openMenuNames = ref<string[]>([])
|
const openMenuNames = ref<string[]>([])
|
||||||
const mainViewReady = ref(false)
|
const mainViewReady = ref(false)
|
||||||
|
|
||||||
const isDark = ref(false)
|
const isDark = ref(false)
|
||||||
|
const aboutModal = ref(false)
|
||||||
|
const backendVersion = ref('未知')
|
||||||
|
|
||||||
const menus = computed((): MenuGroup[] => {
|
const menus = computed((): MenuGroup[] => {
|
||||||
return allMenus
|
return allMenus
|
||||||
@ -194,6 +206,9 @@ function dropdownMenuCommand(command: string): void {
|
|||||||
case 'home':
|
case 'home':
|
||||||
router.push('/')
|
router.push('/')
|
||||||
break
|
break
|
||||||
|
case 'about':
|
||||||
|
openAboutDialog()
|
||||||
|
break
|
||||||
case 'changePassword':
|
case 'changePassword':
|
||||||
changePwdModal.value = true
|
changePwdModal.value = true
|
||||||
break
|
break
|
||||||
@ -205,6 +220,13 @@ function dropdownMenuCommand(command: string): void {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function openAboutDialog(): Promise<void> {
|
||||||
|
aboutModal.value = true
|
||||||
|
backendVersion.value = '正在获取...'
|
||||||
|
backendVersion.value = await http.get<never, string>('/system/version')
|
||||||
|
}
|
||||||
|
|
||||||
function submitChangePassword(): void {
|
function submitChangePassword(): void {
|
||||||
changePwdForm.value?.validate(async (valid: boolean) => {
|
changePwdForm.value?.validate(async (valid: boolean) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user