解决login中带特殊字符的问题

This commit is contained in:
huang 2016-11-14 16:35:15 +08:00
parent 5134418388
commit ddb747bfcb
1 changed files with 1 additions and 1 deletions

View File

@ -324,7 +324,7 @@ class User < Principal
# id 转换成 登录名
# 如果是整数就去ID否则就取login
def to_param
self.login.to_i.to_s == self.login ? id : login
(self.login.to_i.to_s == self.login || self.login.include?(".") || self.login.include?("%") || self.login.include?("?")) ? id : login
end