Browse Source

throw new修改

master
李可松 4 years ago
parent
commit
f78fc59f93
  1. 6
      app/Service/UploadMiniProgram.php

6
app/Service/UploadMiniProgram.php

@ -94,16 +94,16 @@ class UploadMiniProgram
$domain->modify($param); //服务器域名,服务器域名多次设置仅第一次成功,这里不校验返回结果正确性 $domain->modify($param); //服务器域名,服务器域名多次设置仅第一次成功,这里不校验返回结果正确性
$res = $domain->setWebviewDomain([$host]); //业务域名 $res = $domain->setWebviewDomain([$host]); //业务域名
if (!isset($res['errcode'], $res['errmsg']) || $res['errcode'] != 0 || $res['errmsg'] != 'ok') { if (!isset($res['errcode'], $res['errmsg']) || $res['errcode'] != 0 || $res['errmsg'] != 'ok') {
throw new Exception($agent->appid . "设置业务域名{$host}失败,原因:" . $res['errmsg'] ?? (is_array($res) ? join(',', $res) : '未知'));
throw new Exception("设置业务域名{$host}失败,原因:" . $res['errmsg'] ?? (is_array($res) ? join(',', $res) : '未知'));
} }
Redis::hset($redis_key, $agent->appid, 1); Redis::hset($redis_key, $agent->appid, 1);
} }
echo "上传成功,并已提交审核"; echo "上传成功,并已提交审核";
} else if (isset($audit_err_code[$res['errcode']])) { } else if (isset($audit_err_code[$res['errcode']])) {
throw new Exception($agent->appid . $audit_err_code[$res['errcode']]);
throw new Exception($audit_err_code[$res['errcode']]);
} else { } else {
throw new Exception($agent->appid . $res['errmsg'] ?? join(',', $res));
throw new Exception($res['errmsg'] ?? join(',', $res));
} }
} catch (Exception $e) { } catch (Exception $e) {
throw new Exception($agent->appid . $e->getMessage()); throw new Exception($agent->appid . $e->getMessage());

Loading…
Cancel
Save