fix: remote register validate

This commit is contained in:
2021-12-22 14:39:47 +08:00
parent e1a5918c22
commit 36b68df273
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
module Register
class RemoteForm < Register::BaseForm
# login 登陆方式,支持邮箱、登陆、手机号等
attr_accessor :username, :email, :password, :platform
validates :username, :email, :password, presence: true
validate :check!
def check!
Rails.logger.info "Register::RemoteForm params: username: #{username}; email: #{email}; password: #{password}; platform: #{platform}"
check_login(username)
check_mail(email)
check_password(password)
end
end
end