From aa4dbf0f06ce1904adf0d9f25c35f3b4feddfa34 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 11 Jul 2019 16:31:18 +0800 Subject: [PATCH 1/3] account manange not check profile complete --- app/controllers/users/base_account_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/users/base_account_controller.rb b/app/controllers/users/base_account_controller.rb index b693eaab5..29de52b26 100644 --- a/app/controllers/users/base_account_controller.rb +++ b/app/controllers/users/base_account_controller.rb @@ -4,4 +4,12 @@ class Users::BaseAccountController < Users::BaseController def observed_user @_observed_user ||= (User.find_by_id(params[:account_id]) || User.find_by_login(params[:account_id])) end + + private + + def require_login + return if User.current.logged? + + tip_exception(401, "..") + end end From a50cbc9e0bd4274208dbb0674c437ef913ef404d Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 11 Jul 2019 16:35:34 +0800 Subject: [PATCH 2/3] fix --- app/controllers/users/accounts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/accounts_controller.rb b/app/controllers/users/accounts_controller.rb index e88ff4564..dff5115e1 100644 --- a/app/controllers/users/accounts_controller.rb +++ b/app/controllers/users/accounts_controller.rb @@ -1,4 +1,4 @@ -class Users::AccountsController < Users::BaseController +class Users::AccountsController < Users::BaseAccountController before_action :private_user_resources! def show From 2f5f0cef16da9201934e34513dd9fd51310ea7ab Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 11 Jul 2019 16:36:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 6ffc7f0ce..929af8f47 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -710,10 +710,10 @@ class GamesController < ApplicationController resubmit_identifier = @game.resubmit_identifier # 如果没有超时并且正在评测中 # 判断评测中的状态有两种:1、如果之前没有通关的,只需判断status为1即可;如果通过关,则判断game的resubmit_identifier是否更新 - uid_logger("################game_status: #{@game.status}") - uid_logger("################params[:resubmit]: #{params[:resubmit]}") - uid_logger("################resubmit_identifier: #{resubmit_identifier}") - uid_logger("################time_out: #{params[:time_out]}") + # uid_logger("################game_status: #{@game.status}") + # uid_logger("################params[:resubmit]: #{params[:resubmit]}") + # uid_logger("################resubmit_identifier: #{resubmit_identifier}") + # uid_logger("################time_out: #{params[:time_out]}") if (params[:time_out] == "false") && ((params[:resubmit].blank? && @game.status == 1) || (params[:resubmit].present? && (params[:resubmit] != resubmit_identifier))) # 代码评测的信息