增加项目导出目录配置,可自定义导出的缓存目录

This commit is contained in:
lifei6671
2018-07-11 11:30:48 +08:00
parent 449fecd4eb
commit ebf36e6146
6 changed files with 24 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/astaxie/beego"
"strconv"
"path/filepath"
)
// 登录用户的Session名
@@ -65,7 +66,7 @@ var (
var (
ConfigurationFile = "./conf/app.conf"
WorkingDirectory = "./"
LogFile = "./logs"
LogFile = "./runtime/logs"
BaseUrl = ""
)
@@ -90,6 +91,7 @@ func GetTokenSize() int {
//获取默认文档封面.
func GetDefaultCover() string {
return URLForWithCdnImage(beego.AppConfig.DefaultString("cover", "/static/images/book.jpg"))
}
@@ -162,6 +164,12 @@ func GetExportQueueLimitNum() int {
}
return exportQueueLimitNum
}
//默认导出项目的缓存目录
func GetExportOutputPath() string {
exportOutputPath := filepath.Join(beego.AppConfig.DefaultString("export_output_path", filepath.Join(WorkingDirectory,"cache")),"books")
return exportOutputPath
}
//判断是否是允许商城的文件类型.
func IsAllowUploadFileExt(ext string) bool {