...
|
...
|
@@ -292,8 +292,10 @@ func (svr AuthService) OrgSwitch(switchOrgCommand *command.SwitchOrgCommand) (in |
|
|
}
|
|
|
var userId int64
|
|
|
if v, ok := token["userId"]; ok {
|
|
|
if userId, ok = v.(int64); !ok {
|
|
|
if vInt, ok := v.(int); !ok || vInt == 0 {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "用户不存在")
|
|
|
} else {
|
|
|
userId = int64(vInt)
|
|
|
}
|
|
|
}
|
|
|
user, err := svr.getUserInfo(domain.Operator{UserId: userId})
|
...
|
...
|
@@ -311,7 +313,7 @@ func (svr AuthService) OrgSwitch(switchOrgCommand *command.SwitchOrgCommand) (in |
|
|
var res = map[string]interface{}{
|
|
|
"user": user,
|
|
|
"accessMenus": resultMenu.Menus,
|
|
|
"token": token["token"],
|
|
|
"access": token["token"],
|
|
|
}
|
|
|
return res, nil
|
|
|
}
|
...
|
...
|
|