mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-01-19 18:21:18 +08:00
自动注册工单系统账号
This commit is contained in:
@@ -4,11 +4,12 @@ package conf
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"strconv"
|
||||
"path/filepath"
|
||||
"os"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
// 登录用户的Session名
|
||||
@@ -19,7 +20,8 @@ const CaptchaSessionName = "__captcha__"
|
||||
const RegexpEmail = "^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"
|
||||
|
||||
//允许用户名中出现点号
|
||||
const RegexpAccount = `^[a-zA-Z][a-zA-Z0-9\.-]{2,50}$`
|
||||
// const RegexpAccount = `^[a-zA-Z][a-zA-Z0-9\.-]{2,50}$`
|
||||
const RegexpAccount = `[a-zA-Z0-9\.-]{2,50}$`
|
||||
|
||||
// PageSize 默认分页条数.
|
||||
const PageSize = 10
|
||||
@@ -158,7 +160,7 @@ func GetExportProcessNum() int {
|
||||
if exportProcessNum <= 0 || exportProcessNum > 4 {
|
||||
exportProcessNum = 1
|
||||
}
|
||||
return exportProcessNum;
|
||||
return exportProcessNum
|
||||
}
|
||||
|
||||
//导出项目队列的并发数量
|
||||
@@ -168,7 +170,7 @@ func GetExportLimitNum() int {
|
||||
if exportLimitNum < 0 {
|
||||
exportLimitNum = 1
|
||||
}
|
||||
return exportLimitNum;
|
||||
return exportLimitNum
|
||||
}
|
||||
|
||||
//等待导出队列的长度
|
||||
@@ -210,7 +212,7 @@ func IsAllowUploadFileExt(ext string) bool {
|
||||
//重写生成URL的方法,加上完整的域名
|
||||
func URLFor(endpoint string, values ...interface{}) string {
|
||||
baseUrl := beego.AppConfig.DefaultString("baseurl", "")
|
||||
pathUrl := beego.URLFor(endpoint, values ...)
|
||||
pathUrl := beego.URLFor(endpoint, values...)
|
||||
|
||||
if baseUrl == "" {
|
||||
baseUrl = BaseUrl
|
||||
@@ -224,12 +226,12 @@ func URLFor(endpoint string, values ...interface{}) string {
|
||||
if !strings.HasPrefix(pathUrl, "/") && !strings.HasSuffix(baseUrl, "/") {
|
||||
return baseUrl + "/" + pathUrl
|
||||
}
|
||||
return baseUrl + beego.URLFor(endpoint, values ...)
|
||||
return baseUrl + beego.URLFor(endpoint, values...)
|
||||
}
|
||||
|
||||
func URLForNotHost(endpoint string,values ...interface{}) string {
|
||||
func URLForNotHost(endpoint string, values ...interface{}) string {
|
||||
baseUrl := beego.AppConfig.DefaultString("baseurl", "")
|
||||
pathUrl := beego.URLFor(endpoint, values ...)
|
||||
pathUrl := beego.URLFor(endpoint, values...)
|
||||
|
||||
if baseUrl == "" {
|
||||
baseUrl = "/"
|
||||
@@ -243,7 +245,7 @@ func URLForNotHost(endpoint string,values ...interface{}) string {
|
||||
if !strings.HasPrefix(pathUrl, "/") && !strings.HasSuffix(baseUrl, "/") {
|
||||
return baseUrl + "/" + pathUrl
|
||||
}
|
||||
return baseUrl + beego.URLFor(endpoint, values ...)
|
||||
return baseUrl + beego.URLFor(endpoint, values...)
|
||||
}
|
||||
|
||||
func URLForWithCdnImage(p string) string {
|
||||
|
||||
Reference in New Issue
Block a user