diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index e41e2a43..46be2ef4 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -359,7 +359,7 @@ class AttachmentsController < ApplicationController saved = @attachment.save respond_to do |format| format.js - format.json { render json: { attachment_id: @attachment.id, url: download_attachment_path(@attachment.id) } } + format.json { render json: { attachment_id: @attachment.id, url: "/api/attachments/#{@attachment.id}"} } format.api { if saved render :action => 'upload', :status => :created @@ -380,7 +380,7 @@ class AttachmentsController < ApplicationController render json: { success: saved ? 1 : 0, # | 1, // 0 表示上传失败,1 表示上传成功 message: "上传信息:#{ @attachment.errors.full_messages.join(',') }", - url: download_attachment_path(@attachment.id), # 上传成功时才返回 + url: "/api/attachments/#{@attachment.id}", # 上传成功时才返回 attachment_id: @attachment.id } end @@ -413,7 +413,7 @@ class AttachmentsController < ApplicationController render json: { success: saved ? 1 : 0, # | 1, // 0 表示上传失败,1 表示上传成功 message: "上传失败:#{ @attachment.errors.full_messages.join(',') }", - url: download_attachment_path(@attachment.id) # 上传成功时才返回 + url: "/api/attachments/#{@attachment.id}" # 上传成功时才返回 } end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 39298061..aac2a843 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5690,7 +5690,8 @@ end def download_named_attachment_url_without_domain(id, filename, option={}) attachment_id = (Attachment === id ? id.id : id) - Setting.protocol + "://" + Setting.host_name + "/attachments/download/" + attachment_id.to_s + "/" + filename + # Setting.protocol + "://" + Setting.host_name + "/attachments/download/" + attachment_id.to_s + "/" + filename + "/api/attachments/" + attachment_id.to_s end def named_attachment_url_without_domain(id, filename, option={}) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index 7204abc5..0cc335a5 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -254,7 +254,7 @@ class Tiding < ActiveRecord::Base elsif self.tiding_type == "Comment" container.present? ? ("评论了你" + (container.parent.present? ? "的回复:" : "发布的项目issue:") + message_content(container.notes)) : "" else - container.present? ? "更新了Issue:#{container.try(:issue).try(:subject)}" : "" + "更新了Issue:#{container.try(:issue).try(:subject)}" end when 'Issue' "指派了Issue给你:" + container.subject diff --git a/app/views/account/_user_update_notice.html.erb b/app/views/account/_user_update_notice.html.erb index ca438f35..0fa17fae 100644 --- a/app/views/account/_user_update_notice.html.erb +++ b/app/views/account/_user_update_notice.html.erb @@ -1,7 +1,7 @@

<%= notice.try(:subject) %>

-
<%= notice.try(:notes) %>
+
<%= notice.try(:notes).try(:rstrip) %>

diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index c71bc7c1..c5bb2ecd 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -73,7 +73,7 @@

- <% cover_url = cover_exists ? download_attachment_path(@library.cover_id) : '' %> + <% cover_url = cover_exists ? "/api/attachments/#{@library.cover.id}" : '' %>
diff --git a/app/views/libraries/_library_list.html.erb b/app/views/libraries/_library_list.html.erb index b5551966..4d5a52ab 100644 --- a/app/views/libraries/_library_list.html.erb +++ b/app/views/libraries/_library_list.html.erb @@ -2,7 +2,7 @@ <% if @libraries.present? %> <% @libraries.each do |library| %>
  • - <% image_url = library.cover.present? ? download_attachment_path(library.cover.id) : 'educoder/library-default-cover.png' %> + <% image_url = library.cover.present? ? "/api/attachments/#{library.cover.id}" : 'educoder/library-default-cover.png' %> <%= image_tag(image_url, width: 120, height: 90, class: 'mr15 mt3 radius4') %>

    diff --git a/app/views/managements/_training_item.html.erb b/app/views/managements/_training_item.html.erb index ceb1f055..50e856fa 100644 --- a/app/views/managements/_training_item.html.erb +++ b/app/views/managements/_training_item.html.erb @@ -8,7 +8,7 @@ <%= training.training_payinfo.try(:info) %> <% if training.training_payinfo.try(:attachment_id).present? %> - + <% end %> <%= format_time training.created_at %> diff --git a/public/update.html b/public/update.html index 71bd6e1a..2be5462a 100644 --- a/public/update.html +++ b/public/update.html @@ -58,6 +58,6 @@ If you continue to experience problems please contact your Trustie administrator

    平台拟于2019年7月22日10:40--2019年7月22号11:00进行全面升级,带来不便,敬请谅解!

    -
    +
  • user_tidings.html.erb