Browse Source

update trojan server

Tokumeikoi 4 years ago
parent
commit
a1ae4caee3
2 changed files with 5 additions and 3 deletions
  1. 2 2
      app/Http/Controllers/Server/TrojanTidalabController.php
  2. 3 1
      app/Utils/CacheKey.php

+ 2 - 2
app/Http/Controllers/Server/TrojanTidalabController.php

@@ -37,7 +37,7 @@ class TrojanTidalabController extends Controller
         if (!$server) {
             abort(500, 'fail');
         }
-        Cache::put(CacheKey::get('SERVER_LAST_CHECK_AT', $server->id), time(), 3600);
+        Cache::put(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server->id), time(), 3600);
         $serverService = new ServerService();
         $users = $serverService->getAvailableUsers(json_decode($server->group_id));
         $result = [];
@@ -69,7 +69,7 @@ class TrojanTidalabController extends Controller
         }
         $data = file_get_contents('php://input');
         $data = json_decode($data, true);
-        Cache::put(CacheKey::get('SERVER_ONLINE_USER', $server->id), count($data), 3600);
+        Cache::put(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server->id), count($data), 3600);
         $serverService = new ServerService();
         $userService = new UserService();
         foreach ($data as $item) {

+ 3 - 1
app/Utils/CacheKey.php

@@ -8,7 +8,9 @@ class CacheKey
         'EMAIL_VERIFY_CODE' => '邮箱验证吗',
         'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
         'SERVER_ONLINE_USER' => '节点在线用户',
-        'SERVER_LAST_CHECK_AT' => '节点最后检查时间'
+        'SERVER_LAST_CHECK_AT' => '节点最后检查时间',
+        'SERVER_TROJAN_ONLINE_USER' => 'trojan节点在线用户',
+        'SERVER_TROJAN_LAST_CHECK_AT' => 'trojan节点最后检查时间'
     ];
 
     public static function get(string $key, $uniqueValue)