From 71bdde79ef2e353c18cac7fe4906a16833fcc89f Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 9 Oct 2024 15:55:42 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=20=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=B6issue=EF=BC=8Cpr=E7=94=A8=E6=88=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=B7=B2=E6=B3=A8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/api/v1/users/_simple_user.json.jbuilder | 2 +- app/views/pull_requests/index.json.jbuilder | 4 ++-- app/views/pull_requests/show.json.jbuilder | 4 ++-- app/views/users/_user_simple.json.jbuilder | 6 ++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/api/v1/users/_simple_user.json.jbuilder b/app/views/api/v1/users/_simple_user.json.jbuilder index 27fb3d13d..a02503828 100644 --- a/app/views/api/v1/users/_simple_user.json.jbuilder +++ b/app/views/api/v1/users/_simple_user.json.jbuilder @@ -7,5 +7,5 @@ if user.present? else json.name "已注销" json.login "" - json.image_url Rails.application.config_for(:configuration)['platform_url'] + "/" + url_to_avatar(user).to_s + json.image_url Rails.application.config_for(:configuration)['platform_url'] + "/" + User::Avatar.get_letter_avatar_url("D") end \ No newline at end of file diff --git a/app/views/pull_requests/index.json.jbuilder b/app/views/pull_requests/index.json.jbuilder index 3a35772f0..b648d8bae 100644 --- a/app/views/pull_requests/index.json.jbuilder +++ b/app/views/pull_requests/index.json.jbuilder @@ -35,9 +35,9 @@ json.issues do json.pr_full_time pr.status == 1 ? pr.updated_at : issue.updated_on json.assign_user_name issue.get_assign_user.try(:show_real_name) json.assign_user_login issue.get_assign_user.try(:login) - json.author_name issue.user.try(:show_real_name) + json.author_name issue.user.blank?? "已注销": issue.user.show_real_name json.author_login issue.user.try(:login) - json.avatar_url url_to_avatar(issue.user) + json.avatar_url issue.user.blank?? User::Avatar.get_letter_avatar_url("D") : url_to_avatar(issue.user) json.priority issue.priority.try(:name) json.version issue.version.try(:name) json.journals_count issue.get_journals_size diff --git a/app/views/pull_requests/show.json.jbuilder b/app/views/pull_requests/show.json.jbuilder index 509577edc..c11be046d 100644 --- a/app/views/pull_requests/show.json.jbuilder +++ b/app/views/pull_requests/show.json.jbuilder @@ -44,9 +44,9 @@ json.issue do json.created_at format_time(@issue.created_on) json.assign_user_name @issue_assign_to.try(:show_real_name) json.assign_user_login @issue_assign_to.try(:login) - json.author_name @issue_user.try(:show_real_name) + json.author_name @issue_user.blank?? "已注销": @issue_user.show_real_name json.author_login @issue_user.try(:login) - json.author_picture url_to_avatar(@issue_user) + json.avatar_url @issue_user.blank?? User::Avatar.get_letter_avatar_url("D") : url_to_avatar(@issue_user) json.issue_status @issue.issue_status.try(:name) json.priority @issue.priority.try(:name) json.version @issue.version.try(:name) diff --git a/app/views/users/_user_simple.json.jbuilder b/app/views/users/_user_simple.json.jbuilder index 5da161509..c45706fe5 100644 --- a/app/views/users/_user_simple.json.jbuilder +++ b/app/views/users/_user_simple.json.jbuilder @@ -4,6 +4,8 @@ if user.present? json.name user.real_name json.login user.login json.image_url url_to_avatar(user) -else - json.nil! +else + json.name "已注销" + json.login "" + json.image_url Rails.application.config_for(:configuration)['platform_url'] + "/" + User::Avatar.get_letter_avatar_url("D") end \ No newline at end of file