|
@@ -40,7 +40,7 @@
|
|
|
/>
|
|
|
<span class="verify-code-accept">
|
|
|
<el-button
|
|
|
- @click="getVerifyCode"
|
|
|
+ @click="showHMVerify"
|
|
|
:disabled="countDownNumer"
|
|
|
:loading="getVerifyCodeLoading"
|
|
|
>
|
|
@@ -100,9 +100,6 @@ const modalVisible = ref(false);
|
|
|
// 重新获取验证码标识
|
|
|
const isReacquireCode = ref(false);
|
|
|
|
|
|
-// 人机校验通过标识符
|
|
|
-const isHMVerifySuccess = ref(false);
|
|
|
-
|
|
|
const getVerifyCodeLoading = ref(false);
|
|
|
|
|
|
const nextActionLoading = ref(false);
|
|
@@ -120,44 +117,44 @@ const codeText = computed(() => {
|
|
|
// 注册邮箱时按钮置灰状态
|
|
|
const nextDisabled = computed(() => !email.value || !emailCode.value);
|
|
|
|
|
|
-// 获取验证码
|
|
|
-const getVerifyCode = () => {
|
|
|
+//开启人机校验
|
|
|
+const showHMVerify = () => {
|
|
|
// 校验邮箱非空以及格式
|
|
|
if (!validateEmail()) return;
|
|
|
- if (!isHMVerifySuccess.value) {
|
|
|
- modalVisible.value = true;
|
|
|
- } else {
|
|
|
- getVerifyCodeLoading.value = true;
|
|
|
- post("v3/member/front/active/verification/code", {
|
|
|
- email: email.value,
|
|
|
- source: 1,
|
|
|
- type: 1,
|
|
|
+ modalVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+// 获取验证码
|
|
|
+const getVerifyCode = () => {
|
|
|
+ getVerifyCodeLoading.value = true;
|
|
|
+ post("v3/member/front/active/verification/code", {
|
|
|
+ email: email.value,
|
|
|
+ source: 1,
|
|
|
+ type: 1,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ showMessage({
|
|
|
+ message: L["register"]["验证码已发送"],
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ // 设置倒计时
|
|
|
+ startCountdown(60, (time) => (countDownNumer.value = time));
|
|
|
+ isReacquireCode.value = true;
|
|
|
+ } else {
|
|
|
+ showMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
- if (res.state === 200) {
|
|
|
- showMessage({
|
|
|
- message: L["register"]["验证码已发送"],
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- // 设置倒计时
|
|
|
- startCountdown(60, (time) => (countDownNumer.value = time));
|
|
|
- isReacquireCode.value = true;
|
|
|
- } else {
|
|
|
- showMessage({
|
|
|
- message: res.msg,
|
|
|
- type: "warning",
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- getVerifyCodeLoading.value = false;
|
|
|
- });
|
|
|
- }
|
|
|
+ .finally(() => {
|
|
|
+ getVerifyCodeLoading.value = false;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
// 人机验证成功
|
|
|
const verifySuccess = () => {
|
|
|
- isHMVerifySuccess.value = true;
|
|
|
modalVisible.value = false;
|
|
|
getVerifyCode();
|
|
|
};
|
|
@@ -210,10 +207,10 @@ const next = () => {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res.state == 200) {
|
|
|
- showMessage({
|
|
|
- message: L["register"]["注册成功"],
|
|
|
- type: "success",
|
|
|
- });
|
|
|
+ // showMessage({
|
|
|
+ // message: L["register"]["注册成功"],
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
//成功提示,并返回到登录页面
|
|
|
emits("success", email.value);
|
|
|
} else {
|