app自动更新功能功能,无法下载问题修正

This commit is contained in:
z9hang 2015-03-13 17:10:22 +08:00
parent e165dd6572
commit ff65bf4ba5
2 changed files with 4 additions and 4 deletions

View File

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

View File

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