This commit is contained in:
dap
2024-10-21 07:58:31 +08:00
77 changed files with 188 additions and 223 deletions

View File

@@ -1,8 +1,6 @@
<script setup lang="ts">
import type { VbenFormSchema } from '@vben-core/form-ui';
import type { LoginCodeEmits } from './types';
import { computed, reactive } from 'vue';
import { useRouter } from 'vue-router';
@@ -19,7 +17,7 @@ interface Props {
*/
loading?: boolean;
/**
* @zh_CN 登路径
* @zh_CN 登路径
*/
loginPath?: string;
/**
@@ -49,12 +47,12 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: LoginCodeEmits['submit'];
submit: [{ code: string; phoneNumber: string; tenantId: string }];
}>();
const router = useRouter();
const [Form, { validate, setFieldValue }] = useVbenForm(
const [Form, { validate, setFieldValue, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -66,8 +64,8 @@ const [Form, { validate, setFieldValue }] = useVbenForm(
);
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = await getValues();
if (valid) {
emit('submit', {
tenantId: values?.tenantId,