1、实现富文本编辑器

2、实现文档转换为PDF、MOBI、EPUB、Word格式
3、实现登录后跳转到来源地址
This commit is contained in:
Minho
2018-01-26 17:17:38 +08:00
parent e1ec6bb788
commit 882d93e7b0
57 changed files with 1572 additions and 1475 deletions

View File

@@ -20,7 +20,7 @@ const RegexpEmail = "^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-
const RegexpAccount = `^[a-zA-Z][a-zA-z0-9\.]{2,50}$`
// PageSize 默认分页条数.
const PageSize = 15
const PageSize = 10
// 用户权限
const (
@@ -44,23 +44,31 @@ const (
)
const (
LoggerOperate = "operate"
LoggerSystem = "system"
LoggerOperate = "operate"
LoggerSystem = "system"
LoggerException = "exception"
LoggerDocument = "document"
LoggerDocument = "document"
)
const (
//本地账户校验
AuthMethodLocal = "local"
//LDAP用户校验
AuthMethodLDAP = "ldap"
AuthMethodLDAP = "ldap"
)
var (
VERSION string
BUILD_TIME string
GO_VERSION string
)
var (
ConfigurationFile = "./conf/app.conf"
WorkingDirectory = "./"
LogFile = "./logs"
BaseUrl = ""
)
// app_key
func GetAppKey() string {
return beego.AppConfig.DefaultString("app_key", "godoc")
@@ -102,29 +110,30 @@ func GetUploadFileExt() []string {
}
return exts
}
// 获取上传文件允许的最大值
func GetUploadFileSize() int64 {
size := beego.AppConfig.DefaultString("upload_file_size","0")
size := beego.AppConfig.DefaultString("upload_file_size", "0")
if strings.HasSuffix(size,"MB") {
if s,e := strconv.ParseInt(size[0:len(size) - 2], 10, 64);e == nil {
if strings.HasSuffix(size, "MB") {
if s, e := strconv.ParseInt(size[0:len(size)-2], 10, 64); e == nil {
return s * 1024 * 1024
}
}
if strings.HasSuffix(size,"GB") {
if s,e := strconv.ParseInt(size[0:len(size) - 2], 10, 64);e == nil {
if strings.HasSuffix(size, "GB") {
if s, e := strconv.ParseInt(size[0:len(size)-2], 10, 64); e == nil {
return s * 1024 * 1024 * 1024
}
}
if strings.HasSuffix(size,"KB") {
if s,e := strconv.ParseInt(size[0:len(size) - 2], 10, 64);e == nil {
if strings.HasSuffix(size, "KB") {
if s, e := strconv.ParseInt(size[0:len(size)-2], 10, 64); e == nil {
return s * 1024
}
}
if s,e := strconv.ParseInt(size, 10, 64);e == nil {
if s, e := strconv.ParseInt(size, 10, 64); e == nil {
return s * 1024
}
return 0
return 0
}
//判断是否是允许商城的文件类型.