master
wangxinglong 2022-08-08 17:57:14 +08:00
parent 53baeecb35
commit 68c5315435
2 changed files with 5 additions and 5 deletions

View File

@ -17,17 +17,17 @@ class ApiLogin
return json(['code' => 6001, 'msg' => '请填写token']); return json(['code' => 6001, 'msg' => '请填写token']);
} }
if (!JwtService::validate($authorization)) { if (!JwtService::validate($authorization)) {
return json(['code' => 6001, 'msg' => 'token验证失败或已失效']); return json(['code' => 6001, 'msg' => '登录状态验证失败或已失效']);
} }
$userInfo = $request->user ?? []; $userInfo = $request->user ?? [];
if (!isset($userInfo['user_id']) || empty($userInfo['user_id'])) { 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']) { if(isset($userInfo['expire_time']) && time() >= $userInfo['expire_time']) {
return json(['code' => 6001, 'msg' => 'token已失效']); return json(['code' => 6001, 'msg' => '登录状态已失效']);
} }
return $next($request); return $next($request);

View File

@ -148,14 +148,14 @@ class SpuRepository extends Repository
$page = (!is_numeric($page) || $page <= 0) ? 1 : $page; $page = (!is_numeric($page) || $page <= 0) ? 1 : $page;
$size = (!is_numeric($size) || $size <= 0) ? 10 : $size; $size = (!is_numeric($size) || $size <= 0) ? 10 : $size;
$size = 0;
event('SpuCheck'); event('SpuCheck');
$searchMap = $where; $searchMap = $where;
// 商品名称模糊搜索 // 商品名称模糊搜索
if (isset($params['keyword']) && !empty($params['keyword'])) { if (isset($params['keyword']) && !empty($params['keyword'])) {
$searchMap[] = ['name', 'like', '%'.$params['keyword'].'%']; $searchMap[] = ['name', 'like', '%' . $params['keyword'] . '%'];
} }
// 活动类型搜索 // 活动类型搜索