From cbb4e51da2225c9e58d75fb59276f305d1530a88 Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 5 May 2024 13:19:28 +0000 Subject: [PATCH] bug fix, wrong error message when api call failed --- themes/tajian/controller/FrontapiController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 5339800..bb3579b 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -500,8 +500,13 @@ eof; $res = $this->request($api, json_encode($params), $timeout, $pc, $headers); if (!empty($res) && $res['status'] == 200) { - $code = 1; - $msg = '短信验证码已成功发送'; + $resData = json_decode($res['result'], true); + if ($resData['code'] == 1) { + $code = 1; + $msg = '短信验证码已成功发送'; + }else { + $err = '短信验证码发送失败:' . $resData['message']; + } }else { $err = '短信验证码发送失败,请稍后再试'; }