Go.php 784 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace addons\cms\controller;
  3. use addons\cms\model\Autolink;
  4. /**
  5. * 跳转控制器
  6. * Class Go
  7. * @package addons\cms\controller
  8. */
  9. class Go extends Base
  10. {
  11. protected $noNeedLogin = ['*'];
  12. protected $layout = 'default';
  13. public function index()
  14. {
  15. $url = $this->request->get("url", "");
  16. $id = $this->request->get("id/d", "0");
  17. if ($id) {
  18. $autolink = Autolink::get($id);
  19. if ($autolink) {
  20. $autolink->setInc("views");
  21. }
  22. }
  23. //$this->redirect($url);
  24. return '
  25. <!doctype html>
  26. <html>
  27. <head>
  28. <meta charset="utf-8">
  29. <meta name="referrer" content="never">
  30. <title></title>
  31. </head>
  32. <body>
  33. <script>
  34. location.href="' . $url . '";
  35. </script>
  36. </body>
  37. </html>';
  38. }
  39. }