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