This commit is contained in:
2025-06-12 10:20:26 +08:00
parent 96d537c044
commit b71e718308
40 changed files with 1961 additions and 108 deletions

View File

@@ -101,7 +101,7 @@ func (h *ConfigHandler) Save(w http.ResponseWriter, r *http.Request) {
if id == 0 {
arg := &systemModel.Config{
Key: key,
Value: value,
Value: []byte(value),
}
err := h.configService.Create(ctx, arg)
if err != nil {
@@ -121,7 +121,7 @@ func (h *ConfigHandler) Save(w http.ResponseWriter, r *http.Request) {
return
}
res.Value = value
res.Value = []byte(value)
err = h.configService.Update(ctx, res)
if err != nil {
h.JSONErr(w, err.Error())

View File

@@ -33,12 +33,12 @@ func (h *HomeHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
auth := h.AuthUser(ctx)
user, _ := h.userService.Get(ctx, auth.ID)
t := h.loginLogService.LoginLatestTime(ctx, auth.Email)
lt, _ := h.loginLogService.LoginTime(ctx, auth.Email)
c := h.loginLogService.LoginCount(ctx, auth.Email)
h.HTML(w, r, "home/dashboard.tmpl", map[string]any{
"Auth": auth,
"User": user,
"LastLoginTime": t,
"LoginCount": c,
"Auth": auth,
"User": user,
"LoginTime": lt,
"LoginCount": c,
})
}