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