Browse Source

FIX bug

pull/141/head
jasder 5 years ago
parent
commit
877ef54b24
1 changed files with 1 additions and 11 deletions
  1. +1
    -11
      app/services/gitea/user/register_service.rb

+ 1
- 11
app/services/gitea/user/register_service.rb 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')


Loading…
Cancel
Save