dingo 内部调用获取异常信息

 

$exception->getResponse();

 

$params = [
            'company_id' => $this->request->input('company_id'),
            'quantity' => $this->request->input('quantity'),
            'sku_id' => $this->request->input('sku_id'),
            'type' => $this->request->input('type', 0),
        ];

        $user = User::find(50068);

        $dispatcher = app('Dingo\Api\Dispatcher');

        try {
            $res = $dispatcher->be($user)->with($params)
                ->post('api/order/cart');

            return $res;
        } catch (InternalHttpException $internalHttpException) {
            return $internalHttpException->getResponse();
        }

  

posted @ 2018-11-06 10:55  佚名000  阅读(155)  评论(0编辑  收藏  举报