mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 15:10:54 +00:00
1. 全面改写项目-管理面板的路由; 2. 拆分过于Contoller; 3. 优化了按钮过多的图表的显示; 4. 初步应用 Laravel的 表单验证功能; 5. 初步应用 Laravel的 component 功能 拆分/模块化前端代码; 6. 优化部分系统的判断逻辑; 7. 针对2.4.0以前的面板,追加辅助矫正数据库的sql文件;
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs\VNet;
|
|
|
|
use GuzzleHttp\Client;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class delUser implements ShouldQueue
|
|
{
|
|
use Dispatchable;
|
|
use InteractsWithQueue;
|
|
use Queueable;
|
|
use SerializesModels;
|
|
|
|
private $userIds;
|
|
private $nodes;
|
|
|
|
public function __construct($userIds, $nodes)
|
|
{
|
|
$this->userIds = $userIds;
|
|
$this->nodes = $nodes;
|
|
}
|
|
|
|
public function handle(): void
|
|
{
|
|
foreach ($this->nodes as $node) {
|
|
$this->send(($node->server ?: $node->ip).':'.$node->push_port, $node->auth->secret);
|
|
}
|
|
}
|
|
|
|
private function send($host, $secret): void
|
|
{
|
|
$client = new Client([
|
|
'base_uri' => $host,
|
|
'timeout' => 15,
|
|
'headers' => ['secret' => $secret],
|
|
]);
|
|
|
|
if (is_array($this->userIds)) {
|
|
$client->post('api/v2/user/del/list', ['json' => $this->userIds]);
|
|
} else {
|
|
$client->post('api/user/del/'.$this->userIds);
|
|
}
|
|
}
|
|
}
|