Forráskód Böngészése

1,已删除数据url状态码改为404。
2,其他细节。

magicblack 5 éve
szülő
commit
90588c5727

+ 23 - 9
application/common/controller/All.php

@@ -2,6 +2,7 @@
 namespace app\common\controller;
 use think\Controller;
 use think\Cache;
+use think\Request;
 
 class All extends Controller
 {
@@ -92,6 +93,19 @@ class All extends Controller
         $this->assign( ['maccms'=>$maccms] );
     }
 
+    protected function page_error($msg='发生错误')
+    {
+        $url = Request::instance()->isAjax() ? '' : 'javascript:history.back(-1);';
+        $wait = 3;
+        $this->assign('url',$url);
+        $this->assign('wait',$wait);
+        $this->assign('msg',$msg);
+        $html = $this->label_fetch('public/jump');
+        header("HTTP/1.1 404 Not Found");
+        header("Status: 404 Not Found");
+        exit($html);
+    }
+
     protected function label_user()
     {
         if(ENTRANCE != 'index'){
@@ -162,7 +176,7 @@ class All extends Controller
         if(empty($info)) {
             $res = mac_label_actor_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);;
             }
             $info = $res['info'];
         }
@@ -208,7 +222,7 @@ class All extends Controller
         if(empty($info)) {
             $res = mac_label_role_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);;
             }
             $info = $res['info'];
         }
@@ -226,7 +240,7 @@ class All extends Controller
         if(empty($info)) {
             $res = mac_label_website_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);;
             }
             $info = $res['info'];
         }
@@ -282,7 +296,7 @@ class All extends Controller
         if(empty($info)) {
             $res = mac_label_topic_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);;
             }
             $info = $res['info'];
         }
@@ -302,7 +316,7 @@ class All extends Controller
         if(empty($info)) {
             $res = mac_label_art_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);;
             }
             $info = $res['info'];
         }
@@ -346,8 +360,8 @@ class All extends Controller
         $this->assign('param',$param);
         if(empty($info)) {
             $res = mac_label_vod_detail($param);
-            if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+            if ($res['code'] > 1){
+                $this->page_error($res['msg']);
             }
             $info = $res['info'];
         }
@@ -383,7 +397,7 @@ class All extends Controller
         if (empty($info)) {
             $res = mac_label_vod_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);
             }
             $info = $res['info'];
         }
@@ -404,7 +418,7 @@ class All extends Controller
         if(empty($info)) {
             $res = mac_label_vod_detail($param);
             if ($res['code'] > 1) {
-                return $this->error($res['msg']);
+                $this->page_error($res['msg']);
             }
             $info = $res['info'];
         }

+ 7 - 0
template/default_pc/html/index/index.html

@@ -85,6 +85,13 @@
         </p>
     </blockquote>
 
+    <h2>用户模块</h2>
+    <blockquote>
+        <p>
+            进入用户中心: <a target="_blank" href="{:mac_url('user/index')}">{:mac_url('user/index')}</a><br>
+        </p>
+    </blockquote>
+
     <h2>其他</h2>
     <blockquote>
         <p>