This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
Gitlink
/
forgeplus
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
16
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
fixed 注册登录类型
tags/v4.0.0^2
xiaoxiaoqiong
4 years ago
parent
df69dee282
commit
2ca77732c8
2 changed files
with
8 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
app/forms/base_form.rb
+2
-1
app/forms/register/form.rb
+ 6
- 0
app/forms/base_form.rb
View File
@@ -50,4 +50,10 @@ class BaseForm
def strip(str)
str.to_s.strip.presence
end
# 1 手机类型;0 邮箱类型
# 注意新版的login是自动名生成的
def phone_mail_type value
value =~ /^1\d{10}$/ ? 1 : 0
end
end
+ 2
- 1
app/forms/register/form.rb
View File
@@ -10,7 +10,8 @@ module Register
def check!
Rails.logger.info "Register::Form params: code: #{code}; login: #{login}; namespace: #{namespace}; password: #{password}; type: #{type}"
db_verifi_code =
type = phone_mail_type(strip(login))
db_verifi_code =
if type == 1
check_phone(login)
VerificationCode.where(phone: login, code: code, code_type: 1).last
Write
Preview
Loading…
Cancel
Save