diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 9c3847b3c..e558e657c 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -18,7 +18,7 @@ class MyshixunsController < ApplicationController # REDO等删除是否可以做成异步 # 前段需要按照操作过程提示 def reset_my_game - unless (current_user.admin? || current_user.id == @myshixun.user_id) + unless current_user.admin? tip_exception("403", "") end diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index c73fec500..bb7059af6 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -81,6 +81,9 @@ class SubjectsController < ApplicationController @tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq # 用户获取的实训标签 @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq + + # 访问数变更 + @subject.increment!(:visits) end def create