beta2 preview controller
This commit is contained in:
@ -102,19 +102,23 @@ func (c Blog) setPreviewUrl() {
|
|||||||
var indexUrl, postUrl, searchUrl, cateUrl, singleUrl, tagsUrl, archiveUrl string
|
var indexUrl, postUrl, searchUrl, cateUrl, singleUrl, tagsUrl, archiveUrl string
|
||||||
|
|
||||||
userId := c.GetUserId()
|
userId := c.GetUserId()
|
||||||
|
userIdOrEmail := userId
|
||||||
|
username := c.GetUsername()
|
||||||
|
if username != "" {
|
||||||
|
userIdOrEmail = username
|
||||||
|
}
|
||||||
themeId := c.Session["themeId"]
|
themeId := c.Session["themeId"]
|
||||||
theme := themeService.GetTheme(userId, themeId)
|
theme := themeService.GetTheme(userId, themeId)
|
||||||
|
|
||||||
siteUrl := configService.GetSiteUrl()
|
siteUrl := configService.GetSiteUrl()
|
||||||
blogUrl := siteUrl + "/preview" // blog.leanote.com
|
blogUrl := siteUrl + "/preview" // blog.leanote.com
|
||||||
userIdOrEmail := userId
|
|
||||||
|
|
||||||
indexUrl = blogUrl + "/" + userIdOrEmail
|
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
|
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
|
archiveUrl = blogUrl + "/archives/" + userIdOrEmail // blog.leanote.com/archive/userId
|
||||||
tagsUrl = blogUrl + "/tags/" + userIdOrEmail // blog.leanote.com/archive/userId
|
tagsUrl = blogUrl + "/tags/" + userIdOrEmail // blog.leanote.com/archive/userId
|
||||||
|
|
||||||
|
@ -82,13 +82,13 @@ GET /preview/archives Preview.Archives
|
|||||||
GET /preview/view/:noteId Preview.Post
|
GET /preview/view/:noteId Preview.Post
|
||||||
|
|
||||||
GET /preview/post/: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/single/:singleId Preview.Single
|
||||||
|
|
||||||
GET /preview/cate/:notebookId Preview.Cate
|
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/:userIdOrEmail Preview.Index
|
||||||
GET /preview Preview.Index
|
GET /preview Preview.Index
|
||||||
|
Reference in New Issue
Block a user