mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-17 04:57:15 +08:00
refactor: 优化密码策略处理
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
<div class="footer">注册于 {{ userInfo.registrationDate }}</div>
|
||||
</a-card>
|
||||
|
||||
<a-modal v-model:visible="visible" title="上传头像" :width="400" :footer="false" @close="reset">
|
||||
<a-modal v-model:visible="visible" title="上传头像" :width="width >= 400 ? 400 : '100%'" :footer="false" @close="reset">
|
||||
<a-row>
|
||||
<a-col :span="14" style="width: 200px; height: 200px">
|
||||
<VueCropper
|
||||
@@ -95,6 +95,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type FileItem, Message } from '@arco-design/web-vue'
|
||||
import { VueCropper } from 'vue-cropper'
|
||||
import BasicInfoUpdateModal from './BasicInfoUpdateModal.vue'
|
||||
@@ -103,6 +104,7 @@ import 'vue-cropper/dist/index.css'
|
||||
import { useUserStore } from '@/stores'
|
||||
import getAvatar from '@/utils/avatar'
|
||||
|
||||
const { width } = useWindowSize()
|
||||
const userStore = useUserStore()
|
||||
const userInfo = computed(() => userStore.userInfo)
|
||||
|
||||
|
@@ -37,7 +37,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ModeItem } from '../type'
|
||||
import VerifyModel from '../components/VerifyModel.vue'
|
||||
import { type OptionResp, type SecurityConfigResp, listOption } from '@/apis'
|
||||
import { type OptionResp, type SecurityConfig, listOption } from '@/apis'
|
||||
import { useUserStore } from '@/stores'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -82,20 +82,21 @@ const onUpdate = (type: string) => {
|
||||
verifyModelRef.value?.open(type)
|
||||
}
|
||||
|
||||
const securityConfig = ref<SecurityConfigResp>({
|
||||
password_contain_name: {},
|
||||
password_error_count: {},
|
||||
password_expiration_days: {},
|
||||
password_lock_minutes: {},
|
||||
password_min_length: {},
|
||||
password_special_char: {},
|
||||
password_update_interval: {}
|
||||
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: SecurityConfigResp, option: OptionResp) => {
|
||||
securityConfig.value = data.reduce((obj: SecurityConfig, option: OptionResp) => {
|
||||
obj[option.code] = { ...option, value: Number.parseInt(option.value) }
|
||||
return obj
|
||||
}, {})
|
||||
|
Reference in New Issue
Block a user