mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
get_user_passkey()
This commit is contained in:
@@ -100,17 +100,8 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$url = "http://127.0.0.1:7777/list-seeder-leecher-count";
|
$ip = "116.77.75.254";
|
||||||
$idArr = [8, 12];
|
$this->info(inet_pton($ip));
|
||||||
$client = new Client();
|
|
||||||
$response = $client->post($url, ['json' => ['torrent_ids' => $idArr]]);
|
|
||||||
$result = json_decode((string)$response->getBody(), true);
|
|
||||||
dump($result);
|
|
||||||
if (!isset($result['ret']) || $result['ret'] != 0) {
|
|
||||||
echo "Bad";
|
|
||||||
} else {
|
|
||||||
echo "OK";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Filament\Pages;
|
namespace App\Filament\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Widgets\AccountInfo;
|
||||||
|
use App\Filament\Widgets\LatestTorrents;
|
||||||
|
use App\Filament\Widgets\LatestUsers;
|
||||||
|
use App\Filament\Widgets\SystemInfo;
|
||||||
|
use App\Filament\Widgets\TorrentStat;
|
||||||
|
use App\Filament\Widgets\TorrentTrend;
|
||||||
|
use App\Filament\Widgets\UserClassStat;
|
||||||
|
use App\Filament\Widgets\UserStat;
|
||||||
|
use App\Filament\Widgets\UserTrend;
|
||||||
|
|
||||||
class Dashboard extends \Filament\Pages\Dashboard
|
class Dashboard extends \Filament\Pages\Dashboard
|
||||||
{
|
{
|
||||||
protected ?string $maxContentWidth = 'full';
|
protected ?string $maxContentWidth = 'full';
|
||||||
|
|
||||||
|
protected function getWidgets(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AccountInfo::class,
|
||||||
|
LatestUsers::class,
|
||||||
|
LatestTorrents::class,
|
||||||
|
UserTrend::class,
|
||||||
|
TorrentTrend::class,
|
||||||
|
UserStat::class,
|
||||||
|
UserClassStat::class,
|
||||||
|
TorrentStat::class,
|
||||||
|
SystemInfo::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -788,6 +788,15 @@ function get_user_id()
|
|||||||
return auth()->user()->id ?? 0;
|
return auth()->user()->id ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_user_passkey()
|
||||||
|
{
|
||||||
|
if (IN_NEXUS) {
|
||||||
|
global $CURUSER;
|
||||||
|
return $CURUSER["passkey"] ?? "";
|
||||||
|
}
|
||||||
|
return auth()->user()->passkey ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
function get_pure_username()
|
function get_pure_username()
|
||||||
{
|
{
|
||||||
if (IN_NEXUS) {
|
if (IN_NEXUS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user