feat:完善信息
This commit is contained in:
@ -31,8 +31,19 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func (c *Instance) User() {
|
||||
type (
|
||||
// InstanceInfoReturn 基本信息返回
|
||||
InstanceInfoReturn struct {
|
||||
Name string `json:"name"`
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Identity string `json:"identity"`
|
||||
SelectIdentity string `json:"select_identity"` // 最后一次选中的身份信息
|
||||
}
|
||||
)
|
||||
|
||||
// Info 基本信息
|
||||
func (c *Instance) Info() *InstanceInfoReturn {
|
||||
return &InstanceInfoReturn{Name: c.Name}
|
||||
}
|
||||
|
||||
// Perfect 完善信息
|
||||
@ -49,9 +60,10 @@ func (c *Instance) Perfect(params *InstancePerfectParams) error {
|
||||
mUserTenant.Name = params.Name
|
||||
mUserTenant.Email = params.Email
|
||||
mUserTenant.Area = model2.Area{Province: params.Province, City: params.City, District: params.District, Address: params.Address}
|
||||
// 更新身份信息
|
||||
// 更新身份信息,提交审核
|
||||
if mUserTenant.Identity == 0 {
|
||||
mUserTenant.Identity = c.CurrentIdentity
|
||||
mUserTenant.Status = model2.UserTenantStatusForExamining
|
||||
}
|
||||
orm.GetDB().Transaction(func(tx *gorm.DB) error {
|
||||
return nil
|
||||
@ -77,7 +89,7 @@ func (c *Instance) ChangeIdentity(identity int) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.UID = mUserTenant.UUID
|
||||
//c.UID = mUserTenant.UUID
|
||||
|
||||
now := time.Now()
|
||||
|
||||
|
Reference in New Issue
Block a user