登陆时自动忽略登陆名前后空格
@ -525,7 +525,7 @@ class ApplicationController < ActionController::Base
#
# @return [boolean, string] name of the layout to use or false for no layout
def use_layout
request.xhr? ? false : 'base'
request.xhr? ? false : 'users_base'
end
def invalid_authenticity_token
@ -324,7 +324,7 @@ class User < Principal
# Returns the user that matches provided login and password, or nil
#登录,返回用户名与密码匹配的用户
def self.try_to_login(login, password)
login = login.to_s
login = login.to_s.lstrip.rstrip
password = password.to_s
# Make sure no one can sign in with an empty login or password