问答详情
源自:-

jwtmiddle中间件,走user/info直接报错

Argument 1 passed to Illuminate\Routing\Middleware\ThrottleRequests::addHeaders() must be an instance of Symfony\Component\HttpFoundation\Response, string given, called in D:\blog\vendor\laravel\framework\src\Illuminate\Routing\Middleware\ThrottleRequests.php on line 62

提问者:Smauel 2019-04-18 20:45

个回答

  • wulekong
    2019-04-19 10:08:05

    jwtmiddle是怎么写的呢,看这个报错应该是在下一层的中间件报错了

  • qq_慕少6273961
    2020-04-25 00:52:22

    public function jsonSuccessData($data = []){
        return $this->jsonResponse(0,'Success',$data);
    }
    public function  jsonResponse($code,$message,$data){
        $content = [
            'code'=>$code,
            'msg'=>$message,
            'data'=>$data,
        ];
    
       return response()->json($content);
    
    }


  • qq_慕少6273961
    2020-04-25 00:51:45

    public function jsonSuccessData($data = []){
        return $this->jsonResponse(0,'Success',$data);
    }
    public function  jsonResponse($code,$message,$data){
        $content = [
            'code'=>$code,
            'msg'=>$message,
            'data'=>$data,
        ];
    
       return response()->json($content);
    
    }


  • Smauel
    2019-04-19 10:18:02

    https://img2.mukewang.com/5cb92fb1000119e307730506.jpg和老师的一样,postman测试user/login是正确的,到user/info就报错了