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

@ -104,6 +104,7 @@ func (c Blog) setPreviewUrl() {
themeId := c.Session["themeId"]
theme := themeService.GetTheme(userId, themeId)
siteUrl := configService.GetSiteUrl()
blogUrl := siteUrl + "/preview" // blog.leanote.com
userIdOrEmail := userId
@ -137,6 +138,7 @@ func (c Blog) setUrl(userBlog info.UserBlog, userInfo info.User) {
staticUrl = configService.GetUserUrl(strings.Split(host, ":")[0])
// staticUrl == host, 为保证同源!!! 只有host, http://leanote.com, http://blog/leanote.com
// life.leanote.com, lealife.com
siteUrl := configService.GetSiteUrl()
if userBlog.Domain != "" && configService.AllowCustomDomain() {
// ok
indexUrl = configService.GetUserUrl(userBlog.Domain)
@ -496,7 +498,7 @@ func (c Blog) Archive(userIdOrEmail string, cateId string) (re revel.Result) {
// 用户id为空, 转至博客平台
if userIdOrEmail == "" {
userIdOrEmail = leanoteUserId
userIdOrEmail = configService.GetAdminUsername()
}
var userInfo info.User
if userId != "" {
@ -594,7 +596,7 @@ func (c Blog) Index(userIdOrEmail string) (re revel.Result) {
// 用户id为空, 转至博客平台
if userIdOrEmail == "" {
userIdOrEmail = leanoteUserId
userIdOrEmail = configService.GetAdminUsername()
}
var userInfo info.User
if userId != "" {