更新
This commit is contained in:
@@ -10,6 +10,7 @@ namespace app\controller\admin;
|
||||
|
||||
use app\controller\Admin;
|
||||
use app\model\Member;
|
||||
use think\facade\Session;
|
||||
|
||||
/**
|
||||
* @title 后端公共模块
|
||||
@@ -39,20 +40,14 @@ class Index extends Admin {
|
||||
return $this->error('验证码错误!', '');
|
||||
}
|
||||
|
||||
$userinfo = $user->login($this->request);
|
||||
if ($userinfo) {
|
||||
// return $this->success('登录成功!', url('admin/index/index'));
|
||||
} else {
|
||||
print_r($user->error);
|
||||
// switch ($uid) {
|
||||
// case -1:$error = '用户不存在或被禁用!';
|
||||
// break; //系统级别禁用
|
||||
// case -2:$error = '密码错误!';
|
||||
// break;
|
||||
// default:$error = '未知错误!';
|
||||
// break; // 0-接口参数错误(调试阶段使用)
|
||||
// }
|
||||
return $this->error($error, '');
|
||||
try {
|
||||
$userinfo = $user->login($this->request);
|
||||
if ($userinfo) {
|
||||
Session::set('userInfo', $userinfo);
|
||||
return $this->success('登录成功!', url('/admin/index/index'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return $this->error($e->getError(), '');
|
||||
}
|
||||
} else {
|
||||
return $this->fetch();
|
||||
|
||||
Reference in New Issue
Block a user