Merge branch 'guange_dev' into 'develop'

变量统一



See merge request !111
This commit is contained in:
黄井泉 2017-01-06 15:00:21 +08:00
commit 6b67f5036c
3 changed files with 7 additions and 12 deletions

View File

@ -5,12 +5,11 @@ class ZipdownController < ApplicationController
before_filter :find_project_by_bid_id, :only => [:assort] before_filter :find_project_by_bid_id, :only => [:assort]
#检查权限 #检查权限
#勿删 before_filter :authorize, :only => [:assort,:download_user_homework] #勿删 before_filter :authorize, :only => [:assort,:download_user_homework]
SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
MAX_PATH = 50
## 200M ## 200M
MAX_DOWN_SIZE = 200 * 1024 * 1024 MAX_DOWN_SIZE = 200 * 1024 * 1024
include ZipService
#统一下载功能 #统一下载功能
def download def download
if User.current.logged? if User.current.logged?
@ -114,6 +113,4 @@ class ZipdownController < ApplicationController
end end
end end
include ZipService
end end

View File

@ -1,10 +1,12 @@
require "base64" require "base64"
require 'zip' require 'zip'
SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
MAX_PATH = 50
module ZipService module ZipService
SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
MAX_PATH = 50
def zip_bid(bid) def zip_bid(bid)
# Todo: User Access Controll # Todo: User Access Controll
bid_homework_path = [] bid_homework_path = []

View File

@ -1,9 +1,5 @@
#coding=utf-8 #coding=utf-8
SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
MAX_PATH = 50
namespace :zip do namespace :zip do
desc "手工打包作品" desc "手工打包作品"
task :pack => :environment do task :pack => :environment do