From 9fb5a85e0c44ba82d72250c75d8f2710bec4dc7d Mon Sep 17 00:00:00 2001 From: ypsdf1 Date: Thu, 26 Nov 2026 20:55:27 +0800 Subject: [PATCH] =?UTF-8?q?15m44z=20=E7=BB=AD=EF=BC=8820:54=EF=BC=89?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=20fresh=20flag=20=E8=B7=AF=E5=BE=84=20bug=20?= =?UTF-8?q?gh=5Foauth.php=20/=20gh=5Fcfg.php=EF=BC=9Adirname(=5F=5FDIR=5F?= =?UTF-8?q?=5F)=20=E8=AF=AF=E8=A7=A3=E6=9E=90=E5=88=B0=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E6=A0=B9=20/=EF=BC=8Cfresh=20flag=20=E5=86=99=E5=88=B0=20/gh?= =?UTF-8?q?=5Foauth=5Ffresh=EF=BC=88=E4=B8=8D=E5=AD=98=E5=9C=A8=EF=BC=89?= =?UTF-8?q?=EF=BC=9B=20=E6=94=B9=20=5F=5FDIR=5F=5F/..=20=3D=20/plugin?= =?UTF-8?q?=EF=BC=8Cflag=20=E6=96=87=E4=BB=B6=E5=86=99=E5=88=B0=20/plugin/?= =?UTF-8?q?gh=5Foauth=5Ffresh/=EF=BC=88=E5=B7=B2=20FTP=20=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=EF=BC=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/gh_cfg.php | 2 +- api/gh_oauth.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/gh_cfg.php b/api/gh_cfg.php index 237b41d..7dd5307 100644 --- a/api/gh_cfg.php +++ b/api/gh_cfg.php @@ -71,7 +71,7 @@ if ($cfg['gh_enabled'] && $probeTk !== '') { if ($trow && !empty($trow['access_token'])) { // ★ 15m44z 续(19:59 根治):OAuth 回调 fresh flag(10min,按玩家名)→ 免验活必有效。 // 彻底避开 CF 边缘 /user 验活偶发 401 把刚授权的有效 token 误判成「可能已失效」。 - $freshDir = dirname(__DIR__) . '/../gh_oauth_fresh'; + $freshDir = __DIR__ . '/../gh_oauth_fresh'; $freshFlag = $freshDir . '/' . md5($probePlayer) . '.json'; if (is_readable($freshFlag)) { if (is_array($ff) && (int)$ff['exp'] > time() && (string)($ff['player'] ?? '') === $probePlayer) { diff --git a/api/gh_oauth.php b/api/gh_oauth.php index 1a3b05f..a0c382f 100644 --- a/api/gh_oauth.php +++ b/api/gh_oauth.php @@ -205,7 +205,7 @@ if ($code !== '') { // ★ 15m44z 续(19:59 根治):OAuth 回调成功后写 fresh flag(短期 10min,按玩家名) // gh_cfg 读到 flag → 免 /user 验活直接判有效,彻底避开 CF 边缘偶发 401 把刚授权的有效 // token 误判成「token 可能已失效」。flag 路径 __DIR__/../gh_oauth_fresh/{player}.json - $freshDir = dirname(__DIR__) . '/../gh_oauth_fresh'; + $freshDir = __DIR__ . '/../gh_oauth_fresh'; @mkdir($freshDir, 0755, true); @file_put_contents($freshDir . '/' . md5($player) . '.json', json_encode([ 'player' => $player, 'ts' => time(), 'exp' => time() + 600,