This commit is contained in:
parent
91f093867a
commit
629075f38b
|
|
@ -41,6 +41,11 @@ namespace LY.App.Model
|
||||||
/// 是否管理员,如果不是管理员,不可操作
|
/// 是否管理员,如果不是管理员,不可操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAdmin { get; set; }
|
public bool IsAdmin { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 用户关键防区数组
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地ids", IsJson = true)]
|
||||||
|
public List<long> positionId { get; set; }
|
||||||
}
|
}
|
||||||
public class AddUser
|
public class AddUser
|
||||||
{
|
{
|
||||||
|
|
@ -56,6 +61,7 @@ namespace LY.App.Model
|
||||||
/// 是否管理员,如果不是管理员,不可操作
|
/// 是否管理员,如果不是管理员,不可操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAdmin { get; set; }
|
public bool IsAdmin { get; set; }
|
||||||
|
public List<long> positionId { get; set; }
|
||||||
}
|
}
|
||||||
public class UpdateUser:AddUser
|
public class UpdateUser:AddUser
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -142,15 +142,17 @@ namespace LY.App.Service
|
||||||
//加入redis
|
//加入redis
|
||||||
await _redisService.SetAsync<string>(RedisKeyList.TokenUser(input.username),
|
await _redisService.SetAsync<string>(RedisKeyList.TokenUser(input.username),
|
||||||
token, TimeSpan.FromSeconds(60 * 60 * 24 * 7));
|
token, TimeSpan.FromSeconds(60 * 60 * 24 * 7));
|
||||||
|
var positionIds = entity.positionId?.Select(s => s.ToString()).ToList();
|
||||||
return new ApiResult()
|
return new ApiResult()
|
||||||
{
|
{
|
||||||
code = 1,
|
code = 1,
|
||||||
data = new
|
data = new
|
||||||
{
|
{
|
||||||
token,
|
token,
|
||||||
expires = DateTime.UtcNow.AddSeconds(60*60*24*7),
|
expires = DateTime.UtcNow.AddSeconds(60 * 60 * 24 * 7),
|
||||||
isAdmin = entity.IsAdmin,
|
isAdmin = entity.IsAdmin,
|
||||||
userid = entity.Id.ToString()
|
userid = entity.Id.ToString(),
|
||||||
|
positionIds
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue