mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-03-13 00:08:14 -04:00
fix: correct know file issues
This commit is contained in:
parent
cd7c1ca34b
commit
720aa415ac
@ -89,8 +89,8 @@ class StatController extends Controller
|
||||
'paid_count' => 0,
|
||||
'commission_total' => 0,
|
||||
'commission_count' => 0,
|
||||
'start_date' => $request->input('start_date', date('Y-m-d', $statistics->last()->record_at)),
|
||||
'end_date' => $request->input('end_date', date('Y-m-d', $statistics->first()->record_at)),
|
||||
'start_date' => $request->input('start_date', date('Y-m-d', $statistics->last()?->record_at)),
|
||||
'end_date' => $request->input('end_date', date('Y-m-d', $statistics->first()?->record_at)),
|
||||
'avg_paid_amount' => 0,
|
||||
'avg_commission_amount' => 0
|
||||
];
|
||||
|
@ -185,11 +185,12 @@ class Server extends Model
|
||||
|
||||
$this->password = $user->uuid;
|
||||
|
||||
if (!isset($this->cipher) || !isset(self::CIPHER_CONFIGURATIONS[$this->cipher])) {
|
||||
$cipher = data_get($this, 'protocol_settings.cipher');
|
||||
if (!$cipher || !isset(self::CIPHER_CONFIGURATIONS[$cipher])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$config = self::CIPHER_CONFIGURATIONS[$this->cipher];
|
||||
$config = self::CIPHER_CONFIGURATIONS[$cipher];
|
||||
$serverKey = Helper::getServerKey($this->created_at, $config['serverKeySize']);
|
||||
$userKey = Helper::uuidToBase64($user->uuid, $config['userKeySize']);
|
||||
$this->password = "{$serverKey}:{$userKey}";
|
||||
|
@ -130,7 +130,7 @@ class ClashMeta implements ProtocolInterface
|
||||
$array['server'] = $server['host'];
|
||||
$array['port'] = $server['port'];
|
||||
$array['cipher'] = data_get($server['protocol_settings'], 'cipher');
|
||||
$array['password'] = $password;
|
||||
$array['password'] = data_get($server, 'password', $password);
|
||||
$array['udp'] = true;
|
||||
return $array;
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ class General implements ProtocolInterface
|
||||
{
|
||||
$protocol_settings = $server['protocol_settings'];
|
||||
$name = rawurlencode($server['name']);
|
||||
$password = data_get($server, 'password', $password);
|
||||
$str = str_replace(
|
||||
['+', '/', '='],
|
||||
['-', '_', ''],
|
||||
|
@ -44,6 +44,7 @@ class QuantumultX implements ProtocolInterface
|
||||
public static function buildShadowsocks($password, $server)
|
||||
{
|
||||
$protocol_settings = $server['protocol_settings'];
|
||||
$password = data_get($server, 'password', $password);
|
||||
$config = [
|
||||
"shadowsocks={$server['host']}:{$server['port']}",
|
||||
"method={$protocol_settings['cipher']}",
|
||||
|
@ -60,6 +60,7 @@ class Shadowrocket implements ProtocolInterface
|
||||
{
|
||||
$protocol_settings = $server['protocol_settings'];
|
||||
$name = rawurlencode($server['name']);
|
||||
$password = data_get($server, 'password', $password);
|
||||
$str = str_replace(
|
||||
['+', '/', '='],
|
||||
['-', '_', ''],
|
||||
|
@ -107,7 +107,7 @@ class SingBox implements ProtocolInterface
|
||||
$array['server'] = $server['host'];
|
||||
$array['server_port'] = $server['port'];
|
||||
$array['method'] = data_get($server, 'protocol_settings.cipher');
|
||||
$array['password'] = $password;
|
||||
$array['password'] = data_get($server, 'password', $password);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
@ -40,7 +40,9 @@ class ServerService
|
||||
$server->loadParentCreatedAt();
|
||||
$server->handlePortAllocation();
|
||||
$server->loadServerStatus();
|
||||
$server->server_key = Helper::getServerKey($server->created_at, 16);
|
||||
if ($server->type === 'shadowsocks') {
|
||||
$server->server_key = Helper::getServerKey($server->created_at, 16);
|
||||
}
|
||||
$server->generateShadowsocksPassword($user);
|
||||
|
||||
return $server;
|
||||
@ -48,6 +50,10 @@ class ServerService
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据权限组获取可用的用户列表
|
||||
* @param array $groupIds
|
||||
|
Loading…
Reference in New Issue
Block a user