init: radio init commit

This commit is contained in:
Blizzard
2026-02-28 15:56:26 +08:00
parent fc585fa4df
commit d79beb4663
63 changed files with 2540 additions and 6399 deletions
+12
View File
@@ -12,6 +12,7 @@ import (
"strconv"
"sundynix-go/global"
common "sundynix-go/model/commom/request"
"sundynix-go/model/radio"
"sundynix-go/model/system"
systemReq "sundynix-go/model/system/request"
systemResp "sundynix-go/model/system/response"
@@ -157,6 +158,17 @@ func (userService *UserService) MiniLogin(code string) (result *system.User, err
if err := tx.Create(&newUser).Error; err != nil {
return err
}
// 创建小程序用户
mpUser := radio.RadioUser{
UserId: newUser.Id,
OpenId: wxResp.Openid,
UnionId: wxResp.Unionid,
SessionKey: wxResp.SessionKey,
}
if err := tx.Create(&mpUser).Error; err != nil {
return err
}
// 赋值给外部变量以便返回
user = newUser
return nil