|
|
@@ -1430,10 +1430,8 @@ class UserRepository extends BaseRepository
|
|
1430
|
1430
|
public function checkToken(string $token)
|
|
1431
|
1431
|
{
|
|
1432
|
1432
|
$has = Cache::has('user_' . $token);
|
|
1433
|
|
- if (!$has) {
|
|
1434
|
|
- throw new ValidateException('请登录');
|
|
1435
|
|
- // throw new AuthException('无效的token');
|
|
1436
|
|
- }
|
|
|
1433
|
+ if (!$has)
|
|
|
1434
|
+ throw new AuthException('无效的token');
|
|
1437
|
1435
|
$lastTime = Cache::get('user_' . $token);
|
|
1438
|
1436
|
if (($lastTime + intval(Config::get('admin.token_valid_exp', 15)) * 60) > time())
|
|
1439
|
1437
|
throw new AuthException('token 已过期');
|