dev_aliyun
cxt 6 years ago
parent 4314222b12
commit f4e70aa7a8

@ -1188,4 +1188,12 @@ class ApplicationController < ActionController::Base
logger.info "----------------------- handle_flag: #{flag} -------------------------" logger.info "----------------------- handle_flag: #{flag} -------------------------"
flag flag
end end
# 用户是否完善资料
def check_account
if !User.current.profile_completed?
redirect_to my_account_path(need_profile_completed: true)
end
end
end end

@ -3,7 +3,7 @@ class LibrariesController < ApplicationController
layout 'base_library' layout 'base_library'
before_filter :require_login, :except => [:index, :show] before_filter :require_login, :except => [:index, :show]
before_filter :check_authentication, except: [:index, :show] before_filter :check_account, only: [:new, :create]
after_filter :increment_visit_count, only: [:show, :create, :edit, :update] after_filter :increment_visit_count, only: [:show, :create, :edit, :update]
def index def index

@ -4,7 +4,7 @@ class ProjectPackagesController < ApplicationController
include ApplicationHelper include ApplicationHelper
before_filter :require_login, except: [:index] before_filter :require_login, except: [:index]
before_filter :check_authentication, except: [:index] before_filter :check_account, only: [:new, :create]
def show def show
render_react render_react

@ -30,6 +30,7 @@ class ProjectsController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:training_task_status] skip_before_filter :verify_authenticity_token, :only => [:training_task_status]
skip_before_filter :check_if_login_required, :only => [:training_task_status] skip_before_filter :check_if_login_required, :only => [:training_task_status]
before_filter :check_authentication before_filter :check_authentication
before_filter :check_account, only: [:new, :create]
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise, before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,
:view_homework_attaches,:join_project, :project_home, :training_execute, :training_task_status] :view_homework_attaches,:join_project, :project_home, :training_execute, :training_task_status]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]

Loading…
Cancel
Save