作者 lyh

gx

@@ -46,9 +46,6 @@ class LoginLogic extends BaseLogic @@ -46,9 +46,6 @@ class LoginLogic extends BaseLogic
46 if (Manage::STATUS_DISABLE == $manage->status) { 46 if (Manage::STATUS_DISABLE == $manage->status) {
47 $this->fail('帐号已被禁用'); 47 $this->fail('帐号已被禁用');
48 } 48 }
49 -// if($this->param['password'] == '123456'){  
50 -// $this->fail('请使用短信登录,修改初始密码');  
51 -// }  
52 $type = 1;//账号密码登录 49 $type = 1;//账号密码登录
53 if (!Hash::check($this->param['password'], $manage->password)) { 50 if (!Hash::check($this->param['password'], $manage->password)) {
54 //验证验证码 51 //验证验证码
@@ -56,13 +53,10 @@ class LoginLogic extends BaseLogic @@ -56,13 +53,10 @@ class LoginLogic extends BaseLogic
56 $type = 2;//验证码登录 53 $type = 2;//验证码登录
57 } 54 }
58 if(!empty($manage['token'])){ 55 if(!empty($manage['token'])){
59 - //清除上一次用户缓存  
60 Cache::pull(Common::MANAGE_TOKEN . $manage['token']); 56 Cache::pull(Common::MANAGE_TOKEN . $manage['token']);
61 } 57 }
62 //生成新token 58 //生成新token
63 $token = md5(uniqid().$manage['id']); 59 $token = md5(uniqid().$manage['id']);
64 - //存储缓存  
65 - $manage['token'] = $token;  
66 unset($manage['password']); 60 unset($manage['password']);
67 Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6); 61 Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6);
68 //更新用户信息 62 //更新用户信息
@@ -85,7 +79,7 @@ class LoginLogic extends BaseLogic @@ -85,7 +79,7 @@ class LoginLogic extends BaseLogic
85 * @time :2023/9/7 16:30 79 * @time :2023/9/7 16:30
86 */ 80 */
87 public function logout(){ 81 public function logout(){
88 - Cache::pull(request()->header('token')); 82 + Cache::pull($this->request->header('token'));
89 return $this->success(); 83 return $this->success();
90 } 84 }
91 85