From 487016e037467582883acd90a517309fb65128e1 Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Thu, 30 Apr 2026 14:39:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=BF=9C=E7=A8=8B=E9=AA=8C=E8=AF=81token?= =?UTF-8?q?=E6=9C=89=E6=95=88=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/v1/Playx.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/api/controller/v1/Playx.php b/app/api/controller/v1/Playx.php index 53440de..779f7e8 100644 --- a/app/api/controller/v1/Playx.php +++ b/app/api/controller/v1/Playx.php @@ -466,8 +466,20 @@ class Playx extends Api $code = $res->getStatusCode(); $data = json_decode(strval($res->getBody()), true); if ($code !== 200 || empty($data['user_id'])) { - $remoteMsg = $data['message'] ?? ''; - $msg = is_string($remoteMsg) && $remoteMsg !== '' ? $remoteMsg : __('Token expiration'); + $remoteMsg = ''; + if (is_array($data)) { + $candidateMsg = $data['message'] ?? ($data['msg'] ?? ($data['error'] ?? '')); + if (is_string($candidateMsg) && $candidateMsg !== '') { + $remoteMsg = $candidateMsg; + } + } + if ($remoteMsg === '') { + $bodyText = strval($res->getBody()); + if ($bodyText !== '') { + $remoteMsg = mb_substr($bodyText, 0, 300); + } + } + $msg = $remoteMsg !== '' ? $remoteMsg : __('Token expiration'); return $this->error($msg, null, 0, ['statusCode' => 401]); }