增加是否开启导出功能的选项

pull/358/head
lifei6671 2018-07-12 18:44:02 +08:00
parent 97f1d0f8a7
commit e694e63299
4 changed files with 13 additions and 0 deletions

View File

@ -74,6 +74,7 @@ mail_expired=30
secure=LOGIN
###############配置导出项目###################
enable_export=true
#同一个项目同时运行导出程序的并行数量取值1-4之间取值越大导出速度越快越占用资源
export_process_num=1

View File

@ -137,6 +137,10 @@ func GetUploadFileSize() int64 {
}
return 0
}
//是否启用导出
func GetEnableExport() bool {
return beego.AppConfig.DefaultBool("enable_export",true)
}
//同一项目导出线程的并发数
func GetExportProcessNum() int {
exportProcessNum := beego.AppConfig.DefaultInt("export_process_num",1)

View File

@ -823,6 +823,9 @@ func (c *DocumentController) Export() {
promptUserToLogIn(c)
return
}
if !conf.GetEnableExport() {
c.ShowErrorPage(500,"系统没有开启导出功能")
}
bookResult := models.NewBookResult()
if c.Member != nil && c.Member.IsAdministrator() {

View File

@ -80,6 +80,11 @@ if [ ! -z $BASEURL ]; then
sed -i "s#baseurl=.*#baseurl=$BASEURL#g" conf/app.conf
fi
if [ ! -z $ENABLE_EXPORT ]; then
sed -i "s#enable_export=.*#baseurl=$ENABLE_EXPORT#g" conf/app.conf
fi
sed -i 's/^runmode.*/runmode=prod/g' conf/app.conf
/mindoc/mindoc_linux_amd64 install