feat(pet): 添加宠物收集功能和称号系统

- 实现了宠物收集任务状态查询功能
- 新增Collect方法处理宠物收集逻辑,包括类型验证和ID合法性检查
- 创建validTypeIDMap映射表统一管理合法的类型ID集合
- 重构任务状态判断逻辑,基于model.Completion状态进行判断

refactor(map): 统一玩家信息结构体

- 将OutInfo重命名为SimpleInfo并添加Title字段
- 更新EnterMap方法的返回类型为SimpleInfo
- 修改space包中的UserInfo映射类型为SimpleInfo

feat(task): 集成称号奖励到任务系统

- 在PlayerInfo结构体中添加Title字段
- 扩展TaskConfig模型支持称号奖励配置
- 更新用户信息服务处理用户名大小写转换

refactor(space): 优化空间服务数据结构

- 更新GetInfo方法返回SimpleInfo切片
- 调整UserInfo CsMap泛型类型参数
- 修改ListMapPlayerOutboundInfo中Player数组类型

style(login): 规范化用户名输入处理

- 登录时将用户名转换为小写进行比较
- 使用strings.EqualFold进行大小
This commit is contained in:
昔念
2026-01-17 00:47:41 +08:00
parent b6754df9a0
commit 08ebf849eb
17 changed files with 168 additions and 61 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"strings"
"time"
"github.com/golang-jwt/jwt/v4"
@@ -43,7 +44,7 @@ func (s *BaseSysLoginService) Login(ctx context.Context, req *v1.BaseOpenLoginRe
username = req.Username
baseSysUser = model.NewBaseSysUser()
)
username = strings.ToLower(username)
vcode, _ := cool.CacheManager.Get(ctx, "login:"+captchaId)
if vcode.String() != verifyCode {
err = gerror.New("验证码错误")
@@ -66,7 +67,7 @@ func (s *BaseSysLoginService) Login(ctx context.Context, req *v1.BaseOpenLoginRe
md5password, _ := gmd5.Encrypt(password)
var user *model.BaseSysUser
if userInfo.Data.Attributes.Username != username { //说明没查找到用户
if !strings.EqualFold(userInfo.Data.Attributes.Username, username) { //说明没查找到用户
//后端添加的账户
cool.DBM(baseSysUser).Where("username=?", username).Where("password=?", md5password).Where("status=?", 1).Scan(&user)
if user == nil {