diff --git a/app/models/user.rb b/app/models/user.rb index 2ae3083d..6138f9b5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -577,15 +577,16 @@ class User < Principal # Find a user account by matching the exact login and then a case-insensitive # version. Exact matches will be given priority. #通过用户名查找相应的用户,若没有匹配到,则不区分大小写进行查询 + #修改:不再匹配不区分大小写情况 -zjc def self.find_by_login(login) if login.present? login = login.to_s # First look for an exact match user = where(:login => login).all.detect {|u| u.login == login} - unless user - # Fail over to case-insensitive if none was found - user = where("LOWER(login) = ?", login.downcase).first - end + #unless user + # # Fail over to case-insensitive if none was found + # user = where("LOWER(login) = ?", login.downcase).first + #end user end end