正在显示
3 个修改的文件
包含
5 行增加
和
5 行删除
| @@ -150,7 +150,7 @@ class BaseController extends Controller | @@ -150,7 +150,7 @@ class BaseController extends Controller | ||
| 150 | $log = config('logging.operator_log'); | 150 | $log = config('logging.operator_log'); |
| 151 | if(isset($log) && $log['log'] == true){ | 151 | if(isset($log) && $log['log'] == true){ |
| 152 | if(empty($log['action']) || (strpos($log['action'],$this->request->route()->getName()) === false)){ | 152 | if(empty($log['action']) || (strpos($log['action'],$this->request->route()->getName()) === false)){ |
| 153 | - Common::set_user_log(['model'=>$this->request->route()->getName(),'remark'=>'请求的参数:param = '.json_encode($this->param),'operator_id'=>$this->uid,'type'=>isset($this->user['type']) ?? 0]); | 153 | + Common::set_user_log(['model'=>$this->request->route()->getName(),'remark'=>'请求的参数:param = '.json_encode($this->param),'operator_id'=>$this->uid,'type'=>isset($this->user['manager_id']) ? 1 : 0]); |
| 154 | } | 154 | } |
| 155 | } | 155 | } |
| 156 | return true; | 156 | return true; |
| @@ -92,11 +92,11 @@ class LoginLogic extends BaseLogic | @@ -92,11 +92,11 @@ class LoginLogic extends BaseLogic | ||
| 92 | ]; | 92 | ]; |
| 93 | //获取超级管理员登录 | 93 | //获取超级管理员登录 |
| 94 | if(isset($this->param['project_id']) && !empty($this->param['project_id'])){ | 94 | if(isset($this->param['project_id']) && !empty($this->param['project_id'])){ |
| 95 | - $data['autologin_code'] = $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id']]),$info['values']); | 95 | + $data['autologin_code'] = $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id'],'manager_id'=>$this->manager['id']]),$info['values']); |
| 96 | } | 96 | } |
| 97 | //使用用户登录 | 97 | //使用用户登录 |
| 98 | if(isset($this->param['user_id']) && !empty($this->param['user_id'])){ | 98 | if(isset($this->param['user_id']) && !empty($this->param['user_id'])){ |
| 99 | - $data['autologin_code'] = $encrypt->lock_url(json_encode(['user_id'=>$this->param['user_id']]),$info['values']); | 99 | + $data['autologin_code'] = $encrypt->lock_url(json_encode(['user_id'=>$this->param['user_id'],'manager_id'=>$this->manager['id']]),$info['values']); |
| 100 | } | 100 | } |
| 101 | //获取当前超级管理员的token | 101 | //获取当前超级管理员的token |
| 102 | return $this->success($data); | 102 | return $this->success($data); |
| @@ -82,10 +82,10 @@ class UserLoginLogic | @@ -82,10 +82,10 @@ class UserLoginLogic | ||
| 82 | $token = md5(uniqid().$info['id']); | 82 | $token = md5(uniqid().$info['id']); |
| 83 | //存储缓存 | 83 | //存储缓存 |
| 84 | $info['token'] = $token; | 84 | $info['token'] = $token; |
| 85 | - $info['type'] = 1;//代表自动登录写入日志 | 85 | + $info['manager_id'] = $data['manager_id'];//代表自动登录写入日志 |
| 86 | Cache::add($token,$info,3600); | 86 | Cache::add($token,$info,3600); |
| 87 | } | 87 | } |
| 88 | - Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),'project_id'=>$info['project_id'], 'remark' => '自动登录']); | 88 | + Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),'project_id'=>$info['project_id'], 'type'=>1 ,'remark' => '自动登录,操作管理员为:'.$data['manager_id']]); |
| 89 | return $info; | 89 | return $info; |
| 90 | } | 90 | } |
| 91 | 91 |
-
请 注册 或 登录 后发表评论