作者 lyh

gx

... ... @@ -46,9 +46,6 @@ class LoginLogic extends BaseLogic
if (Manage::STATUS_DISABLE == $manage->status) {
$this->fail('帐号已被禁用');
}
// if($this->param['password'] == '123456'){
// $this->fail('请使用短信登录,修改初始密码');
// }
$type = 1;//账号密码登录
if (!Hash::check($this->param['password'], $manage->password)) {
//验证验证码
... ... @@ -56,13 +53,10 @@ class LoginLogic extends BaseLogic
$type = 2;//验证码登录
}
if(!empty($manage['token'])){
//清除上一次用户缓存
Cache::pull(Common::MANAGE_TOKEN . $manage['token']);
}
//生成新token
$token = md5(uniqid().$manage['id']);
//存储缓存
$manage['token'] = $token;
unset($manage['password']);
Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6);
//更新用户信息
... ... @@ -85,7 +79,7 @@ class LoginLogic extends BaseLogic
* @time :2023/9/7 16:30
*/
public function logout(){
Cache::pull(request()->header('token'));
Cache::pull($this->request->header('token'));
return $this->success();
}
... ...