perf: 优化注册提示

This commit is contained in:
韦荣超 2022-02-18 13:59:40 +08:00
parent 7593d7a3e9
commit 4f2c0e94d9
2 changed files with 9 additions and 6 deletions

View File

@ -42,6 +42,9 @@ class UsersController extends AbstractController
$type = trim(Request::input('type'));
$email = trim(Request::input('email'));
$password = trim(Request::input('password'));
if(!$email){
return Base::retError('请输入邮箱地址');
}
if ($type == 'reg') {
$password2 = trim(Request::input('password2'));
//邮箱
@ -51,6 +54,9 @@ class UsersController extends AbstractController
if (User::email2userid($email) > 0) {
return Base::retError('邮箱地址已存在');
}
if (empty($password)) {
return Base::retError('请输入密码');
}
if ($password != $password2) {
return Base::retError('确认密码输入不一致');
}
@ -75,6 +81,9 @@ class UsersController extends AbstractController
return Base::retError('请输入正确的验证码', ['code' => 'need']);
}
}
if (empty($password)) {
return Base::retError('请输入密码');
}
//
$retError = function ($msg) use ($email) {
Cache::forever("code::" . $email, "need");

View File

@ -237,12 +237,6 @@ export default {
onLogin() {
this.chackServerUrl(true).then(() => {
if (!this.email) {
return;
}
if (!this.password) {
return;
}
this.loadIng++;
this.$store.dispatch("call", {
url: 'users/login',