Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor controllers to resolve the ABP route warning #79

Merged
merged 1 commit into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<AbpVersion>6.0.1</AbpVersion>
<EasyAbpAbpTagHelperPlusModuleVersion>1.2.3</EasyAbpAbpTagHelperPlusModuleVersion>
<EasyAbpAbpWeChatModuleVersion>2.0.0-rc.20</EasyAbpAbpWeChatModuleVersion>
<EasyAbpAbpWeChatModuleVersion>2.0.0-rc.21</EasyAbpAbpWeChatModuleVersion>

</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.0.0-rc.20</Version>
<Version>2.0.0-rc.21</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public Task<string> RefreshAsync(RefreshInput input)
}

[HttpGet]
[Route("pc-login-acode")]
[Route("pc-login-acode/{miniProgramName}")]
[Route("pc-login-acode/{miniProgramName?}")]
public Task<GetPcLoginACodeOutput> GetPcLoginACodeAsync(string miniProgramName, string handlePage = null)
{
return _service.GetPcLoginACodeAsync(miniProgramName, handlePage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public WeChatThirdPartyPlatformController(
/// <returns></returns>
[HttpGet]
[Route("auth-callback/token/{token}")]
[Route("auth-callback/tenant-id/{tenantId}/token/{token}")]
public virtual async Task<ActionResult> AuthCallbackAsync(string tenantId, string token)
{
using var changeTenant = CurrentTenant.Change(tenantId.IsNullOrWhiteSpace() ? null : Guid.Parse(tenantId));
Expand All @@ -53,4 +52,15 @@ await AuthorizationAppService.HandleCallbackAsync(new HandleCallbackInputDto(

return await AuthCallbackActionResultProvider.GetAsync(result);
}

/// <summary>
/// 本方法是为了避免多 Route 导致 ABP ApiDescription 报 Warning。
/// 见 <see cref="AuthCallbackAsync"/>
/// </summary>
[HttpGet]
[Route("auth-callback/tenant-id/{tenantId}/token/{token}")]
public virtual Task<ActionResult> AuthCallback2Async(string tenantId, string token)
{
return AuthCallbackAsync(tenantId, token);
}
}