|
@@ -8,6 +8,7 @@ import (
|
|
|
"math/rand"
|
|
|
"os"
|
|
|
"path/filepath"
|
|
|
+ "regexp"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
@@ -255,8 +256,8 @@ func compressFiles(filePattern []string, path, timeStr string) {
|
|
|
|
|
|
// 数据导出(通用)
|
|
|
func (e *ExportByDbReq) ExportDataByDb() []byte {
|
|
|
-
|
|
|
key := hName(e.Query)
|
|
|
+ log.Println("", key)
|
|
|
timeStr := time.Now().Format("20060102150405")
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
randomInt := rand.Intn(10000) // 生成0到9999之间的随机整数
|
|
@@ -300,7 +301,10 @@ func hName(sql string) []interface{} {
|
|
|
if strings.Contains(s1, "as") {
|
|
|
a1 := strings.Split(s1, "as")
|
|
|
l1 := len(a1)
|
|
|
- key = append(key, a1[l1-1])
|
|
|
+ chiReg := regexp.MustCompile("[^\u4e00-\u9fa5]")
|
|
|
+ if !chiReg.MatchString(a1[l1-1]) {
|
|
|
+ key = append(key, a1[l1-1])
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return key
|