From 1d1d6ebda130a172aa0a110d21f52ab5bb823353 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 22 Aug 2023 13:59:02 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E6=B3=A8=E5=86=8C=E6=97=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=B8=AD=E5=88=92=E7=BA=BF=E7=9A=84=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 179f1a30a..8981a0995 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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