Skip to content

Commit

Permalink
fix(LockModal): Cannot unlock (#3143)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaowoxiaobala committed Oct 13, 2023
1 parent 4b46be4 commit cdac147
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/layouts/default/header/components/lock/LockModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand All @@ -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;
Expand Down

0 comments on commit cdac147

Please sign in to comment.