feat: 多语言处理tkey

This commit is contained in:
TsMask committed 2023-11-21 14:42:37 +08:00
1 parent f490d9af0f
commit d5d3feb5fc
61 files changed
+1381 -757

No files matched your search

+4 -3
View File
@@ -82,13 +82,13 @@ func UaOsBrowser(c *gin.Context) (string, string) {
userAgent := c.GetHeader("user-agent")
uaInfo := ua.Info(userAgent)
browser := "Unknown Unknown"
browser := "app.common.noUaOsBrowser"
bName, bVersion := uaInfo.Browser()
if bName != "" && bVersion != "" {
browser = bName + " " + bVersion
}
os := "Unknown Unknown"
os := "app.common.noUaOsBrowser"
bos := uaInfo.OS()
if bos != "" {
os = bos
@@ -116,7 +116,8 @@ func LoginUser(c *gin.Context) (vo.LoginUser, error) {
if exists {
return value.(vo.LoginUser), nil
}
return vo.LoginUser{}, fmt.Errorf("invalid login user information")
// 登录用户信息无效
return vo.LoginUser{}, fmt.Errorf("app.common.noLoginUser")
}
// LoginUserToUserID 登录用户信息-用户ID