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
新增:检查用户id的接口
pull/343/head
yystopf
3 years ago
parent
71862ba6d6
commit
a38ebeaca2
2 changed files
with
7 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
app/controllers/api/v1/users_controller.rb
+1
-0
config/routes/api.rb
+ 6
- 0
app/controllers/api/v1/users_controller.rb
View File
@@ -42,6 +42,12 @@ class Api::V1::UsersController < Api::V1::BaseController
end
end
def check_user_id
id = params[:user_id]
return tip_exception(-1, "用户ID不存在") unless User.exists?(id: id)
render_ok
end
def check_password
password = params[:password]
return tip_exception(-5, "8~16位密码,支持字母数字和符号") unless password =~ CustomRegexp::PASSWORD
+ 1
- 0
config/routes/api.rb
View File
@@ -5,6 +5,7 @@ defaults format: :json do
resource :users, path: '/', only: [:update, :edit, :destroy] do
collection do
get :send_email_vefify_code
post :check_user_id
post :check_password
post :check_email
post :check_email_verify_code
Write
Preview
Loading…
Cancel
Save