Browse Source

设置权限接口

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

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

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