瀏覽代碼

提交

master
gwbvipvip 8 月之前
父節點
當前提交
1ee72c80e0
共有 2 個檔案被更改,包括 25 行新增1 行删除
  1. +17
    -1
      BPA.SAAS.Manage.Application/Auth/AuthService.cs
  2. +8
    -0
      BPA.SAAS.Manage.Application/Auth/IAuthService.cs

+ 17
- 1
BPA.SAAS.Manage.Application/Auth/AuthService.cs 查看文件

@@ -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
}
}

+ 8
- 0
BPA.SAAS.Manage.Application/Auth/IAuthService.cs 查看文件

@@ -44,6 +44,14 @@ namespace BPA.SAAS.Manage.Application.Auth
/// <returns></returns>
Task<bool> UpdateAuthTime(CreateOrUpDatePlatformAuthorizationDto input);


/// <summary>
/// 删除授权
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<bool> DelAuthorization(string id);

#endregion
}
}

Loading…
取消
儲存