forked from Gitlink/forgeplus
修复:传值不正确
This commit is contained in:
parent
f8c066db77
commit
edd0634474
|
|
@ -101,11 +101,11 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def check_mail_valid mail, type
|
||||
unless login =~ /\A[a-zA-Z0-9]+([._\-\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+\z/
|
||||
unless mail =~ /\A[a-zA-Z0-9]+([._\-\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+\z/
|
||||
tip_exception(-2, "请输入正确的邮箱")
|
||||
end
|
||||
|
||||
user_exist = Owner.exists?(mail: login)
|
||||
user_exist = Owner.exists?(mail: mail)
|
||||
if user_exist && type.to_i == 1
|
||||
tip_exception(-2, "该邮箱已被注册")
|
||||
elsif type.to_i == 2 && !user_exist
|
||||
|
|
@ -116,12 +116,12 @@ class ApplicationController < ActionController::Base
|
|||
render_ok
|
||||
end
|
||||
|
||||
def check_phone_valid login, type
|
||||
unless login =~ /^1\d{10}$/
|
||||
def check_phone_valid phone, type
|
||||
unless phone =~ /^1\d{10}$/
|
||||
tip_exception(-2, "请输入正确的手机号")
|
||||
end
|
||||
|
||||
user_exist = Owner.exists?(phone: login)
|
||||
user_exist = Owner.exists?(phone: phone)
|
||||
if user_exist && type.to_i == 1
|
||||
tip_exception(-2, "该手机号码已被注册")
|
||||
elsif type.to_i == 2 && !user_exist
|
||||
|
|
|
|||
Loading…
Reference in New Issue