Documentation ¶
Index ¶
- type BaseController
- func (this *BaseController) CheckLogin() int
- func (this *BaseController) DocExist()
- func (this *BaseController) Pages()
- func (this *BaseController) Prepare()
- func (this *BaseController) ResetCookie()
- func (this *BaseController) ResponseJson(isSuccess bool, msg string, data ...interface{})
- func (this *BaseController) SetCookieLogin(uid interface{})
- func (this *BaseController) Xsrf()
- type ListController
- type Output
- type SearchController
- type UserController
- type ViewController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseController ¶
type BaseController struct { beego.Controller TplTheme string //模板主题 TplStatic string //模板静态文件 IsLogin int //用户是否已登录 Sys models.Sys Out Output }
func (*BaseController) CheckLogin ¶
func (this *BaseController) CheckLogin() int
是否已经登录,如果已登录,则返回用户的id
func (*BaseController) ResponseJson ¶
func (this *BaseController) ResponseJson(isSuccess bool, msg string, data ...interface{})
响应json
func (*BaseController) SetCookieLogin ¶
func (this *BaseController) SetCookieLogin(uid interface{})
设置用户登录的cookie,其实uid是时间戳的加密,而token才是真正的uid @param uid interface{} 用户UID
func (*BaseController) Xsrf ¶
func (this *BaseController) Xsrf()
防止跨站攻击,在有表单的控制器放大中调用,不要直接在base控制器中调用,因为用户每访问一个页面都重新刷新cookie了
type ListController ¶
type ListController struct {
BaseController
}
func (*ListController) Get ¶
func (this *ListController) Get()
type SearchController ¶
type SearchController struct {
BaseController
}
func (*SearchController) Get ¶
func (this *SearchController) Get()
type UserController ¶
type UserController struct {
BaseController
}
func (*UserController) GetToken ¶
func (this *UserController) GetToken()
func (*UserController) Prepare ¶
func (this *UserController) Prepare()
type ViewController ¶
type ViewController struct {
BaseController
}
func (*ViewController) Get ¶
func (this *ViewController) Get()
Click to show internal directories.
Click to hide internal directories.