gq 7 yıl önce
ebeveyn
işleme
bc9b34b531

+ 1 - 1
server/app/Http/Controllers/Api/V1/InteractionController.php

xqd
@@ -457,7 +457,7 @@ class InteractionController extends Controller
         $login_user_id = $user->id;
         $dream = DreamInfoModel::find($dream_id);
        if (empty($dream)) return $this->error(ErrorCode::DREAM_NOT_EXIST);
-        if ($dream->user_id != $login_user_id) return $this->error(ErrorCode::OPERATION_FAILED);
+        if ($dream->user_id != $login_user_id) return $this->error(ErrorCode::NOT_ROOT);
         $interaction = InteractionInfo::find($interaction_id);
         if (empty($interaction)) return $this->error(ErrorCode::INTERACTION_NOT_EXIST);
         $interaction->black_list = $user_id.',';

+ 2 - 0
server/app/Services/Base/ErrorCode.php

xqd
@@ -74,9 +74,11 @@ final class ErrorCode {
     const verify = 1413;
     const OPERATION_SUCCESS = 200;
     const INTERACTION_NOT_EXIST = 2001;
+    const NOT_ROOT = 2002;
 
     //错误常量枚举
     private static $_msg = [
+        self::NOT_ROOT => '没有操作权限',
         self::DREAM_NOT_EXIST => '梦想不存在',
         self::INTERACTION_NOT_EXIST => '动态不存在',
         self::DREAM_STATUS => '梦想暂未实现',