master
wangxinglong 2022-02-25 14:28:09 +08:00
parent 049a98a0a9
commit 42bd496675
1 changed files with 3 additions and 3 deletions

View File

@ -20,17 +20,17 @@ class ApiLogin
return json(['code' => 6001, 'msg' => '登陆失效']);
}
if (!JwtService::validate($authorization)) {
return json(['code' => 6001, 'msg' => 'token验证失败或已失效']);
return json(['code' => 6001, 'msg' => '登录信息验证失败或已失效']);
}
$userInfo = $request->user ?? [];
if (!isset($userInfo['user_id']) || empty($userInfo['user_id'])) {
return json(['code' => 6001, 'msg' => 'token已失效']);
return json(['code' => 6001, 'msg' => '登录已失效']);
}
// 自定义过期时间校验。
if(isset($userInfo['expire_time']) && time() >= $userInfo['expire_time']) {
return json(['code' => 6001, 'msg' => 'token已失效']);
return json(['code' => 6001, 'msg' => '登录已失效']);
}
return $next($request);