|
@@ -521,7 +521,7 @@ func SmsCodeCheck(phone string, code string) error { |
|
@@ -521,7 +521,7 @@ func SmsCodeCheck(phone string, code string) error { |
521
|
}
|
521
|
}
|
522
|
|
522
|
|
523
|
//InitPermission 登录时权限初始化
|
523
|
//InitPermission 登录时权限初始化
|
524
|
-func InitPermission(usercompanyid int64, usercompamyid int64) (map[string]serverbac.PermissionOptionObject, error) {
|
524
|
+func InitPermission(usercompanyid int64, userid int64) (map[string]serverbac.PermissionOptionObject, error) {
|
525
|
var (
|
525
|
var (
|
526
|
err error
|
526
|
err error
|
527
|
permissionMap = make(map[string]serverbac.PermissionOptionObject)
|
527
|
permissionMap = make(map[string]serverbac.PermissionOptionObject)
|
|
@@ -532,7 +532,7 @@ func InitPermission(usercompanyid int64, usercompamyid int64) (map[string]server |
|
@@ -532,7 +532,7 @@ func InitPermission(usercompanyid int64, usercompamyid int64) (map[string]server |
532
|
return permissionMap, err
|
532
|
return permissionMap, err
|
533
|
}
|
533
|
}
|
534
|
|
534
|
|
535
|
- err = redisdata.SetUserPermission(permissionMap, usercompamyid)
|
535
|
+ err = redisdata.SetUserPermission(permissionMap, userid)
|
536
|
if err != nil {
|
536
|
if err != nil {
|
537
|
log.Error("缓存用户权限失败:%s", err)
|
537
|
log.Error("缓存用户权限失败:%s", err)
|
538
|
}
|
538
|
}
|
|
@@ -577,7 +577,7 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { |
|
@@ -577,7 +577,7 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { |
577
|
var (
|
577
|
var (
|
578
|
err error
|
578
|
err error
|
579
|
logintoken protocol.LoginAuthToken
|
579
|
logintoken protocol.LoginAuthToken
|
580
|
- usercompanyid int64
|
580
|
+ // usercompanyid int64
|
581
|
userdata *models.User
|
581
|
userdata *models.User
|
582
|
companyData *models.Company
|
582
|
companyData *models.Company
|
583
|
)
|
583
|
)
|
|
@@ -628,6 +628,6 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { |
|
@@ -628,6 +628,6 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { |
628
|
if err != nil {
|
628
|
if err != nil {
|
629
|
log.Error("更新用户user_company数据失败:%s", err)
|
629
|
log.Error("更新用户user_company数据失败:%s", err)
|
630
|
}
|
630
|
}
|
631
|
- InitPermission(usercompanyid, userdata.Id)
|
631
|
+ InitPermission(ucompany.Id, userdata.Id)
|
632
|
return logintoken, err
|
632
|
return logintoken, err
|
633
|
} |
633
|
} |