From 1033e373bd9849c4feeb58bd613a611f2d019aac Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 4 Jun 2023 22:49:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E9=AA=8C=E8=AF=81=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Middlewares/ClientVersionValidationMiddleWare.cs | 6 +++--- PJZS/App.xaml.cs | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs b/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs index 1d8d4fcd..0ebfc7cd 100644 --- a/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs +++ b/BBWY.Server.API/Middlewares/ClientVersionValidationMiddleWare.cs @@ -36,11 +36,11 @@ namespace BBWY.Server.API.Middlewares if (apiRequirement != null) { if (!context.Request.Headers.TryGetValue("ClientVersion", out StringValues clientVersionStr)) - throw new BusinessException("未读取到ClientVersion"); + throw new BusinessException("缺少版本信息,请更新步步为盈"); if (!int.TryParse(clientVersionStr, out int clientVersion)) - throw new BusinessException("非法ClientVersion"); + throw new BusinessException("版本信息不正确,请更新步步为盈"); if (clientVersion < apiRequirement.MinimumVersion) - throw new BusinessException("当前ClientVersion低于接口最低要求,请升级到最新版"); + throw new BusinessException("当前请求需更新步步为盈~!"); } await _next(context); //调用管道执行下一个中间件 } diff --git a/PJZS/App.xaml.cs b/PJZS/App.xaml.cs index bd92d274..473a4c82 100644 --- a/PJZS/App.xaml.cs +++ b/PJZS/App.xaml.cs @@ -1,17 +1,16 @@ -using BBWY.Common.Http; +using BBWY.Common.Extensions; +using BBWY.Common.Http; using BBWY.Common.Models; -using BBWY.Common.Extensions; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using PJZS.Models; using System; +using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Threading.Tasks; using System.Windows; -using PJZS.Models; -using System.Linq; -using System.IO.MemoryMappedFiles; -using System.Diagnostics; using Utils; namespace PJZS