1、实现标签功能

2、实现删除用户,当删除一个用户时,该用户的所有信息将转义到超级管理员账户上
This commit is contained in:
Minho
2017-07-07 16:20:55 +08:00
parent c7f32d7cb5
commit 47687cc5b1
85 changed files with 13999 additions and 184 deletions

View File

@@ -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)