dev_aliyun
jingquan huang 5 years ago
commit 880b401b96

@ -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

@ -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={})

@ -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

@ -1,7 +1,7 @@
<div class="task-popup" style="width: 500px;">
<p class="font-bd font-18 mt30 mb10 edu-txt-center"><%= notice.try(:subject) %></p>
<div class="padding20-30 color-grey-6 font-16">
<pre class="break-word break-word-firefox"><%= notice.try(:notes) %></pre>
<pre class="break-word break-word-firefox"><%= notice.try(:notes).try(:rstrip) %></pre>
</div>
<div class="clearfix edu-txt-center mb30 mt10">
<p class="inline">

@ -73,7 +73,7 @@
<div class="surfacePlot ml60 library-cover-select" data-tip-down="上传图片" onclick="$('#library-cover-file').click();">
<img src="/images/educoder/unite.png" class="marginuploading <%= cover_exists ? 'hidden' : '' %>" style="<%= cover_exists ? 'display:none' : '' %>"/>
<div class="library-cover-perview" style="<%= cover_exists ? '' : 'display:none' %>">
<% cover_url = cover_exists ? download_attachment_path(@library.cover_id) : '' %>
<% cover_url = cover_exists ? "/api/attachments/#{@library.cover.id}" : '' %>
<img src="<%= cover_url %>" width="122px" height="93px"/>
</div>
</div>

@ -2,7 +2,7 @@
<% if @libraries.present? %>
<% @libraries.each do |library| %>
<li class="library_list_item">
<% 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') %>
<div class="flex1">
<p class="clearfix mb15 lineh-40 mt10">

@ -8,7 +8,7 @@
<td><%= training.training_payinfo.try(:info) %></td>
<td>
<% if training.training_payinfo.try(:attachment_id).present? %>
<img src="<%= download_attachment_path(training.training_payinfo.try(:attachment_id)) %>" width="50px" class="training_image"/>
<img src="/api/attachments/<%= training.training_payinfo.try(:attachment_id) %>" width="50px" class="training_image"/>
<% end %>
</td>
<td><%= format_time training.created_at %></td>

@ -58,6 +58,6 @@ If you continue to experience problems please contact your Trustie administrator
<p class="font-18">
平台拟于<span style="color: red">2019年7月22日10:40--2019年7月22号11:00</span>进行全面升级,带来不便,敬请谅解!
</p>
</div>
</div>user_tidings.html.erb
</body>
</html>

Loading…
Cancel
Save