Skip to content

Commit 694ebc5

Browse files
author
刘河
committed
useranme
1 parent 824b12a commit 694ebc5

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

web/controllers/base.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func (s *BaseController) Prepare() {
3939
s.Ctx.Input.SetData("client_id", s.GetSession("clientId").(int))
4040
s.Ctx.Input.SetParam("client_id", strconv.Itoa(s.GetSession("clientId").(int)))
4141
s.Data["isAdmin"] = false
42+
s.Data["username"] = s.GetSession("username")
4243
s.CheckUserAuth()
4344
} else {
4445
s.Data["isAdmin"] = true

web/controllers/login.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func (self *LoginController) Verify() {
4343
if auth {
4444
self.SetSession("isAdmin", false)
4545
self.SetSession("clientId", v.Id)
46+
self.SetSession("username", v.WebUserName)
4647
return false
4748
}
4849
return true

web/views/public/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
{{if eq true .isAdmin}}
4343
admin
4444
{{else}}
45-
user
45+
{{.username}}
4646
{{end}}
4747
</strong>
4848
</span> <span class="text-muted text-xs block">system </span> </span>

0 commit comments

Comments
 (0)