laravel5.4使用自带的auth:api,认证的时候,TokenGuard.php文件里,数据输出有问题

laravel5.4 TokenGuard.php文件里,通过设置生成的token的格式,判断有误token有无过期。

但是走 return response()->json();时,没有返回 ['status'=>2, 'message'=>'failure', 'data'=>'登录超时'],我想获得 response数据


public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (! is_null($this->user)) {
            return $this->user;
        }
        $user = null;
        $token = $this->getTokenForRequest();
        if (! empty($token)) {
            // 新增 判断api_token的时效性
            // api_token事例: PuQHMX7sgqjJ1Dx0d9uOosHjO6QCxECP_1505093728
            if(!LoginService::TokenIsValid($token)) {
                return response()->json(['status'=>2, 'message'=>'failure', 'data'=>'登录超时'], 200);
            } 
            $user = $this->provider->retrieveByCredentials(
                [$this->storageKey => $token]
            );   
        }
        return $this->user = $user;
    }

代码贴出:
image
麻烦大家 帮我看下,谢谢!!

JellyBool
修改的评论也不能少于六个字哦!
xinhaonaner 回复 JellyBool
修改的评论也不能少于六个字哦!
JellyBool 回复 xinhaonaner
修改的评论也不能少于六个字哦!
xinhaonaner
修改的评论也不能少于六个字哦!
xinhaonaner
修改的评论也不能少于六个字哦!