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