mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
Use user.GetId()
This commit is contained in:
parent
155660b0d7
commit
11695220a8
@ -217,7 +217,7 @@ func (c *ApiController) Signup() {
|
||||
record.User = user.Name
|
||||
util.SafeGoroutine(func() { object.AddRecord(record) })
|
||||
|
||||
userId := fmt.Sprintf("%s/%s", user.Owner, user.Name)
|
||||
userId := user.GetId()
|
||||
util.LogInfo(c.Ctx, "API: [%s] is signed up as new user", userId)
|
||||
|
||||
c.ResponseOk(userId)
|
||||
|
@ -112,9 +112,9 @@ func (c *ApiController) GetUser() {
|
||||
user = object.GetUser(id)
|
||||
}
|
||||
|
||||
roles := object.GetRolesByUser(fmt.Sprintf("%s/%s", user.Owner, user.Name))
|
||||
roles := object.GetRolesByUser(user.GetId())
|
||||
user.Roles = roles
|
||||
permissions := object.GetPermissionsByUser(fmt.Sprintf("%s/%s", user.Owner, user.Name))
|
||||
permissions := object.GetPermissionsByUser(user.GetId())
|
||||
user.Permissions = permissions
|
||||
|
||||
c.Data["json"] = object.GetMaskedUser(user)
|
||||
|
Loading…
x
Reference in New Issue
Block a user