feat:完善信息

This commit is contained in:
henry
2021-10-13 17:17:28 +08:00
parent 52dc8cb57d
commit 8f7aeba547
14 changed files with 272 additions and 113 deletions

View File

@ -83,7 +83,7 @@ func (c *Instance) SwitchIdentity(identity int) error {
if err = orm.GetDB().Transaction(func(tx *gorm.DB) error {
if err = model2.UpdatesWhere(mUserManage.UserManage, map[string]interface{}{
"selected": model2.UserManageSelectedForNo, "updated_at": now,
}, []*model2.ModelWhere{model2.NewWhere("uid", c.TenantUID)}, tx); err != nil {
}, []*model2.ModelWhere{model2.NewWhere("uid", c.ManageUID)}, tx); err != nil {
return err
}
return model2.Updates(mUserManage.UserManage, map[string]interface{}{
@ -94,7 +94,7 @@ func (c *Instance) SwitchIdentity(identity int) error {
}
}
c.TenantID = mUserManage.TenantID
c.TenantUID = mUserManage.UUID
c.ManageUID = mUserManage.UUID
}
c.SelectIdentity = identity
service.Publish(config2.EventForAccountLoginProduce, config2.RedisKeyForAccount, c.UIDToString(), c.SessionEnterprise)
@ -103,6 +103,6 @@ func (c *Instance) SwitchIdentity(identity int) error {
func NewInstance() InstanceHandle {
return func(enterprise *service.SessionEnterprise) *Instance {
return &Instance{enterprise}
return &Instance{SessionEnterprise: enterprise}
}
}