From c3b7c2611940a4b855f88b91bffd0d7f76b97b17 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 13 Dec 2019 20:54:55 +0800 Subject: [PATCH] :art: #2 --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3d07166..b2ca424 100644 --- a/main.go +++ b/main.go @@ -254,7 +254,8 @@ func startHandler(w http.ResponseWriter, r *http.Request) { httpSession.Save(r, w) uid := httpSession.Values["uid"].(string) - locale := conf.GetUser(uid).Locale + user := conf.GetUser(uid) + locale := user.Locale userWorkspace := conf.GetUserWorkspace(uid) sid := r.URL.Query()["sid"][0] @@ -264,7 +265,7 @@ func startHandler(w http.ResponseWriter, r *http.Request) { } model := map[string]interface{}{"conf": conf.Wide, "i18n": i18n.GetAll(locale), "locale": locale, - "uid": uid, "workspace": userWorkspace, "ver": conf.WideVersion, "sid": sid} + "uid": uid, "workspace": userWorkspace, "ver": conf.WideVersion, "sid": sid, "username": user.Name} t, err := template.ParseFiles("views/start.html")