增加手机验证码校验
This commit is contained in:
parent
4e244bed3a
commit
5da6330f57
|
@ -75,7 +75,7 @@ class Api::V1::UsersController < Api::V1::BaseController
|
||||||
phone = strip(params[:phone])
|
phone = strip(params[:phone])
|
||||||
code_type = params[:code_type]
|
code_type = params[:code_type]
|
||||||
|
|
||||||
return tip_exception(-2, "手机号格式有误") unless mail =~ CustomRegexp::PHONE
|
return tip_exception(-2, "手机号格式有误") unless phone =~ CustomRegexp::PHONE
|
||||||
|
|
||||||
verifi_code = VerificationCode.where(phone: phone, code: code, code_type: code_type).last
|
verifi_code = VerificationCode.where(phone: phone, code: code, code_type: code_type).last
|
||||||
return render_ok if code == "123123" && EduSetting.get("code_debug") # 万能验证码,用于测试 # TODO 万能验证码,用于测试
|
return render_ok if code == "123123" && EduSetting.get("code_debug") # 万能验证码,用于测试 # TODO 万能验证码,用于测试
|
||||||
|
|
Loading…
Reference in New Issue