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.

base.go 336 B

1234567891011121314151617181920
  1. package controllers
  2. import "github.com/astaxie/beego"
  3. type ApiController struct {
  4. beego.Controller
  5. }
  6. func (c *ApiController) GetSessionUser() string {
  7. user := c.GetSession("username")
  8. if user == nil {
  9. return ""
  10. }
  11. return user.(string)
  12. }
  13. func (c *ApiController) SetSessionUser(user string) {
  14. c.SetSession("username", user)
  15. }

基于Casbin的开源AI领域知识库平台

Contributors (1)