```
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:
@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"blazing/cool"
|
||||
|
||||
@@ -118,7 +119,7 @@ func (s *BaseSysUserService) Gen(user UserAttributes) (data interface{}, err err
|
||||
lastInsertId, err := m.Data(user).Data(
|
||||
|
||||
g.Map{
|
||||
"username": user.Username,
|
||||
"username": strings.ToLower(user.Username),
|
||||
"headImg": user.AvatarUrl,
|
||||
"departmentId": 1,
|
||||
},
|
||||
@@ -150,6 +151,9 @@ func (s *BaseSysUserService) ServiceAdd(ctx context.Context, req *cool.AddReq) (
|
||||
if !r.Get("password").IsNil() {
|
||||
reqmap["password"] = gmd5.MustEncryptString(r.Get("password").String())
|
||||
}
|
||||
if !r.Get("username").IsNil() {
|
||||
reqmap["username"] = strings.ToLower(r.Get("username").String())
|
||||
}
|
||||
if s.UniqueKey != nil {
|
||||
for k, v := range s.UniqueKey {
|
||||
if reqmap[k] != nil {
|
||||
@@ -225,7 +229,9 @@ func (s *BaseSysUserService) ServiceUpdate(ctx context.Context, req *cool.Update
|
||||
|
||||
r := g.RequestFromCtx(ctx)
|
||||
rMap := r.GetMap()
|
||||
|
||||
if !r.Get("username").IsNil() {
|
||||
rMap["username"] = strings.ToLower(r.Get("username").String())
|
||||
}
|
||||
// 如果不传入ID代表更新当前用户
|
||||
userId := r.Get("id", admin.UserId).Uint()
|
||||
userInfo, err := m.Where("id", userId).One()
|
||||
|
||||
Reference in New Issue
Block a user