pull/103/head
刘河 2019-04-08 17:07:59 +08:00
parent 824b12a2f8
commit 694ebc5477
3 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -42,7 +42,7 @@
{{if eq true .isAdmin}}
admin
{{else}}
user
{{.username}}
{{end}}
</strong>
</span> <span class="text-muted text-xs block">system </span> </span>