private function changeLink($url)
 {
     $arrResponse = json_decode(CurlToolkit::postRequest("http://dwz.cn/create.php", array('url' => $url)), true);
     if ($arrResponse['status'] != 0) {
         throw new \RuntimeException("短链接生成失败!");
     }
     $shortUrl = $arrResponse['tinyurl'] . ' ';
     return $shortUrl;
 }
 public function changeLinkAction(Request $request)
 {
     $url = $request->getHost();
     $url .= $request->query->get('url');
     $arrResponse = json_decode(CurlToolkit::postRequest("http://dwz.cn/create.php", array('url' => $url)), true);
     if ($arrResponse['status'] != 0) {
         throw new \RuntimeException("短链接生成失败!");
     }
     $shortUrl = $arrResponse['tinyurl'] . ' ';
     return $this->createJsonResponse(array('url' => $shortUrl));
 }