wugg 3 years ago
parent
commit
c324f7332e
1 changed files with 5 additions and 5 deletions
  1. 5 5
      app/admin/controller/Share.php

+ 5 - 5
app/admin/controller/Share.php

@@ -94,7 +94,7 @@ class Share extends BaseController
         $user = isset($post['userid']) ? intval($post['userid']):"";
         $touser = isset($post['touserid']) ? intval($post['touserid']):"";
         $togroup = isset($post['togroupid']) ? intval($post['togroupid']):"";
-        $action = isset($post['action']) ? intval($post['action']):"";
+        $action = isset($post['action'])&&$post['action']!=='' ? trim($post['action']):"";
         if($collect==""){
             return error_show(1002,"菜单数据不能为空");
         }
@@ -104,9 +104,6 @@ class Share extends BaseController
         if($touser=="" && $togroup==""){
             return error_show(1004,"共享用户或用户组不能为空");
         }
-        if($action===""){
-            return error_show(1005,"共享数据权限不能为空");
-        }
         $data=[
             "action_collect"=>$collect,
             "share_user"=>$user,
@@ -139,6 +136,9 @@ class Share extends BaseController
             return error_show($effetc['code'],$effetc['message']);
         }
         $id = isset($post['id'])&&$post['id']!="" ? intval($post['id']):"";
+        if($id===""){
+            return error_show(1002,"参数id不能为空");
+        }
         $collect = isset($post['collect'])&&$post['collect']!="" ? trim($post['collect']):"";
         $user = isset($post['userid'])&&$post['userid']!="" ? intval($post['userid']):"";
         $touser = isset($post['touserid'])&&$post['touserid']!="" ? intval($post['touserid']):"";
@@ -250,7 +250,7 @@ class Share extends BaseController
         if(!$info){
             return error_show(1002,"未找到对应数据");
         }
-        $status =  isset($post['status']) && $post['status']!=""? intval($post['status']):"";
+        $status =  isset($post['status']) && $post['status']!==""? intval($post['status']):"";
         if($status===""){
             return error_show(1002,"参数status 不能为空");
         }