refactor(login): 修改登录服务相关功能
- 修改端口配置:将 .vscode/launch.json 中的端口从 27777 改为 27000 - 优化会话管理:更新 session 包中的 GetSession 和 SaveSession 函数,使用新的 sessionprx 变量 - 调整登录逻辑:修改 login 控制器中的 Login 函数,优化会话验证流程 - 扩展服务器信息结构:在 CommendSvrInfo 结构中添加好友和黑名单信息字段 - 修复 GetSessionId 函数:改进错误处理,确保返回值的一致性 - 更新服务器配置:修改 ServerR.xml 中的 EmailLogin URL 为本地地址 - 其他 minor changes:删除了一些不必要的注释和打印语句
This commit is contained in:
@@ -62,7 +62,11 @@ func (c *BlazingController) GetSession(ctx context.Context, req *SessionReq) (re
|
||||
res.Code = 400
|
||||
res.Msg = err.Error()
|
||||
}
|
||||
|
||||
if res1 == nil {
|
||||
res.Code = 400
|
||||
res.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
accountID := res1.ID
|
||||
retsid, sid, err := biazing_service.GetSessionId(accountID)
|
||||
if err != nil {
|
||||
|
||||
@@ -41,12 +41,12 @@ func (s *LoginService) GetSessionId(accountID uint) (string, string, error) {
|
||||
binary.BigEndian.PutUint32(buf2, uint32(accountID))
|
||||
|
||||
//fmt.Printf("小端序: %v (十六进制: %x)\n", buf2, buf2) // 输出: [252 255 255 255] (0xFCFFFFFF)
|
||||
|
||||
ttid, _ := hex.DecodeString(tt)
|
||||
//fmt.Println(bytes, "随机字节")
|
||||
ret := append(bytes, hex.EncodeToString([]byte(tt))...)
|
||||
ret := append(buf2, ttid...)
|
||||
ret = append(ret, bytes...)
|
||||
|
||||
return string(ret), tt, nil
|
||||
return hex.EncodeToString(ret), tt, nil
|
||||
// /t1.
|
||||
// 以上过程只需全局一次,且应在生成ID之前完成。
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user