错误提示页面导航栏添加

登陆时自动忽略登陆名前后空格
This commit is contained in:
z9hang 2014-08-01 16:01:16 +08:00
parent 0d46c63c54
commit acb41158e7
2 changed files with 2 additions and 2 deletions

View File

@ -525,7 +525,7 @@ class ApplicationController < ActionController::Base
# #
# @return [boolean, string] name of the layout to use or false for no layout # @return [boolean, string] name of the layout to use or false for no layout
def use_layout def use_layout
request.xhr? ? false : 'base' request.xhr? ? false : 'users_base'
end end
def invalid_authenticity_token def invalid_authenticity_token

View File

@ -324,7 +324,7 @@ class User < Principal
# Returns the user that matches provided login and password, or nil # Returns the user that matches provided login and password, or nil
#登录,返回用户名与密码匹配的用户 #登录,返回用户名与密码匹配的用户
def self.try_to_login(login, password) def self.try_to_login(login, password)
login = login.to_s login = login.to_s.lstrip.rstrip
password = password.to_s password = password.to_s
# Make sure no one can sign in with an empty login or password # Make sure no one can sign in with an empty login or password