mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-06-28 13:18:48 +08:00
增加是否开启导出功能的选项
This commit is contained in:
parent
97f1d0f8a7
commit
e694e63299
@ -74,6 +74,7 @@ mail_expired=30
|
||||
secure=LOGIN
|
||||
|
||||
###############配置导出项目###################
|
||||
enable_export=true
|
||||
#同一个项目同时运行导出程序的并行数量,取值1-4之间,取值越大导出速度越快,越占用资源
|
||||
export_process_num=1
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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() {
|
||||
|
5
start.sh
5
start.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user