mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
useranme
This commit is contained in:
@@ -39,6 +39,7 @@ func (s *BaseController) Prepare() {
|
||||
s.Ctx.Input.SetData("client_id", s.GetSession("clientId").(int))
|
||||
s.Ctx.Input.SetParam("client_id", strconv.Itoa(s.GetSession("clientId").(int)))
|
||||
s.Data["isAdmin"] = false
|
||||
s.Data["username"] = s.GetSession("username")
|
||||
s.CheckUserAuth()
|
||||
} else {
|
||||
s.Data["isAdmin"] = true
|
||||
|
@@ -43,6 +43,7 @@ func (self *LoginController) Verify() {
|
||||
if auth {
|
||||
self.SetSession("isAdmin", false)
|
||||
self.SetSession("clientId", v.Id)
|
||||
self.SetSession("username", v.WebUserName)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
Reference in New Issue
Block a user