qifengquan há 1 ano atrás
pai
commit
ef395daa36
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      application/api/controller/Index.php

+ 4 - 1
application/api/controller/Index.php

@@ -138,6 +138,7 @@ class Index extends Api
     public function unlockProgress(){
         $type = input('type');
         $uid = $this->auth->id;
+        $uid==input('nid')?$this->error('违规操作'):'';
         if($type > 1) {
             $user = Unlockprogress::where(['uid'=>$this->auth->id,'nid'=>input('nid')])->find();
             if(isset($user)){
@@ -310,7 +311,7 @@ class Index extends Api
         }
         //查看
         $look = Like::get(['uid'=>$this->auth->id,'nid'=>input('id')]);
-        if(!$look){
+        if(!$look && $this->auth->id!=input('id')){
             $look = [
                 'uid'=>$this->auth->id,
                 'nid'=>input('id'),
@@ -333,6 +334,7 @@ class Index extends Api
      */
     public function like(){
         $uid = $this->auth->id;
+        $uid==input('nid')?$this->error('不可喜欢自己'):'';
         if($this->auth->score > 0){
             $data = [
                 'uid'=>$uid,
@@ -377,6 +379,7 @@ class Index extends Api
      * @param (name="id",description='解锁用户id')
      */
     public function unlockWx(){
+        $this->auth->id==input('id')?$this->error('违规操作'):'';
         $cost = config('site.expenditure_grain')['申请认识支出'];
         if($cost>$this->auth->money)$this->error('余额不足');
         $apply_=Apply::where(['nid'=>input('id'),'status'=>0])->find();