WeixinControllers

package
v0.0.0-...-af6c3bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func (this *BaseController) DocExist()

校验文档是否已经存在

func (*BaseController) Pages

func (this *BaseController) Pages()

单页

func (*BaseController) Prepare

func (this *BaseController) Prepare()

初始化函数

func (*BaseController) ResetCookie

func (this *BaseController) ResetCookie()

重置cookie

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 Output

type Output struct {
	// contains filtered or unexported fields
}

type SearchController

type SearchController struct {
	BaseController
}

func (*SearchController) Get

func (this *SearchController) Get()

type UserController

type UserController struct {
	BaseController
}

func (*UserController) CheckLogin

func (this *UserController) CheckLogin()

检测用户是否已登录

func (*UserController) GetToken

func (this *UserController) GetToken()

func (*UserController) Login

func (this *UserController) Login()

用户登录

func (*UserController) Logout

func (this *UserController) Logout()

用户退出登录

func (*UserController) Prepare

func (this *UserController) Prepare()

type ViewController

type ViewController struct {
	BaseController
}

func (*ViewController) Comment

func (this *ViewController) Comment()

文档评论

func (*ViewController) DownFree

func (this *ViewController) DownFree()

是否可以免费下载

func (*ViewController) Download

func (this *ViewController) Download()

文档下载

func (*ViewController) Get

func (this *ViewController) Get()

func (*ViewController) GetComment

func (this *ViewController) GetComment()

获取评论列表

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL