清理冗余代码
This commit is contained in:
parent
1f4b535c0d
commit
38f47e0fa7
12
Dockerfile
12
Dockerfile
@ -7,6 +7,18 @@ EXPOSE 9996
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
# 安装字体和依赖
|
||||
RUN apt-get update && apt-get install -y \
|
||||
fonts-liberation \
|
||||
fonts-dejavu-core \
|
||||
fonts-wqy-zenhei \
|
||||
fontconfig \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 重建字体缓存
|
||||
RUN fc-cache -fv
|
||||
|
||||
# ¹¹½¨½×¶Î
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
|
||||
@ -93,29 +93,5 @@ public class AuthService : IDynamicApiController
|
||||
return new FileStreamResult(stream, "image/gif");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新Token
|
||||
/// </summary>
|
||||
/// <param name="accessToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("refresh")]
|
||||
public string RefreshToken([FromQuery] string accessToken)
|
||||
{
|
||||
var context = _httpContextAccessor.HttpContext;
|
||||
var refreshToken = context.Request.Headers["x-access-token"].ToString();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(accessToken) || string.IsNullOrWhiteSpace(refreshToken))
|
||||
{
|
||||
throw Oops.Bah("无效的Token");
|
||||
}
|
||||
|
||||
// 交换新的 Token
|
||||
var newToken = JWTEncryption.Exchange(accessToken, refreshToken);
|
||||
|
||||
// 设置响应报文头
|
||||
context.Response.Headers["access-token"] = newToken;
|
||||
context.Response.Headers["x-access-token"] = refreshToken; // 刷新Token通常保持不变,或者也可以轮换
|
||||
|
||||
return newToken;
|
||||
}
|
||||
}
|
||||
@ -489,13 +489,6 @@
|
||||
<param name="id">验证码唯一id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:YD_Event.Application.Auth.AuthService.RefreshToken(System.String)">
|
||||
<summary>
|
||||
刷新Token
|
||||
</summary>
|
||||
<param name="accessToken"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Auth.Dtos.AdminLoginInput.Account">
|
||||
<summary>
|
||||
登录名
|
||||
|
||||
@ -11,7 +11,7 @@ namespace YD_Event.Web.Core;
|
||||
public class JwtHandler : AppAuthorizeHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// 这里写您的授权判断逻辑,授权通过返回 true,否则返回 false
|
||||
/// 授权判断逻辑,授权通过返回 true,否则返回 false
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="httpContext"></param>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user