Browse Source

解決下發無用參數導致服務端報錯的問題

https://github.com/Anankke/SSPanel-Uim/issues/1369
兩足大貓貓 4 years ago
parent
commit
40f62c6958
3 changed files with 9 additions and 5 deletions
  1. 4 0
      app/routes.php
  2. 3 3
      src/Controllers/Mod_Mu/UserController.php
  3. 2 2
      src/Middleware/Mod_Mu.php

+ 4 - 0
app/routes.php

@@ -305,6 +305,10 @@ return function (SlimApp $app) {
         $this->get('/{token}',          App\Controllers\LinkController::class . ':GetContent');
     });
 
+    $app->group('/sub', function () {
+        $this->get('/{token}/{subtype}',          App\Controllers\SubController::class . ':index');
+    });
+
     $app->group('/getClient', function () {
         $this->get('/{token}', App\Controllers\UserController::class . ':getClientfromToken');
     });

+ 3 - 3
src/Controllers/Mod_Mu/UserController.php

@@ -84,13 +84,13 @@ class UserController extends BaseController
         $users = array();
 
         if ($node->sort == 14) {
-            $key_list = array('node_speedlimit', 'u', 'd', 'transfer_enable', 'id', 'node_connector', 'uuid', 'alive_ip');
+            $key_list = array('node_speedlimit', 'id', 'node_connector', 'uuid', 'alive_ip');
         } elseif ($node->sort == 11) {
-            $key_list = array('node_speedlimit', 'u', 'd', 'transfer_enable', 'id', 'node_connector', 'uuid', 'alive_ip');
+            $key_list = array('node_speedlimit', 'id', 'node_connector', 'uuid', 'alive_ip');
         } else {
             $key_list = array(
                 'method', 'obfs', 'obfs_param', 'protocol', 'protocol_param', 'node_speedlimit',
-                'is_multi_user', 'u', 'd', 'transfer_enable', 'id', 'port', 'passwd', 'node_connector', 'alive_ip'
+                'is_multi_user', 'id', 'port', 'passwd', 'node_connector', 'alive_ip'
             );
         }
 

+ 2 - 2
src/Middleware/Mod_Mu.php

@@ -29,7 +29,7 @@ class Mod_Mu
             // key 不存在
             return $response->withJson([
                 'ret'  => 0,
-                'data' => 'Token is invalid'
+                'data' => 'Token is invalid.'
             ]);
         }
 
@@ -37,7 +37,7 @@ class Mod_Mu
             // 主站不提供 WebAPI
             return $response->withJson([
                 'ret'  => 0,
-                'data' => 'We regret this service is temporarily unavailable'
+                'data' => 'WebAPI is disabled.'
             ]);
         }