未登录时,竞赛页面点击左侧导航栏“提交”不应报没有权限,应该跳转到登录页面

This commit is contained in:
cxt 2017-03-03 16:38:10 +08:00
parent 181ccbf287
commit 2dab7d81ff
1 changed files with 5 additions and 1 deletions

View File

@ -300,7 +300,11 @@ class WorksController < ApplicationController
#当前用户是不是竞赛的成员
def member_of_contest
render_403 unless @contest.is_public==1 || User.current.member_of_contest?(@contest) || User.current.admin?
if !User.current.logged?
redirect_to signin_url
else
render_403 unless @contest.is_public==1 || User.current.member_of_contest?(@contest) || User.current.admin?
end
end
end