remove deprecated log
This commit is contained in:
1 parent
c6937fd184
commit
094d18be46
16 files changed
+44
-52
No files matched your search
@@ -1106,7 +1106,7 @@ func (this *NoteService) FixContent(content string, isMarkdown bool) string {
|
||||
reg2, _ = regexp.Compile("<a(?:[^>]+?)(" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
}
|
||||
|
||||
Log(reg2)
|
||||
// Log(reg2)
|
||||
|
||||
content = reg.ReplaceAllStringFunc(content, func(str string) string {
|
||||
// str=这样的
|
||||
|
||||
@@ -360,8 +360,8 @@ func (this *NotebookService) DragNotebooks(userId string, curNotebookId string,
|
||||
func (this *NotebookService) ReCountNotebookNumberNotes(notebookId string) bool {
|
||||
notebookIdO := bson.ObjectIdHex(notebookId)
|
||||
count := db.Count(db.Notes, bson.M{"NotebookId": notebookIdO, "IsTrash": false, "IsDeleted": false})
|
||||
Log(count)
|
||||
Log(notebookId)
|
||||
// Log(count)
|
||||
// Log(notebookId)
|
||||
return db.UpdateByQField(db.Notebooks, bson.M{"_id": notebookIdO}, "NumberNotes", count)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package service
|
||||
import (
|
||||
"github.com/leanote/leanote/app/db"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"time"
|
||||
// "strings"
|
||||
@@ -66,10 +66,10 @@ func (this *SessionService) GetCaptcha(sessionId string) string {
|
||||
}
|
||||
func (this *SessionService) SetCaptcha(sessionId, captcha string) bool {
|
||||
this.Get(sessionId)
|
||||
Log(sessionId)
|
||||
Log(captcha)
|
||||
// Log(sessionId)
|
||||
// Log(captcha)
|
||||
ok := this.Update(sessionId, "Captcha", captcha)
|
||||
Log(ok)
|
||||
// Log(ok)
|
||||
return ok
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -311,7 +311,7 @@ func (this *ThemeService) UpdateTplContent(userId, themeId, filename, content st
|
||||
basePath := this.GetThemeAbsolutePath(userId, themeId)
|
||||
path := basePath + "/" + filename
|
||||
if strings.Contains(filename, ".html") {
|
||||
Log(">>")
|
||||
// Log(">>")
|
||||
if ok, msg = this.ValidateTheme(basePath, filename, content); ok {
|
||||
// 模板
|
||||
if ok, msg = this.mustTpl(filename, content); ok {
|
||||
@@ -359,7 +359,7 @@ func (this *ThemeService) mustTpl(filename, content string) (ok bool, msg string
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
ok = false
|
||||
Log(err)
|
||||
// Log(err)
|
||||
msg = fmt.Sprintf("%v", err)
|
||||
}
|
||||
}()
|
||||
@@ -405,7 +405,7 @@ func (this *ThemeService) ExportTheme(userId, themeId string) (ok bool, path str
|
||||
theme := this.GetThemeById(themeId)
|
||||
// 打包
|
||||
// 验证路径, 别把整个项目打包了
|
||||
Log(theme.Path)
|
||||
// Log(theme.Path)
|
||||
if theme.Path == "" ||
|
||||
(!strings.HasPrefix(theme.Path, "public/upload") &&
|
||||
!strings.HasPrefix(theme.Path, "public/blog/themes")) ||
|
||||
@@ -417,12 +417,12 @@ func (this *ThemeService) ExportTheme(userId, themeId string) (ok bool, path str
|
||||
targetPath := revel.BasePath + "/public/upload/" + userId + "/tmp"
|
||||
err := os.MkdirAll(targetPath, 0755)
|
||||
if err != nil {
|
||||
Log(err)
|
||||
// Log(err)
|
||||
return
|
||||
}
|
||||
targetName := targetPath + "/" + theme.Name + ".zip"
|
||||
Log(sourcePath)
|
||||
Log(targetName)
|
||||
// Log(sourcePath)
|
||||
// Log(targetName)
|
||||
ok = archive.Zip(sourcePath, targetName)
|
||||
if !ok {
|
||||
return
|
||||
@@ -445,7 +445,7 @@ func (this *ThemeService) ImportTheme(userId, path string) (ok bool, msg string)
|
||||
}
|
||||
if ok, msg = archive.Unzip(path, targetPath); !ok {
|
||||
DeleteFile(targetPath)
|
||||
Log("oh no")
|
||||
// Log("oh no")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -558,8 +558,8 @@ func (this *ThemeService) InstallTheme(userId, themeId string) (ok bool) {
|
||||
// 验证主题是否全法, 存在循环引用?
|
||||
// filename, newContent 表示在修改模板时要判断模板修改时是否有错误
|
||||
func (this *ThemeService) ValidateTheme(path string, filename, newContent string) (ok bool, msg string) {
|
||||
Log("theme Path")
|
||||
Log(path)
|
||||
// Log("theme Path")
|
||||
// Log(path)
|
||||
// 建立一个有向图
|
||||
// 将该path下的所有文件提出, 得到文件的引用情况
|
||||
files := ListDir(path)
|
||||
@@ -613,9 +613,9 @@ func (this *ThemeService) ValidateTheme(path string, filename, newContent string
|
||||
for _, includes := range finds {
|
||||
include := includes[1]
|
||||
includeIndex, has := fileIndexMap[include]
|
||||
Log(includeIndex)
|
||||
Log("??")
|
||||
Log(has)
|
||||
// Log(includeIndex)
|
||||
// Log("??")
|
||||
// Log(has)
|
||||
if has {
|
||||
vector[thisIndex][includeIndex] = 1
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ func (this *UserService) GetAllUserByFilter(userFilterEmail, userFilterWhiteList
|
||||
users := []info.User{}
|
||||
q := db.Users.Find(query)
|
||||
q.All(&users)
|
||||
Log(len(users))
|
||||
// Log(len(users))
|
||||
|
||||
return users
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user