解决用户登录名的.号问题
This commit is contained in:
parent
695ce6c2e4
commit
2b1a73e692
|
@ -323,8 +323,9 @@ class User < Principal
|
||||||
|
|
||||||
# id 转换成 登录名
|
# id 转换成 登录名
|
||||||
# 如果是整数就去ID,否则就取login
|
# 如果是整数就去ID,否则就取login
|
||||||
|
# 含有特殊符号的则显示ID
|
||||||
def to_param
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue