Browse Source

fixed 注册时支持中划线的邮箱地址

pull/338/head
xxq250 2 years ago
parent
commit
6f01ce170e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/application_controller.rb

+ 1
- 1
app/controllers/application_controller.rb View File

@@ -81,7 +81,7 @@ class ApplicationController < ActionController::Base
# 判断用户的邮箱或者手机是否可用
# 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}$/
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/ || login =~ /^1\d{10}$/
tip_exception(-2, "请输入正确的手机号或邮箱")
end


Loading…
Cancel
Save