码农笔录博客源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 line
506 B

6 年之前
package filter
import (
"github.com/astaxie/beego/context"
6 年之前
"github.com/astaxie/beego/logs"
6 年之前
"beeblog/models"
"encoding/json"
6 年之前
)
6 年之前
var LogFilter = func(ctx *context.Context) {
logs.Info(ctx.Input.URI())
6 年之前
}
6 年之前
var FilterAdmin = func(ctx *context.Context) {
6 年之前
if ctx.Input.Session("userid") != nil {
6 年之前
ctx.Output.SetStatus(200)
ctx.Output.Header("Access-Control-Allow-Origin","*")
result := models.ReurnError(401, "")
if b,err := json.Marshal(result); err != nil {
ctx.Output.Body(b)
}
return
6 年之前
}
6 年之前
}