|
|
|
@ -92,7 +92,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 判断用户的邮箱或者手机是否可用
|
|
|
|
|
# params[:type] 1: 注册;2:忘记密码
|
|
|
|
|
# params[:type] 1: 注册;2:忘记密码;3:绑定
|
|
|
|
|
def check_mail_and_phone_valid login, type
|
|
|
|
|
unless login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ || login =~ /^1\d{10}$/ ||
|
|
|
|
|
login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])$/
|
|
|
|
@ -104,6 +104,8 @@ class ApplicationController < ActionController::Base
|
|
|
|
|
tip_exception(-2, "该手机号码或邮箱已被注册")
|
|
|
|
|
elsif type.to_i == 2 && user.nil?
|
|
|
|
|
tip_exception(-2, "该手机号码或邮箱未注册")
|
|
|
|
|
elsif type.to_i == 3 && user.present?
|
|
|
|
|
tip_exception(-2, "该手机号码或邮箱已绑定")
|
|
|
|
|
end
|
|
|
|
|
sucess_status
|
|
|
|
|
end
|
|
|
|
|