This commit is contained in:
jasder 2021-07-06 10:43:55 +08:00
parent 133eed6afe
commit 877ef54b24
1 changed files with 1 additions and 11 deletions

View File

@ -26,14 +26,6 @@ class Gitea::User::RegisterService < Gitea::ClientService
}
end
def json_format(status, message, body)
case status
when 201 then success(body)
else
error(message, status)
end
end
def response_payload(response)
status = response.status
body = response&.body
@ -44,14 +36,12 @@ class Gitea::User::RegisterService < Gitea::ClientService
def status_payload(status, body)
case status
when 201 then success(body)
when 201 then success(json_parse!(body))
when 403 then error("你没有权限操作!")
when 400 then error("服务器开小差了")
when 422
body = json_parse!(body)
message = body['message']
puts "422 。。。。。 #{body}"
puts "body messge : 00000000000 #{body['message']}"
if message.include?('email')
error("邮箱#{email}已被注册")
elsif message.include?('name')