siteurl, adminUsername config in configService

This commit is contained in:
life
2014-11-10 16:26:04 +08:00
parent 954c4e5e95
commit 6555384e5c
16 changed files with 118 additions and 98 deletions

View File

@ -53,7 +53,8 @@ func (c Note) Index() revel.Result {
}
// 当然, 还需要得到第一个notes的content
//...
c.RenderArgs["isAdmin"] = leanoteUserId == userInfo.Username
Log(configService.GetAdminUsername())
c.RenderArgs["isAdmin"] = configService.GetAdminUsername() == userInfo.Username
c.RenderArgs["userInfo"] = userInfo
c.RenderArgs["userInfoJson"] = c.Json(userInfo)
@ -299,7 +300,7 @@ func (c Note) Html2Image(noteId string) revel.Result {
appKey, _ := revel.Config.String("app.secret")
cookieDomain, _ := revel.Config.String("cookie.domain")
// 生成之
url := siteUrl + "/note/toImage?noteId=" + noteId + "&appKey=" + appKey;
url := configService.GetSiteUrl() + "/note/toImage?noteId=" + noteId + "&appKey=" + appKey;
// /Users/life/Documents/bin/phantomjs/bin/phantomjs /Users/life/Desktop/test/b.js
binPath := configService.GetGlobalStringConfig("toImageBinPath")
if binPath == "" {