mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-20 19:07:56 +08:00
未开启匿名访问时能够访问公开项目
This commit is contained in:
@@ -91,6 +91,11 @@ func (c *DocumentController) Index() {
|
||||
if identify == "" {
|
||||
c.Abort("404")
|
||||
}
|
||||
//如果没有开启你们访问则跳转到登录
|
||||
if !c.EnableAnonymous && c.Member == nil {
|
||||
c.Redirect(beego.URLFor("AccountController.Login"),302)
|
||||
return
|
||||
}
|
||||
bookResult := isReadable(identify,token,c)
|
||||
|
||||
|
||||
@@ -119,6 +124,13 @@ func (c *DocumentController) Read() {
|
||||
if identify == "" || id == ""{
|
||||
c.Abort("404")
|
||||
}
|
||||
|
||||
//如果没有开启你们访问则跳转到登录
|
||||
if !c.EnableAnonymous && c.Member == nil {
|
||||
c.Redirect(beego.URLFor("AccountController.Login"),302)
|
||||
return
|
||||
}
|
||||
|
||||
bookResult := isReadable(identify,token,c)
|
||||
|
||||
c.TplName = "document/" + bookResult.Theme + "_read.tpl"
|
||||
|
Reference in New Issue
Block a user