style: 优化个人中心部分默认显示效果

This commit is contained in:
2024-05-23 21:24:52 +08:00
parent 5897bde0c4
commit f2206b7801
2 changed files with 6 additions and 31 deletions

View File

@@ -36,11 +36,11 @@
</a-descriptions-item>
<a-descriptions-item :span="4">
<template #label> <icon-phone /><span style="margin-left: 5px">手机</span></template>
{{ userInfo.phone }}
{{ userInfo.phone || '暂无' }}
</a-descriptions-item>
<a-descriptions-item :span="4">
<template #label> <icon-email /><span style="margin-left: 5px">邮箱</span></template>
{{ userInfo.email }}
{{ userInfo.email || '暂无' }}
</a-descriptions-item>
<a-descriptions-item :span="4">
<template #label> <icon-mind-mapping /><span style="margin-left: 5px">部门</span></template>

View File

@@ -37,7 +37,6 @@
<script lang="ts" setup>
import type { ModeItem } from '../type'
import VerifyModel from '../components/VerifyModel.vue'
import { type OptionResp, type SecurityConfig, listOption } from '@/apis'
import { useUserStore } from '@/stores'
const userStore = useUserStore()
@@ -48,8 +47,8 @@ modeList.value = [
{
title: '安全手机',
icon: 'phone-color',
value: `${`${userInfo.value.phone} ` || '手机号'}`,
subtitle: `可用于登录、身份验证、密码找回、通知接收`,
value: userInfo.value.phone,
subtitle: `${userInfo.value.phone ? '' : '手机号'}可用于登录、身份验证、密码找回、通知接收`,
type: 'phone',
jumpMode: 'modal',
status: !!userInfo.value.phone,
@@ -58,8 +57,8 @@ modeList.value = [
{
title: '安全邮箱',
icon: 'email-color',
value: `${`${userInfo.value.email} ` || '邮箱'}`,
subtitle: `可用于登录、身份验证、密码找回、通知接收`,
value: userInfo.value.email,
subtitle: `${userInfo.value.email ? '' : '邮箱'}可用于登录、身份验证、密码找回、通知接收`,
type: 'email',
jumpMode: 'modal',
status: !!userInfo.value.email,
@@ -81,30 +80,6 @@ const verifyModelRef = ref<InstanceType<typeof VerifyModel>>()
const onUpdate = (type: string) => {
verifyModelRef.value?.open(type)
}
const securityConfig = ref<SecurityConfig>({
PASSWORD_ERROR_LOCK_COUNT: {},
PASSWORD_ERROR_LOCK_MINUTES: {},
PASSWORD_EXPIRATION_WARNING_DAYS: {},
PASSWORD_EXPIRATION_DAYS: {},
PASSWORD_REUSE_POLICY: {},
PASSWORD_MIN_LENGTH: {},
PASSWORD_ALLOW_CONTAIN_USERNAME: {},
PASSWORD_CONTAIN_SPECIAL_CHARACTERS: {}
})
// 查询列表数据
const getDataList = async () => {
const { data } = await listOption({ code: Object.keys(securityConfig.value) })
securityConfig.value = data.reduce((obj: SecurityConfig, option: OptionResp) => {
obj[option.code] = { ...option, value: Number.parseInt(option.value) }
return obj
}, {})
}
onMounted(() => {
getDataList()
})
</script>
<style lang="scss" scoped></style>