diff --git a/app/api/mobile/apis/upgrade.rb b/app/api/mobile/apis/upgrade.rb index e6a7916d9..9ce1831f3 100644 --- a/app/api/mobile/apis/upgrade.rb +++ b/app/api/mobile/apis/upgrade.rb @@ -15,7 +15,7 @@ module Mobile if attachment.nil? raise '未发现客户端!' end - url = Setting.host_name + "/attachments/download/" + attachment.id.to_s + "/" + attachment.filename + url = "http://" + Setting.host_name + "/attachments/download/" + attachment.id.to_s + "/" + attachment.filename { version: @current_version.version, url: url, diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 72f4bdd92..23b080d94 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -20,9 +20,9 @@ class AttachmentsController < ApplicationController before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete] before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young - before_filter :delete_authorize, :only => :destroy - before_filter :authorize_global, :only => :upload - before_filter :authorize_attachment_download1, :only => :download + before_filter :delete_authorize, :only => [:destroy] + before_filter :authorize_global, :only => [:upload] + before_filter :authorize_attachment_download1, :only => [:download] #before_filter :login_without_softapplication, only: [:download] accept_api_auth :show, :download, :upload require 'iconv'