From 786cdc2bf016ebcd32e07a0402ef3f9c173b70bb Mon Sep 17 00:00:00 2001 From: tanghuijun <1953248054@qq.com> Date: Fri, 17 Jun 2022 17:33:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E8=BE=93?= =?UTF-8?q?=E5=87=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Goods.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index ac82077..dfe54ac 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -50,13 +50,13 @@ class Goods extends Base * @return string msg 返回信息 * @return int code 状态码 200:成功;>=400:失败 */ - public function getTypeGoods(){ + public function getTypeGoods(){ try { $params = ['type'=> 1]; - $result = $this->curl_request_post(env('APP.HOST').'/index.php/api/goods/getTypeGoods', $params); + $result = $this->curl_request_post('http://www.wenhuayun.com/index.php/api/goods/getTypeGoods', $params); return $result; }catch(\Exception $e){ - return _error($e->getMessage(), $e->getCode() ?: 400, $e); + echo json_encode(['code'=> 'failure', $e, 'msg'=> '请求失败']); exit(); } } @@ -88,7 +88,7 @@ class Goods extends Base $result = $goodsService->searchGoods($post); $end_time = microtime(true); //响应式结束计时 $userTime = $end_time-$start_time.'s'; - echo json_encode(['code'=>'success', 'msg'=>'成功', 'userTime'=>$userTime, 'data'=>$result]); exit(); + echo json_encode(['code'=>'success', 'msg'=>'成功', 'useTime'=>$userTime, 'data'=>$result]); exit(); }catch(\Exception $e){ echo json_encode(['code'=>'failure', 'msg'=>'请求失败']); exit(); }