fix(LockModal): Cannot unlock (#3143)

This commit is contained in:
bowen 2023-10-13 11:22:23 +08:00 committed by GitHub
parent 4b46be4a79
commit cdac147bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -48,7 +48,7 @@
const getRealName = computed(() => userStore.getUserInfo?.realName); const getRealName = computed(() => userStore.getUserInfo?.realName);
const [register, { closeModal }] = useModalInner(); const [register, { closeModal }] = useModalInner();
const [registerForm, { validateFields, resetFields }] = useForm({ const [registerForm, { validate, resetFields }] = useForm({
showActionButtonGroup: false, showActionButtonGroup: false,
schemas: [ schemas: [
{ {
@ -63,17 +63,20 @@
], ],
}); });
async function handleLock() { const handleLock = async () => {
const values = (await validateFields()) as any; const { password = '' } = await validate<{
const password: string | undefined = values.password; password: string;
}>();
closeModal(); closeModal();
lockStore.setLockInfo({ lockStore.setLockInfo({
isLock: true, isLock: true,
pwd: password, pwd: password,
}); });
await resetFields(); await resetFields();
} };
const avatar = computed(() => { const avatar = computed(() => {
const { avatar } = userStore.getUserInfo; const { avatar } = userStore.getUserInfo;