|
@@ -25,9 +25,11 @@
|
|
|
:count="60"
|
|
|
:sendCodeApi="
|
|
|
() => {
|
|
|
- return sendCodeApi({
|
|
|
- phone: formData.userName,
|
|
|
- });
|
|
|
+ return reg.test(formData.userName)
|
|
|
+ ? sendCodeApi({
|
|
|
+ phone: formData.userName,
|
|
|
+ })
|
|
|
+ : falseSendcode;
|
|
|
}
|
|
|
"
|
|
|
v-model:value="formData.code"
|
|
@@ -82,6 +84,7 @@
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { useLoginState, useFormRules, useFormValid, LoginStateEnum } from './useLogin';
|
|
|
import { sendCodeApi, registerApi } from '/@/api/sys/user';
|
|
|
+ // import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
const FormItem = Form.Item;
|
|
|
// const InputPassword = Input.Password;
|
|
@@ -100,7 +103,13 @@
|
|
|
code: '',
|
|
|
// policy: false,
|
|
|
});
|
|
|
-
|
|
|
+ // const { createMessage } = useMessage();
|
|
|
+ const falseSendcode = ref(
|
|
|
+ new Promise<boolean>((r) => {
|
|
|
+ return r(false);
|
|
|
+ }),
|
|
|
+ );
|
|
|
+ const reg = ref(new RegExp(/^1\d{10}$/));
|
|
|
const { getFormRules } = useFormRules(formData);
|
|
|
const { validForm } = useFormValid(formRef);
|
|
|
|