beta2 preview controller

This commit is contained in:
life
2014-11-13 12:35:48 +08:00
parent 16d47418ad
commit b45e9eacb0
2 changed files with 12 additions and 8 deletions

View File

@ -102,19 +102,23 @@ func (c Blog) setPreviewUrl() {
var indexUrl, postUrl, searchUrl, cateUrl, singleUrl, tagsUrl, archiveUrl string
userId := c.GetUserId()
userIdOrEmail := userId
username := c.GetUsername()
if username != "" {
userIdOrEmail = username
}
themeId := c.Session["themeId"]
theme := themeService.GetTheme(userId, themeId)
siteUrl := configService.GetSiteUrl()
blogUrl := siteUrl + "/preview" // blog.leanote.com
userIdOrEmail := userId
indexUrl = blogUrl + "/" + userIdOrEmail
cateUrl = blogUrl + "/cate" // /notebookId
cateUrl = blogUrl + "/cate/" + userIdOrEmail // /notebookId
postUrl = blogUrl + "/post" // /xxxxx
postUrl = blogUrl + "/post/" + userIdOrEmail // /xxxxx
searchUrl = blogUrl + "/search/" + userIdOrEmail // blog.leanote.com/search/userId
singleUrl = blogUrl + "/single" // blog.leanote.com/single/singleId
singleUrl = blogUrl + "/single/" + userIdOrEmail // blog.leanote.com/single/singleId
archiveUrl = blogUrl + "/archives/" + userIdOrEmail // blog.leanote.com/archive/userId
tagsUrl = blogUrl + "/tags/" + userIdOrEmail // blog.leanote.com/archive/userId

View File

@ -82,13 +82,13 @@ GET /preview/archives Preview.Archives
GET /preview/view/:noteId Preview.Post
GET /preview/post/:noteId Preview.Post
GET /preview/post/userIdOrEmail/:noteId Preview.Post
GET /preview/post/:userIdOrEmail/:noteId Preview.Post
GET /preview/single/userIdOrEmail/:singleId Preview.Single
GET /preview/single/:userIdOrEmail/:singleId Preview.Single
GET /preview/single/:singleId Preview.Single
GET /preview/cate/:notebookId Preview.Cate
GET /preview/cate/userIdOrEmail/:notebookId Preview.Cate
GET /preview/cate/:userIdOrEmail/:notebookId Preview.Cate
GET /preview/:userIdOrEmail Preview.Index
GET /preview Preview.Index