Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f41ba0150 | ||
|
|
9bce77a08e | ||
|
|
8c7f4ac12f |
@@ -6,6 +6,7 @@ using SimApi.Helpers;
|
||||
|
||||
namespace SimApi.Controllers
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "api")]
|
||||
public class YYCommonController : SimApiBaseController
|
||||
{
|
||||
private SimApiAuth Auth { get; }
|
||||
@@ -37,7 +38,7 @@ namespace SimApi.Controllers
|
||||
public SimApiBaseResponse<int> CheckLogin()
|
||||
{
|
||||
ErrorWhenNull(LoginInfo, 401);
|
||||
return new SimApiBaseResponse<int> { Data = LoginInfo.Id };
|
||||
return new SimApiBaseResponse<int> {Data = LoginInfo.Id};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -53,8 +54,9 @@ namespace SimApi.Controllers
|
||||
{
|
||||
token = Request.Headers["Token"];
|
||||
}
|
||||
|
||||
Auth.Logout(token);
|
||||
return new SimApiBaseResponse();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SimApi.Communications;
|
||||
@@ -34,7 +35,10 @@ namespace SimApi.Middlewares
|
||||
await Next(context);
|
||||
if (context.Response.StatusCode != 200)
|
||||
{
|
||||
throw new SimApiException(context.Response.StatusCode);
|
||||
if (!new[] {301, 302}.Contains(context.Response.StatusCode))
|
||||
{
|
||||
throw new SimApiException(context.Response.StatusCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (SimApiException ex)
|
||||
|
||||
+1
-1
@@ -1,7 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp5.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<PackOnBuild>true</PackOnBuild>
|
||||
<Version>0.2.3</Version>
|
||||
@@ -15,6 +14,7 @@
|
||||
<SynchReleaseVersion>false</SynchReleaseVersion>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageVersion>5.0.2</PackageVersion>
|
||||
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'YYApi' " />
|
||||
|
||||
Reference in New Issue
Block a user