go-common/app/admin/main/macross/http/manager.go

19 lines
347 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package http
import (
"go-common/library/ecode"
bm "go-common/library/net/http/blademaster"
)
// getAuths get user.
func getAuths(c *bm.Context) {
var userName string
username, _ := c.Get("username")
userName, ok := username.(string)
if !ok || userName == "" {
c.JSON(nil, ecode.NoLogin)
return
}
c.JSON(svr.GetAuths(c, userName))
}