mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-07 16:13:51 +08:00
1、实现标签功能
2、实现删除用户,当删除一个用户时,该用户的所有信息将转义到超级管理员账户上
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/astaxie/beego/context"
|
||||
"github.com/lifei6671/mindoc/conf"
|
||||
"github.com/lifei6671/mindoc/models"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -12,7 +13,17 @@ func init() {
|
||||
_, ok := ctx.Input.Session(conf.LoginSessionName).(models.Member)
|
||||
|
||||
if !ok {
|
||||
ctx.Redirect(302, beego.URLFor("AccountController.Login"))
|
||||
if ctx.Input.IsAjax() {
|
||||
jsonData := make(map[string]interface{},3)
|
||||
|
||||
jsonData["errcode"] = 403
|
||||
jsonData["message"] = "请登录后再操作"
|
||||
returnJSON, _ := json.Marshal(jsonData)
|
||||
|
||||
ctx.ResponseWriter.Write(returnJSON)
|
||||
}else{
|
||||
ctx.Redirect(302, beego.URLFor("AccountController.Login"))
|
||||
}
|
||||
}
|
||||
}
|
||||
beego.InsertFilter("/manager",beego.BeforeRouter,FilterUser)
|
||||
|
Reference in New Issue
Block a user