mirror of https://github.com/mindoc-org/mindoc.git
当用户登录时不能注册
parent
579197d146
commit
74ed664c79
|
@ -133,6 +133,10 @@ func (c *AccountController) LoggedIn(isPost bool) interface{} {
|
||||||
func (c *AccountController) Register() {
|
func (c *AccountController) Register() {
|
||||||
c.TplName = "account/register.tpl"
|
c.TplName = "account/register.tpl"
|
||||||
|
|
||||||
|
//如果用户登录了,则跳转到网站首页
|
||||||
|
if member, ok := c.GetSession(conf.LoginSessionName).(models.Member); ok && member.MemberId > 0 {
|
||||||
|
c.Redirect(beego.URLFor("HomeController.Index"),302)
|
||||||
|
}
|
||||||
// 如果没有开启用户注册
|
// 如果没有开启用户注册
|
||||||
if v, ok := c.Option["ENABLED_REGISTER"]; ok && !strings.EqualFold(v, "true") {
|
if v, ok := c.Option["ENABLED_REGISTER"]; ok && !strings.EqualFold(v, "true") {
|
||||||
c.Abort("404")
|
c.Abort("404")
|
||||||
|
|
Loading…
Reference in New Issue