增加文章发布功能
This commit is contained in:
@@ -31,11 +31,11 @@ class Login
|
||||
if (Request::isPost()) {
|
||||
$account = trim(input('post.account'));
|
||||
if (empty($account)) {
|
||||
$this->returnCode('90000001');
|
||||
$this->returnCode(1, '账号不能为空');
|
||||
}
|
||||
$pattern = "/^([0-9A-Za-z-_.]+)@([0-9a-z]+.[a-z]{2,3}(.[a-z]{2})?)$/i";
|
||||
if (!preg_match($pattern, $account)) {
|
||||
$this->returnCode('90000006');
|
||||
$this->returnCode(1, '邮箱格式不正确');
|
||||
}
|
||||
$password = trim(input('post.password'));
|
||||
if (empty($password)) {
|
||||
@@ -50,13 +50,13 @@ class Login
|
||||
}
|
||||
$aUser = Db::table('yz_admin_user')->where('account', $account)->find();
|
||||
if (empty($aUser)) {
|
||||
$this->returnCode('90000029');
|
||||
$this->returnCode(1, '账号不存在');
|
||||
}
|
||||
if ($aUser['status'] != 1) {
|
||||
$this->returnCode('90000030');
|
||||
$this->returnCode(1, '账号已被禁用');
|
||||
}
|
||||
if ($aUser['password'] != md5($password)) {
|
||||
$this->returnCode('90000031');
|
||||
$this->returnCode(1, '密码错误');
|
||||
}
|
||||
$remember = input('post.remember');
|
||||
if (!empty($remember)) {
|
||||
@@ -69,7 +69,7 @@ class Login
|
||||
Db::table('yz_admin_user')->where('uid', $aUser['uid'])->update(
|
||||
['login_count' => $aUser['login_count'] + 1, 'update_time' => time()]
|
||||
);
|
||||
$this->returnCode(0, [], '登陆成功');
|
||||
$this->returnCode(0, [], '登录成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user