mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
[api] authenticate check is normal
This commit is contained in:
@@ -57,8 +57,8 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$rep = new UserRepository();
|
||||
$r = $rep->getDetail(1);
|
||||
$r = floatval(25.32);
|
||||
dd($r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user