getContent(); } public function setTargetUrl($url) { if ('' === ($url ?? '')) { throw new \InvalidArgumentException('无法跳转到空页面'); } $this->targetUrl = $url; $this->setContent( sprintf(' 正在跳转支付 %1$s ', htmlspecialchars($url, \ENT_QUOTES, 'UTF-8'))); $this->headers->set('Location', $url); return $this; } public function jsonSerialize() { return $this->getContent(); } public function serialize() { return serialize($this->content); } public function unserialize($serialized) { return $this->content = unserialize($serialized); } }