Merge branch 'develop' of git.ailuowan.com:zzw/lone-services into develop
CI / changes (push) Successful in 5s
CI / docker-bff (push) Successful in 3m9s
CI / docker-product (push) Successful in 3m31s
CI / docker-admin (push) Successful in 16s
CI / docker-user (push) Successful in 3m23s
CI / docker-ad (push) Successful in 3m25s

This commit is contained in:
zzw
2026-08-21 17:38:53 +08:00
33 changed files with 2133 additions and 76 deletions
+3 -2
View File
@@ -3,6 +3,7 @@ package utils
import (
"context"
"lone-services/pkg/logRedis"
"time"
jsoniter "github.com/json-iterator/go"
"github.com/zeromicro/go-zero/core/logx"
@@ -102,7 +103,7 @@ func SetActionLog(adminInfo UserInfo, info ActionAdd) {
BrowserName: adminInfo.BrowserName,
BrowserVersion: adminInfo.BrowserVer,
Reason: info.Reason,
CreateTime: Now().GoString(),
CreateTime: Now().Format(time.DateTime),
}
logJson, err := jsoniter.Marshal(log)
@@ -128,7 +129,7 @@ func SetLoginLog(adminInfo UserInfo, status bool, reason string) {
BrowserName: adminInfo.BrowserName,
BrowserVersion: adminInfo.BrowserVer,
Status: int32(st),
CreateTime: Now().GoString(),
CreateTime: Now().Format(time.DateTime),
Reason: reason,
}
+1
View File
@@ -51,6 +51,7 @@ func GetUserFromCtx(ctx context.Context) UserInfo {
}
if len(userAgentList) > 0 {
userInfo.UserAgent = userAgentList[0]
userInfo.UserAgent, _ = url.QueryUnescape(userInfo.UserAgent)
ua := user_agent.New(userInfo.UserAgent)
userInfo.BrowserName, userInfo.BrowserVer = ua.Browser()
}