diff --git a/app/services/watches_service.rb b/app/services/watches_service.rb index 2b9bed3cd..2aab7de81 100644 --- a/app/services/watches_service.rb +++ b/app/services/watches_service.rb @@ -1,7 +1,12 @@ +#coding=utf-8 class WatchesService def watch params @current_user = User.find(params[:current_user_id]) + if params[:object_type] == 'user' && params[:current_user_id] == params[:object_id] + raise '不能关注自己!' + end @watchables = find_watchables params + if @watchables.nil? raise '404' end