|
|
|
@@ -1,5 +1,11 @@ |
|
|
|
class Api::V1::UsersController < Api::V1::BaseController |
|
|
|
|
|
|
|
def check_user_id |
|
|
|
id = params[:user_id] |
|
|
|
return tip_exception(-1, "用户ID不存在") unless User.exists?(id: id) |
|
|
|
render_ok |
|
|
|
end |
|
|
|
|
|
|
|
before_action :load_observe_user |
|
|
|
before_action :check_auth_for_observe_user |
|
|
|
|
|
|
|
@@ -42,12 +48,6 @@ 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 |
|
|
|
|