You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package controllers
-
- import "github.com/astaxie/beego"
-
- type ApiController struct {
- beego.Controller
- }
-
- func (c *ApiController) GetSessionUser() string {
- user := c.GetSession("username")
- if user == nil {
- return ""
- }
-
- return user.(string)
- }
-
- func (c *ApiController) SetSessionUser(user string) {
- c.SetSession("username", user)
- }
|