feat:完善入驻信息管理
This commit is contained in:
@ -18,7 +18,7 @@ type InstanceLoginCallback func(params *InstanceLoginParams) *InstanceLoginRetur
|
||||
type (
|
||||
InstanceLoginParams struct {
|
||||
UID uint64
|
||||
Name, Mobile string
|
||||
Avatar, Name, Mobile string
|
||||
Identity, SelectIdentity int
|
||||
Status model.AccountStatusKind
|
||||
}
|
||||
@ -36,6 +36,7 @@ func (c *Instance) Login() InstanceLoginCallback {
|
||||
_session := session.NewEnterprise()
|
||||
_session.Token = token
|
||||
_session.UID = params.UID
|
||||
_session.Avatar = params.Avatar
|
||||
_session.Name = params.Name
|
||||
_session.Mobile = params.Mobile
|
||||
_session.Identity = params.Identity
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
model3 "SciencesServer/app/api/enterprise/model"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/handle"
|
||||
"SciencesServer/config"
|
||||
"SciencesServer/utils"
|
||||
"errors"
|
||||
)
|
||||
@ -59,7 +60,7 @@ func loginForSmsCaptcha(params *LoginParams, local string) (*InstanceLoginParams
|
||||
// 查询账号信息
|
||||
mUserInstance := model3.NewUserInstance()
|
||||
|
||||
if isExist, err = model2.FirstField(mUserInstance.UserInstance, []string{"id", "uuid", "name", "mobile", "status"},
|
||||
if isExist, err = model2.FirstField(mUserInstance.UserInstance, []string{"id", "uuid", "avatar", "name", "mobile", "status"},
|
||||
model2.NewWhere("mobile", params.Captcha.Mobile)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -81,8 +82,8 @@ func loginForSmsCaptcha(params *LoginParams, local string) (*InstanceLoginParams
|
||||
}
|
||||
RETURNS:
|
||||
return &InstanceLoginParams{
|
||||
UID: mUserInstance.UUID,
|
||||
Name: mUserInstance.Name, Mobile: mUserInstance.Mobile,
|
||||
UID: mUserInstance.UUID,
|
||||
Avatar: mUserInstance.GetAvatarAttribute(config.SettingInfo.Domain), Name: mUserInstance.Name, Mobile: mUserInstance.Mobile,
|
||||
Identity: mUserInstance.Identity, SelectIdentity: mUserIdentity.Identity,
|
||||
Status: mUserInstance.Status,
|
||||
}, nil
|
||||
@ -95,7 +96,7 @@ func loginForPassword(params *LoginParams, local string) (*InstanceLoginParams,
|
||||
}
|
||||
mUserInstance := model3.NewUserInstance()
|
||||
|
||||
isExist, err := model2.FirstField(mUserInstance.UserInstance, []string{"id", "uuid", "name", "mobile", "password", "salt", "status"},
|
||||
isExist, err := model2.FirstField(mUserInstance.UserInstance, []string{"id", "uuid", "name", "avatar", "mobile", "password", "salt", "status"},
|
||||
model2.NewWhere("mobile", params.Password.Account))
|
||||
|
||||
if err != nil {
|
||||
@ -113,8 +114,8 @@ func loginForPassword(params *LoginParams, local string) (*InstanceLoginParams,
|
||||
return nil, err
|
||||
}
|
||||
return &InstanceLoginParams{
|
||||
UID: mUserInstance.UUID,
|
||||
Name: mUserInstance.Name, Mobile: mUserInstance.Mobile,
|
||||
UID: mUserInstance.UUID,
|
||||
Avatar: mUserInstance.GetAvatarAttribute(config.SettingInfo.Domain), Name: mUserInstance.Name, Mobile: mUserInstance.Mobile,
|
||||
Identity: mUserInstance.Identity, SelectIdentity: mUserIdentity.Identity,
|
||||
Status: mUserInstance.Status,
|
||||
}, nil
|
||||
|
@ -17,6 +17,7 @@ type InstanceHandle func(session *session.Enterprise) *Instance
|
||||
type (
|
||||
// InstanceInfo 基本信息
|
||||
InstanceInfo struct {
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Name string `json:"name"` // 名称
|
||||
Identity int `json:"identity"` // 具体身份
|
||||
SelectIdentity int `json:"select_identity"` // 最后一次选中的身份信息
|
||||
@ -32,7 +33,7 @@ type (
|
||||
|
||||
// Info 基本信息
|
||||
func (c *Instance) Info() *InstanceInfo {
|
||||
return &InstanceInfo{Name: c.Name, Identity: c.Identity, SelectIdentity: c.SelectIdentity}
|
||||
return &InstanceInfo{Avatar: c.Avatar, Name: c.Name, Identity: c.Identity, SelectIdentity: c.SelectIdentity}
|
||||
}
|
||||
|
||||
// BindMobile 绑定手机号码
|
||||
|
Reference in New Issue
Block a user