Browse Source

fix: replace undefined PANEL_NAME and PANEL_VERSION constants

Anankke 3 months ago
parent
commit
d865918cd8
2 changed files with 5 additions and 6 deletions
  1. 3 4
      src/Controllers/WebAPI/NodeController.php
  2. 2 2
      src/Services/IM/Discord.php

+ 3 - 4
src/Controllers/WebAPI/NodeController.php

@@ -12,8 +12,7 @@ use Slim\Http\Response;
 use Slim\Http\ServerRequest;
 use function json_decode;
 use const JSON_UNESCAPED_SLASHES;
-use const PANEL_NAME;
-use const PANEL_VERSION;
+use const VERSION;
 
 final class NodeController extends BaseController
 {
@@ -38,8 +37,8 @@ final class NodeController extends BaseController
             'sort' => $node->sort,
             'server' => $node->server,
             'custom_config' => json_decode($node->custom_config, true, JSON_UNESCAPED_SLASHES),
-            'type' => PANEL_NAME,
-            'version' => PANEL_VERSION,
+            'type' => $_ENV['appName'],
+            'version' => VERSION,
         ];
 
         return ResponseHelper::successWithDataEtag($request, $response, $data);

+ 2 - 2
src/Services/IM/Discord.php

@@ -8,7 +8,7 @@ use App\Models\Config;
 use Exception;
 use GuzzleHttp\Client;
 use GuzzleHttp\Exception\GuzzleException;
-use const PANEL_VERSION;
+use const VERSION;
 
 final class Discord extends Base
 {
@@ -29,7 +29,7 @@ final class Discord extends Base
     {
         $headers = [
             'Authorization' => "Bot {$this->token}",
-            'User-Agent' => 'DiscordBot (' . $_ENV['appName'] . ', ' . PANEL_VERSION . ')',
+            'User-Agent' => 'DiscordBot (' . $_ENV['appName'] . ', ' . VERSION . ')',
             'Content-Type' => 'application/json',
         ];