diff --git a/internal/demo/register/send_code.go b/internal/demo/register/send_code.go index cd67c0c04..c7fca46e6 100644 --- a/internal/demo/register/send_code.go +++ b/internal/demo/register/send_code.go @@ -34,11 +34,12 @@ func init() { } type paramsVerificationCode struct { - Email string `json:"email"` - PhoneNumber string `json:"phoneNumber"` - OperationID string `json:"operationID" binding:"required"` - UsedFor int `json:"usedFor"` - AreaCode string `json:"areaCode"` + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + OperationID string `json:"operationID" binding:"required"` + UsedFor int `json:"usedFor"` + AreaCode string `json:"areaCode"` + InvitationCode string `json:"invitationCode"` } func SendVerificationCode(c *gin.Context) { diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index f88b9b42c..a553a10cd 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -30,6 +30,7 @@ type ParamsSetPassword struct { FaceURL string `json:"faceURL"` OperationID string `json:"operationID" binding:"required"` AreaCode string `json:"areaCode"` + InvitationCode string `json:"invitationCode"` } func SetPassword(c *gin.Context) { diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index aa165e572..a313b8c51 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -144,7 +144,6 @@ func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int, rwLock.Lock() defer rwLock.Unlock() log.NewInfo(operationID, utils.GetSelfFuncName(), " rpc args: ", uid, platformID, token) - return switch config.Config.MultiLoginPolicy { case constant.AllLoginButSameTermKick: if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn] diff --git a/pkg/common/db/model_struct.go b/pkg/common/db/model_struct.go index cd08ec8ae..ea2c0734d 100644 --- a/pkg/common/db/model_struct.go +++ b/pkg/common/db/model_struct.go @@ -3,11 +3,17 @@ package db import "time" type Register struct { - Account string `gorm:"column:account;primary_key;type:char(255)" json:"account"` - Password string `gorm:"column:password;type:varchar(255)" json:"password"` - Ex string `gorm:"column:ex;size:1024" json:"ex"` - UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"` - AreaCode string `gorm:"column:area_code;type:varchar(255)"` + Account string `gorm:"column:account;primary_key;type:char(255)" json:"account"` + Password string `gorm:"column:password;type:varchar(255)" json:"password"` + Ex string `gorm:"column:ex;size:1024" json:"ex"` + UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"` + AreaCode string `gorm:"column:area_code;type:varchar(255)"` + InvitationCode string `gorm:"column:invitation_code;type:varchar(255)"` +} + +type Invitation struct { + InvitationCode string `gorm:"column:invitation_code;primary_key;type:varchar(255)"` + CreateTime time.Time `gorm:"column:create_time"` } // diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go index e794b4884..58f651d94 100644 --- a/pkg/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -78,7 +78,7 @@ func initMysqlDB() { &GroupMember{}, &GroupRequest{}, &User{}, - &Black{}, &ChatLog{}, &Register{}, &Conversation{}, &AppVersion{}, &Department{}, &BlackList{}, &IpLimit{}, &UserIpLimit{}) + &Black{}, &ChatLog{}, &Register{}, &Conversation{}, &AppVersion{}, &Department{}, &BlackList{}, &IpLimit{}, &UserIpLimit{}, &Invitation{}) db.Set("gorm:table_options", "CHARSET=utf8") db.Set("gorm:table_options", "collation=utf8_unicode_ci")