diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 6b428194..418aac67 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -57,8 +57,8 @@ class Test extends Command */ public function handle() { - $rep = new UserRepository(); - $r = $rep->getDetail(1); + $r = floatval(25.32); + dd($r); } } diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index a81e4cb3..21a75367 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -29,7 +29,7 @@ class UserResource extends JsonResource 'downloaded' => $this->downloaded, 'downloaded_text' => mksize($this->downloaded), 'seed_bonus' => $this->seedbonus, - 'seed_points' => $this->seed_points, + 'seed_points' => floatval($this->seed_points), 'seedtime' => $this->seedtime, 'seedtime_text' => mkprettytime($this->seedtime), 'leechtime' => $this->leechtime, diff --git a/app/Repositories/AuthenticateRepository.php b/app/Repositories/AuthenticateRepository.php index 4ef1b8ec..df7fbeb8 100644 --- a/app/Repositories/AuthenticateRepository.php +++ b/app/Repositories/AuthenticateRepository.php @@ -19,6 +19,7 @@ class AuthenticateRepository extends BaseRepository if (IS_PLATFORM_ADMIN && !$user->canAccessAdmin()) { throw new UnauthorizedException('Unauthorized!'); } + $user->checkIsNormal(); $tokenName = __METHOD__ . __LINE__; $token = DB::transaction(function () use ($user, $tokenName) { $user->tokens()->delete();