Merge branch 'develop' of https://git.trustie.net/Gitlink/forgeplus into develop
This commit is contained in:
commit
655c85851f
|
@ -50,4 +50,10 @@ class BaseForm
|
|||
def strip(str)
|
||||
str.to_s.strip.presence
|
||||
end
|
||||
|
||||
# 1 手机类型;0 邮箱类型
|
||||
# 注意新版的login是自动名生成的
|
||||
def phone_mail_type value
|
||||
value =~ /^1\d{10}$/ ? 1 : 0
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,8 @@ module Register
|
|||
|
||||
def check!
|
||||
Rails.logger.info "Register::Form params: code: #{code}; login: #{login}; namespace: #{namespace}; password: #{password}; type: #{type}"
|
||||
db_verifi_code =
|
||||
type = phone_mail_type(strip(login))
|
||||
db_verifi_code =
|
||||
if type == 1
|
||||
check_phone(login)
|
||||
VerificationCode.where(phone: login, code: code, code_type: 1).last
|
||||
|
|
Loading…
Reference in New Issue