perf: 优化注册提示
This commit is contained in:
parent
7593d7a3e9
commit
4f2c0e94d9
@ -42,6 +42,9 @@ class UsersController extends AbstractController
|
|||||||
$type = trim(Request::input('type'));
|
$type = trim(Request::input('type'));
|
||||||
$email = trim(Request::input('email'));
|
$email = trim(Request::input('email'));
|
||||||
$password = trim(Request::input('password'));
|
$password = trim(Request::input('password'));
|
||||||
|
if(!$email){
|
||||||
|
return Base::retError('请输入邮箱地址');
|
||||||
|
}
|
||||||
if ($type == 'reg') {
|
if ($type == 'reg') {
|
||||||
$password2 = trim(Request::input('password2'));
|
$password2 = trim(Request::input('password2'));
|
||||||
//邮箱
|
//邮箱
|
||||||
@ -51,6 +54,9 @@ class UsersController extends AbstractController
|
|||||||
if (User::email2userid($email) > 0) {
|
if (User::email2userid($email) > 0) {
|
||||||
return Base::retError('邮箱地址已存在');
|
return Base::retError('邮箱地址已存在');
|
||||||
}
|
}
|
||||||
|
if (empty($password)) {
|
||||||
|
return Base::retError('请输入密码');
|
||||||
|
}
|
||||||
if ($password != $password2) {
|
if ($password != $password2) {
|
||||||
return Base::retError('确认密码输入不一致');
|
return Base::retError('确认密码输入不一致');
|
||||||
}
|
}
|
||||||
@ -75,6 +81,9 @@ class UsersController extends AbstractController
|
|||||||
return Base::retError('请输入正确的验证码', ['code' => 'need']);
|
return Base::retError('请输入正确的验证码', ['code' => 'need']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (empty($password)) {
|
||||||
|
return Base::retError('请输入密码');
|
||||||
|
}
|
||||||
//
|
//
|
||||||
$retError = function ($msg) use ($email) {
|
$retError = function ($msg) use ($email) {
|
||||||
Cache::forever("code::" . $email, "need");
|
Cache::forever("code::" . $email, "need");
|
||||||
|
@ -237,12 +237,6 @@ export default {
|
|||||||
|
|
||||||
onLogin() {
|
onLogin() {
|
||||||
this.chackServerUrl(true).then(() => {
|
this.chackServerUrl(true).then(() => {
|
||||||
if (!this.email) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.password) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loadIng++;
|
this.loadIng++;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'users/login',
|
url: 'users/login',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user