request->header('Authorization'); if (!$jwt) { throw new CatchException("请登录", 600); } // 解析jwt $jwt = str_replace('Bearer ', '', $jwt); Log::debug("尝试解析Jwt: " . var_export($jwt, true)); $this->payload = $this->decodeJwt($jwt); // 调用用户自定义的初始化语句 if (method_exists($this, 'init')) { $this->init(); } } }