|
...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
|
namespace App\Http\Logic\Aside;
|
|
|
|
|
|
|
|
use App\Models\Manage;
|
|
|
|
use App\Models\ManageLoginLog;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
use Illuminate\Support\Facades\Session;
|
|
|
|
|
|
...
|
...
|
@@ -25,18 +26,21 @@ class LoginLogic extends BaseLogic |
|
|
|
|
|
|
|
public function login()
|
|
|
|
{
|
|
|
|
$info = $this->model->where('mobile', $this->requestAll['mobile'])->first();
|
|
|
|
$manage = $this->model->where('mobile', $this->requestAll['mobile'])->first();
|
|
|
|
|
|
|
|
if (!$info){
|
|
|
|
if (!$manage){
|
|
|
|
$this->fail('登录用户名不存在');
|
|
|
|
}
|
|
|
|
if (Manage::STATUS_DISABLE == $info->status) {
|
|
|
|
if (Manage::STATUS_DISABLE == $manage->status) {
|
|
|
|
$this->fail('帐号已被禁用');
|
|
|
|
}
|
|
|
|
if (!Hash::check($this->requestAll['password'], $info->password)) {
|
|
|
|
if (!Hash::check($this->requestAll['password'], $manage->password)) {
|
|
|
|
$this->fail('登录密码不正确');
|
|
|
|
}
|
|
|
|
Session::put('manage', $info->toArray());
|
|
|
|
Session::put('manage', $manage->toArray());
|
|
|
|
|
|
|
|
ManageLoginLog::addLog($manage->id);
|
|
|
|
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|