作者 lyh

gx

@@ -149,7 +149,7 @@ class BaseController extends Controller @@ -149,7 +149,7 @@ class BaseController extends Controller
149 //生成日志 149 //生成日志
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()) < 0)){ 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]); 153 Common::set_user_log(['model'=>$this->request->route()->getName(),'remark'=>'请求的参数:param = '.json_encode($this->param),'operator_id'=>$this->uid]);
154 } 154 }
155 } 155 }
@@ -54,7 +54,7 @@ class ComController extends BaseController @@ -54,7 +54,7 @@ class ComController extends BaseController
54 */ 54 */
55 public function autologin(UserLoginLogic $logic, EncryptUtils $encrypt) 55 public function autologin(UserLoginLogic $logic, EncryptUtils $encrypt)
56 { 56 {
57 - $data = $encrypt->authcode($this->param['code'], 'DECODE', 'autologin'); 57 + $data = $encrypt->unlock_url($this->param['code'], 'v6.globalso.com');
58 $data = json_decode($data, true); 58 $data = json_decode($data, true);
59 if(empty($data['project_id'])){ 59 if(empty($data['project_id'])){
60 $this->response('无效Code',Code::USER_ERROR); 60 $this->response('无效Code',Code::USER_ERROR);
@@ -88,7 +88,7 @@ class LoginLogic extends BaseLogic @@ -88,7 +88,7 @@ class LoginLogic extends BaseLogic
88 $encrypt = new EncryptUtils(); 88 $encrypt = new EncryptUtils();
89 $data = [ 89 $data = [
90 'domain'=>$info['values'], 90 'domain'=>$info['values'],
91 - 'autologin_code' => $encrypt->authcode(json_encode(['project_id' => $this->param['project_id']]), 'ENCODE', 'autologin', 3600), 91 + 'autologin_code' => $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id']]),'v6.globalso.com'),
92 'remark'=>'自动登录地址和code', 92 'remark'=>'自动登录地址和code',
93 ]; 93 ];
94 //获取当前超级管理员的token 94 //获取当前超级管理员的token
@@ -76,6 +76,7 @@ class UserLoginLogic @@ -76,6 +76,7 @@ class UserLoginLogic
76 $token = md5(uniqid().$info['id']); 76 $token = md5(uniqid().$info['id']);
77 //存储缓存 77 //存储缓存
78 $info['token'] = $token; 78 $info['token'] = $token;
  79 + $info['type'] = 1;//代表自动登录写入日志
79 Cache::add($token,$info,3600); 80 Cache::add($token,$info,3600);
80 } 81 }
81 Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),'project_id'=>$info['project_id'], 'remark' => '自动登录']); 82 Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),'project_id'=>$info['project_id'], 'remark' => '自动登录']);