变量统一
This commit is contained in:
parent
866d44c568
commit
29dda04a2d
|
@ -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
|
||||||
|
|
|
@ -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 = []
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue