|
@@ -5,7 +5,6 @@ namespace App\Http\Middleware\Manager;
|
|
|
use App\Facades\Servers\Encrypts\AccessToken;
|
|
use App\Facades\Servers\Encrypts\AccessToken;
|
|
|
use Closure;
|
|
use Closure;
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
|
-use App\Models\Manager\Personnel\Employee as EmployeeModel;
|
|
|
|
|
|
|
|
|
|
class Login
|
|
class Login
|
|
|
{
|
|
{
|
|
@@ -44,7 +43,7 @@ class Login
|
|
|
* @param \Closure $next
|
|
* @param \Closure $next
|
|
|
* @return mixed
|
|
* @return mixed
|
|
|
*/
|
|
*/
|
|
|
- public function handle(Request $request, Closure $next, EmployeeModel $EmployeeModel)
|
|
|
|
|
|
|
+ public function handle(Request $request, Closure $next)
|
|
|
{
|
|
{
|
|
|
// 当前路径
|
|
// 当前路径
|
|
|
$path = ltrim($request->getPathInfo(), '/');
|
|
$path = ltrim($request->getPathInfo(), '/');
|
|
@@ -59,6 +58,7 @@ class Login
|
|
|
if ($userInfo['type'] != 'manager' || $userInfo['expire'] < time()) return json_send(['code' => 'no_login', 'msg' => '请您登录', 'data' => '登录失效']);
|
|
if ($userInfo['type'] != 'manager' || $userInfo['expire'] < time()) return json_send(['code' => 'no_login', 'msg' => '请您登录', 'data' => '登录失效']);
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
|
if($userInfo['is_admin'] == 1){
|
|
if($userInfo['is_admin'] == 1){
|
|
|
|
|
+ $EmployeeModel = new \App\Models\Manager\Personnel\Employee();
|
|
|
$Employee = $EmployeeModel->where('id', $userInfo['uid'])->first();
|
|
$Employee = $EmployeeModel->where('id', $userInfo['uid'])->first();
|
|
|
if (!$Employee) return json_send(['code' => 'no_login', 'msg' => '记录不存在','data'=>'']);
|
|
if (!$Employee) return json_send(['code' => 'no_login', 'msg' => '记录不存在','data'=>'']);
|
|
|
if ($Employee->status == 1) return json_send(['code' => 'no_login', 'msg' => '账号已被禁用','data'=>'']);
|
|
if ($Employee->status == 1) return json_send(['code' => 'no_login', 'msg' => '账号已被禁用','data'=>'']);
|