|
|
@@ -206,13 +206,29 @@ namespace BPA.SAAS.Manage.Application.Auth |
|
|
|
{ |
|
|
|
throw Oops.Oh("授权信息不存在"); |
|
|
|
} |
|
|
|
data.Key = Guid.NewGuid().ToString(); |
|
|
|
data.PeriodValidity = input.PeriodValidity; |
|
|
|
data.UpdateAt = DateTime.Now; |
|
|
|
|
|
|
|
return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 删除授权码 |
|
|
|
/// </summary> |
|
|
|
/// <param name="id"></param> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("/api/authorization/delauthorization")] |
|
|
|
public async Task<bool> DelAuthorization(string id) |
|
|
|
{ |
|
|
|
var data = await _db.Queryable<BPA_PlatformAuthorization>().FirstAsync(x => x.Id == id); |
|
|
|
if (data == null) |
|
|
|
{ |
|
|
|
throw Oops.Oh("授权信息不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
return await _db.Deleteable(data).ExecuteCommandHasChangeAsync(); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |