get_user_passkey()

This commit is contained in:
xiaomlove
2024-10-10 03:05:34 +08:00
parent 9fec1a7ede
commit 24936277db
3 changed files with 36 additions and 11 deletions
+2 -11
View File
@@ -100,17 +100,8 @@ class Test extends Command
*/
public function handle()
{
$url = "http://127.0.0.1:7777/list-seeder-leecher-count";
$idArr = [8, 12];
$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";
}
$ip = "116.77.75.254";
$this->info(inet_pton($ip));
}
}
+25
View File
@@ -1,7 +1,32 @@
<?php
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
{
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,
];
}
}
+9
View File
@@ -788,6 +788,15 @@ function get_user_id()
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()
{
if (IN_NEXUS) {