您最多能選擇 25 個主題
主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
23 行
506 B
23 行
506 B
package filter
|
|
|
|
import (
|
|
"github.com/astaxie/beego/context"
|
|
"github.com/astaxie/beego/logs"
|
|
"beeblog/models"
|
|
"encoding/json"
|
|
)
|
|
|
|
var LogFilter = func(ctx *context.Context) {
|
|
logs.Info(ctx.Input.URI())
|
|
}
|
|
var FilterAdmin = func(ctx *context.Context) {
|
|
if ctx.Input.Session("userid") != nil {
|
|
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
|
|
}
|
|
}
|
|
|