From 4827d9091ac1bd77dee4e28bed9cb82285e362f3 Mon Sep 17 00:00:00 2001 From: ckping0987 <253180123@qq.com> Date: Fri, 8 Dec 2023 15:12:31 +0000 Subject: [PATCH 1/2] =?UTF-8?q?update=20ZR.Admin.WebApi/Controllers/System?= =?UTF-8?q?/SysLoginController.cs.=20=E4=BF=AE=E5=A4=8D=20=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=AA=8C=E8=AF=81=E7=A0=81=E5=90=8E=EF=BC=8C=E4=BE=9D?= =?UTF-8?q?=E7=84=B6=E4=BC=9A=E7=94=9F=E6=88=90=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?BUG=EF=BC=88ps=EF=BC=9A=E5=BE=AE=E8=BD=AF=E8=87=AA=E5=B8=A6?= =?UTF-8?q?=E7=9A=84dotnet=20core=E9=95=9C=E5=83=8F=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=AA=8C=E8=AF=81=E7=A0=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ckping0987 <253180123@qq.com> --- ZR.Admin.WebApi/Controllers/System/SysLoginController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs index e6d88804..f5a0fa04 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs @@ -1,4 +1,4 @@ -using Lazy.Captcha.Core; +using Lazy.Captcha.Core; using Microsoft.AspNetCore.Mvc; using ZR.Admin.WebApi.Filters; using ZR.Infrastructure.Helper; @@ -141,9 +141,9 @@ namespace ZR.Admin.WebApi.Controllers.System SysConfig sysConfig = sysConfigService.GetSysConfigByKey("sys.account.captchaOnOff"); var captchaOff = sysConfig?.ConfigValue ?? "0"; - var info = SecurityCodeHelper.Generate(uuid, 60); - var obj = new { captchaOff, uuid, img = info.Base64 };// File(stream, "image/png") - + CaptchaData? info = null; + if(captchaOff == "0") info = SecurityCodeHelper.Generate(uuid, 60); + var obj = new { captchaOff, uuid, img = info?.Base64 };// File(stream, "image/png") return SUCCESS(obj); } -- Gitee From 99fa510d435826ac079daa06d8c936c3b5982f0e Mon Sep 17 00:00:00 2001 From: ckping0987 <253180123@qq.com> Date: Fri, 8 Dec 2023 16:09:22 +0000 Subject: [PATCH 2/2] =?UTF-8?q?update=20ZR.Admin.WebApi/Dockerfile.=20?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=9F=BA=E7=A1=80=E9=95=9C=E5=83=8F=EF=BC=8C?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=9B=BE=E7=89=87=E7=94=9F=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ckping0987 <253180123@qq.com> --- ZR.Admin.WebApi/Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ZR.Admin.WebApi/Dockerfile b/ZR.Admin.WebApi/Dockerfile index e62587c5..4079850a 100644 --- a/ZR.Admin.WebApi/Dockerfile +++ b/ZR.Admin.WebApi/Dockerfile @@ -1,4 +1,7 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +#FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +#dotnet core 默认镜像无法生成图片 +FROM cosmoeky/dotnet7.0:20231208 AS build + #创建 /app文件夹 WORKDIR /app #创建挂载目录,用于将程序部署在服务器本地 @@ -7,15 +10,18 @@ WORKDIR /app EXPOSE 8888 VOLUME /app/logs #COPY bin/Release/net5.0/publish/ app/ -COPY . app/ +COPY . /app/ #设置容器内的时区,如果不设置,默认时区是标准时间比北京时间晚8个小时 -RUN echo "Asia/shanghai" > /etc/timezone -RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +#RUN echo "Asia/shanghai" > /etc/timezone +#RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +#已经打包到cosmoeky/dotnet7.0里面了 + + # 复制发布文件到工作目录 #COPY . app/ WORKDIR /app #等价于 dotnet ZR.Admin.WebApi.dll,如果不指定启动端口默认在docker里面启动端口是80端口 -ENTRYPOINT ["dotnet", "ZR.Admin.WebApi.dll", "--server.urls","http://*:8888"] \ No newline at end of file +ENTRYPOINT ["dotnet", "ZR.Admin.WebApi.dll", "--server.urls","http://*:8888"] -- Gitee