Browse Source

bug fix, wrong error message when api call failed

master
filesite 7 months ago
parent
commit
cbb4e51da2
  1. 9
      themes/tajian/controller/FrontapiController.php

9
themes/tajian/controller/FrontapiController.php

@ -500,8 +500,13 @@ eof;
$res = $this->request($api, json_encode($params), $timeout, $pc, $headers); $res = $this->request($api, json_encode($params), $timeout, $pc, $headers);
if (!empty($res) && $res['status'] == 200) { if (!empty($res) && $res['status'] == 200) {
$code = 1; $resData = json_decode($res['result'], true);
$msg = '短信验证码已成功发送'; if ($resData['code'] == 1) {
$code = 1;
$msg = '短信验证码已成功发送';
}else {
$err = '短信验证码发送失败:' . $resData['message'];
}
}else { }else {
$err = '短信验证码发送失败,请稍后再试'; $err = '短信验证码发送失败,请稍后再试';
} }

Loading…
Cancel
Save