mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-26 15:00:16 +08:00
refactor(projects): refactor page: user-management [重构用户管理页面]
This commit is contained in:
@@ -36,13 +36,15 @@ import { formRules, getConfirmPwdRule } from '@/utils';
|
||||
const { toLoginModule } = useRouterPush();
|
||||
const { label, isCounting, loading: smsLoading, start } = useSmsCode();
|
||||
|
||||
const formRef = ref<(HTMLElement & FormInst) | null>(null);
|
||||
const formRef = ref<HTMLElement & FormInst>();
|
||||
|
||||
const model = reactive({
|
||||
phone: '',
|
||||
code: '',
|
||||
pwd: '',
|
||||
confirmPwd: ''
|
||||
});
|
||||
|
||||
const rules: FormRules = {
|
||||
phone: formRules.phone,
|
||||
code: formRules.code,
|
||||
@@ -56,18 +58,9 @@ function handleSmsCode() {
|
||||
start();
|
||||
}
|
||||
|
||||
function handleSubmit(e: MouseEvent) {
|
||||
if (!formRef.value) return;
|
||||
e.preventDefault();
|
||||
|
||||
formRef.value.validate(errors => {
|
||||
if (!errors) {
|
||||
if (!agreement.value) return;
|
||||
window.$message?.success('验证成功!');
|
||||
} else {
|
||||
window.$message?.error('验证失败!');
|
||||
}
|
||||
});
|
||||
async function handleSubmit() {
|
||||
await formRef.value?.validate();
|
||||
window.$message?.success('验证成功!');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user