|
@@ -224,13 +224,16 @@ func GetI2bilUserInfo(userId int64, engine *xorm.Engine) (*UserXorm, error) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func GetAcquirePerm(userId int64, rpcClient transformclient.Transform, engine *xorm.Engine, ctx context.Context) (*transform.GetErpRoleRes, error) {
|
|
func GetAcquirePerm(userId int64, rpcClient transformclient.Transform, engine *xorm.Engine, ctx context.Context) (*transform.GetErpRoleRes, error) {
|
|
|
-
|
|
|
|
|
|
|
+ var res = new(transform.GetErpRoleRes)
|
|
|
partUser, err := GetPartTimeXormByUserId(userId, engine)
|
|
partUser, err := GetPartTimeXormByUserId(userId, engine)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
if partUser.Id != 0 && partUser.MkId != "" {
|
|
if partUser.Id != 0 && partUser.MkId != "" {
|
|
|
- return GetErpUser("", partUser.MkId, rpcClient, ctx)
|
|
|
|
|
|
|
+ res, err = GetErpUser("", partUser.MkId, rpcClient, ctx)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ return nil, err
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
user, err := GetI2bilUserInfo(userId, engine)
|
|
user, err := GetI2bilUserInfo(userId, engine)
|
|
@@ -238,7 +241,14 @@ func GetAcquirePerm(userId int64, rpcClient transformclient.Transform, engine *x
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return GetErpUser(user.Mobile, "", rpcClient, ctx)
|
|
|
|
|
|
|
+ resMobile, err := GetErpUser(user.Mobile, "", rpcClient, ctx)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ return nil, err
|
|
|
|
|
+ }
|
|
|
|
|
+ if resMobile.UserId != "" {
|
|
|
|
|
+ res = resMobile
|
|
|
|
|
+ }
|
|
|
|
|
+ return res, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type AcquirePermInfo struct {
|
|
type AcquirePermInfo struct {
|