作者 lyh

gx

@@ -39,7 +39,7 @@ class BaseController extends Controller @@ -39,7 +39,7 @@ class BaseController extends Controller
39 $info = Cache::get(Common::MANAGE_TOKEN . $this->token); 39 $info = Cache::get(Common::MANAGE_TOKEN . $this->token);
40 if(!empty($this->token) && !empty($info)){ 40 if(!empty($this->token) && !empty($info)){
41 $this->manage = $info; 41 $this->manage = $info;
42 - Cache::put($this->token, $info, 3600 * 6);//更新缓存时间 42 + Cache::put($this->token, $info, 3600 * 12);//更新缓存时间
43 $this->uid = $info['id']; 43 $this->uid = $info['id'];
44 } 44 }
45 } 45 }
@@ -82,18 +82,18 @@ class LoginController extends BaseController @@ -82,18 +82,18 @@ class LoginController extends BaseController
82 $mobile = $this->param['mobile']; 82 $mobile = $this->param['mobile'];
83 $manager = Manage::where(['mobile' => $mobile])->first(); 83 $manager = Manage::where(['mobile' => $mobile])->first();
84 if (empty($manager)) { 84 if (empty($manager)) {
85 - $this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE); 85 + $this->response('请输入正确的手机号码!', Code::SYSTEM_ERROR);
86 } 86 }
87 $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_MANAGER_LOGIN); 87 $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_MANAGER_LOGIN);
88 if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) { 88 if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) {
89 - $this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE); 89 + $this->response('请不要重复发送短信!', Code::SYSTEM_ERROR);
90 } 90 }
91 $template = config('aliyunsms.login_sms_temp'); 91 $template = config('aliyunsms.login_sms_temp');
92 $code['code'] = rand(100000,999999); 92 $code['code'] = rand(100000,999999);
93 $ali_sms = new AliSms(); 93 $ali_sms = new AliSms();
94 $send = $ali_sms->sendSms(strval($mobile), $template, $code); 94 $send = $ali_sms->sendSms(strval($mobile), $template, $code);
95 if (empty($send->Code) && $send->Code != 'OK') { 95 if (empty($send->Code) && $send->Code != 'OK') {
96 - $this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE); 96 + $this->response('发送失败, 请稍后重试!', Code::SYSTEM_ERROR);
97 } 97 }
98 SmsLog::createLog($mobile, $code['code'],SmsLog::TYPE_MANAGER_LOGIN); 98 SmsLog::createLog($mobile, $code['code'],SmsLog::TYPE_MANAGER_LOGIN);
99 $this->response('success'); 99 $this->response('success');
@@ -112,18 +112,18 @@ class LoginController extends BaseController @@ -112,18 +112,18 @@ class LoginController extends BaseController
112 $mobile = $this->param['mobile']; 112 $mobile = $this->param['mobile'];
113 $user = User::where(['mobile' => $mobile])->first(); 113 $user = User::where(['mobile' => $mobile])->first();
114 if (empty($user)) { 114 if (empty($user)) {
115 - $this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE); 115 + $this->response('请输入正确的手机号码!', Code::SYSTEM_ERROR);
116 } 116 }
117 $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN); 117 $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN);
118 if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) { 118 if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) {
119 - $this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE); 119 + $this->response('请不要重复发送短信!', Code::SYSTEM_ERROR);
120 } 120 }
121 $template = config('aliyunsms.login_sms_temp'); 121 $template = config('aliyunsms.login_sms_temp');
122 $code['code'] = rand(100000,999999); 122 $code['code'] = rand(100000,999999);
123 $ali_sms = new AliSms(); 123 $ali_sms = new AliSms();
124 $send = $ali_sms->sendSms(strval($mobile), $template, $code); 124 $send = $ali_sms->sendSms(strval($mobile), $template, $code);
125 if (empty($send->Code) && $send->Code != 'OK') { 125 if (empty($send->Code) && $send->Code != 'OK') {
126 - $this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE); 126 + $this->response('发送失败, 请稍后重试!', Code::SYSTEM_ERROR);
127 } 127 }
128 SmsLog::createLog($mobile, $code['code']); 128 SmsLog::createLog($mobile, $code['code']);
129 $this->response('success'); 129 $this->response('success');
@@ -73,7 +73,7 @@ class LoginAuthMiddleware @@ -73,7 +73,7 @@ class LoginAuthMiddleware
73 $menu_id = $projectMenuModel->read(['action'=>$action],['id']); 73 $menu_id = $projectMenuModel->read(['action'=>$action],['id']);
74 if($menu_id !== false){ 74 if($menu_id !== false){
75 if(strpos($role_info['role_menu'], $menu_id['id']) === false){ 75 if(strpos($role_info['role_menu'], $menu_id['id']) === false){
76 - return response(['code'=>Code::USER_PERMISSION_ERROE,'message'=>'当前用户没有权限']); 76 + return response(['code'=>Code::USER_LOGIN_ERROE,'message'=>'当前用户没有权限']);
77 } 77 }
78 } 78 }
79 } 79 }