Browse Source

设置权限接口

lizhen_gitee 1 year ago
parent
commit
f35871d9a3
1 changed files with 4 additions and 8 deletions
  1. 4 8
      application/api/controller/User.php

+ 4 - 8
application/api/controller/User.php

@@ -436,17 +436,13 @@ class User extends Api
             $this->error('VIP才能设置隐私权限');
         }
 
-        $field = ['yinsi','yinshen','wuhen'];
-        $data = request_post_hub($field);
-
-        /*$data = [
+        $data = [
             'yinsi'   => input('yinsi',0),
             'yinshen' => input('yinshen',0),
             'wuhen'   => input('wuhen',0),
-        ];*/
-        if(!empty($data)){
-            $update_rs = Db::name('user_power')->where('id',$this->auth->id)->update($data);
-        }
+        ];
+
+        $update_rs = Db::name('user_power')->where('id',$this->auth->id)->update($data);
 
         $this->success();
     }