mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
[api] authenticate check is normal
This commit is contained in:
@@ -57,8 +57,8 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$rep = new UserRepository();
|
$r = floatval(25.32);
|
||||||
$r = $rep->getDetail(1);
|
dd($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class UserResource extends JsonResource
|
|||||||
'downloaded' => $this->downloaded,
|
'downloaded' => $this->downloaded,
|
||||||
'downloaded_text' => mksize($this->downloaded),
|
'downloaded_text' => mksize($this->downloaded),
|
||||||
'seed_bonus' => $this->seedbonus,
|
'seed_bonus' => $this->seedbonus,
|
||||||
'seed_points' => $this->seed_points,
|
'seed_points' => floatval($this->seed_points),
|
||||||
'seedtime' => $this->seedtime,
|
'seedtime' => $this->seedtime,
|
||||||
'seedtime_text' => mkprettytime($this->seedtime),
|
'seedtime_text' => mkprettytime($this->seedtime),
|
||||||
'leechtime' => $this->leechtime,
|
'leechtime' => $this->leechtime,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class AuthenticateRepository extends BaseRepository
|
|||||||
if (IS_PLATFORM_ADMIN && !$user->canAccessAdmin()) {
|
if (IS_PLATFORM_ADMIN && !$user->canAccessAdmin()) {
|
||||||
throw new UnauthorizedException('Unauthorized!');
|
throw new UnauthorizedException('Unauthorized!');
|
||||||
}
|
}
|
||||||
|
$user->checkIsNormal();
|
||||||
$tokenName = __METHOD__ . __LINE__;
|
$tokenName = __METHOD__ . __LINE__;
|
||||||
$token = DB::transaction(function () use ($user, $tokenName) {
|
$token = DB::transaction(function () use ($user, $tokenName) {
|
||||||
$user->tokens()->delete();
|
$user->tokens()->delete();
|
||||||
|
|||||||
Reference in New Issue
Block a user