...
|
...
|
@@ -521,7 +521,7 @@ func SmsCodeCheck(phone string, code string) error { |
|
|
}
|
|
|
|
|
|
//InitPermission 登录时权限初始化
|
|
|
func InitPermission(usercompanyid int64, usercompamyid int64) (map[string]serverbac.PermissionOptionObject, error) {
|
|
|
func InitPermission(usercompanyid int64, userid int64) (map[string]serverbac.PermissionOptionObject, error) {
|
|
|
var (
|
|
|
err error
|
|
|
permissionMap = make(map[string]serverbac.PermissionOptionObject)
|
...
|
...
|
@@ -532,7 +532,7 @@ func InitPermission(usercompanyid int64, usercompamyid int64) (map[string]server |
|
|
return permissionMap, err
|
|
|
}
|
|
|
|
|
|
err = redisdata.SetUserPermission(permissionMap, usercompamyid)
|
|
|
err = redisdata.SetUserPermission(permissionMap, userid)
|
|
|
if err != nil {
|
|
|
log.Error("缓存用户权限失败:%s", err)
|
|
|
}
|
...
|
...
|
@@ -577,7 +577,7 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { |
|
|
var (
|
|
|
err error
|
|
|
logintoken protocol.LoginAuthToken
|
|
|
usercompanyid int64
|
|
|
// usercompanyid int64
|
|
|
userdata *models.User
|
|
|
companyData *models.Company
|
|
|
)
|
...
|
...
|
@@ -628,6 +628,6 @@ func LoginAuthBySecretKey(secretKey string) (protocol.LoginAuthToken, error) { |
|
|
if err != nil {
|
|
|
log.Error("更新用户user_company数据失败:%s", err)
|
|
|
}
|
|
|
InitPermission(usercompanyid, userdata.Id)
|
|
|
InitPermission(ucompany.Id, userdata.Id)
|
|
|
return logintoken, err
|
|
|
} |
...
|
...
|
|