mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-28 04:40:37 +00:00
fix: 删除账户必填加星号;邮箱验证码可以多发送
This commit is contained in:
parent
16ac8d6b06
commit
132dd8134a
@ -45,7 +45,7 @@ class UserEmailVerification extends AbstractModel
|
||||
{
|
||||
$email = $type == 1 ? $user->email : $email;
|
||||
$res = self::whereEmail($email)->where('created_at', '>', Carbon::now()->subMinutes(30))->whereType($type)->first();
|
||||
if ($res) return;
|
||||
if ($res && $type == 1) return;
|
||||
//删除
|
||||
self::whereUserid($email)->delete();
|
||||
$code = $type == 1 ? Base::generatePassword(64) : rand(100000, 999999);
|
||||
@ -109,9 +109,9 @@ class UserEmailVerification extends AbstractModel
|
||||
throw new ApiException('请输入验证码');
|
||||
}
|
||||
/** @var UserEmailVerification $emailVerify */
|
||||
$emailVerify = self::whereEmail($email)->whereCode($code)->whereType($type)->orderByDesc('id')->first();
|
||||
$emailVerify = self::whereEmail($email)->whereType($type)->orderByDesc('id')->first();
|
||||
|
||||
if (empty($emailVerify)) {
|
||||
if (empty($emailVerify) || $emailVerify->code != $code) {
|
||||
throw new ApiException('验证码错误');
|
||||
}
|
||||
|
||||
|
||||
@ -74,6 +74,32 @@ export default {
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
code: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value.trim() === '' && this.isRegVerify == 1) {
|
||||
callback(new Error(this.$L('请输入邮箱验证码')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
required: true,
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
password: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value.trim() === '' && this.isRegVerify != 1) {
|
||||
callback(new Error(this.$L('请输入登录密码')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
required: true,
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
count: 0,
|
||||
isSendButtonShow: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user