feat: 验证码登录

This commit is contained in:
dap
2024-10-13 10:45:17 +08:00
parent 89047a7dde
commit 6677d5cfa8
4 changed files with 101 additions and 22 deletions

View File

@@ -54,7 +54,7 @@ const emit = defineEmits<{
const router = useRouter();
const [Form, { validate }] = useVbenForm(
const [Form, { validate, setFieldValue }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -70,6 +70,7 @@ async function handleSubmit() {
if (valid) {
emit('submit', {
tenantId: values?.tenantId,
code: values?.code,
phoneNumber: values?.phoneNumber,
});
@@ -79,6 +80,8 @@ async function handleSubmit() {
function goToLogin() {
router.push(props.loginPath);
}
defineExpose({ setFieldValue });
</script>
<template>

View File

@@ -89,6 +89,7 @@ interface LoginAndRegisterParams {
}
interface LoginCodeParams {
tenantId: string;
code: string;
phoneNumber: string;
}