From 7740db688c3980e6ab49999d59d59841d63fa3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Wed, 31 May 2023 12:02:41 +0800 Subject: [PATCH] =?UTF-8?q?app=E5=8D=87=E7=BA=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../System/Partial/ISys_Param_SetService.cs | 2 ++ .../System/Partial/Sys_Param_SetService.cs | 20 +++++++++++++++++++ .../System/Partial/Sys_Param_SetController.cs | 12 +++++++++++ Vue.Net/VOL.WebApi/Startup.cs | 12 ++++++++++- Vue.Net/VOL.WebApi/VOL.WebApi.csproj | 1 + 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Vue.Net/VOL.System/IServices/System/Partial/ISys_Param_SetService.cs b/Vue.Net/VOL.System/IServices/System/Partial/ISys_Param_SetService.cs index c631953f..144651ae 100644 --- a/Vue.Net/VOL.System/IServices/System/Partial/ISys_Param_SetService.cs +++ b/Vue.Net/VOL.System/IServices/System/Partial/ISys_Param_SetService.cs @@ -13,5 +13,7 @@ namespace VOL.System.IServices { public string 获取出库费计算时机(); + public WebResponseContent AppUpdate(string appVersion); + } } diff --git a/Vue.Net/VOL.System/Services/System/Partial/Sys_Param_SetService.cs b/Vue.Net/VOL.System/Services/System/Partial/Sys_Param_SetService.cs index 6e7b810c..540883cd 100644 --- a/Vue.Net/VOL.System/Services/System/Partial/Sys_Param_SetService.cs +++ b/Vue.Net/VOL.System/Services/System/Partial/Sys_Param_SetService.cs @@ -47,6 +47,26 @@ namespace VOL.System.Services return _r; } + /// + /// APP更新 + /// + /// + /// + public WebResponseContent AppUpdate(string appVersion) + { + var info = Sys_Param_SetRepository.Instance.FindAsIQueryable(x => x.PARAMNAME == "AppVersion").First(); + var versionArr = info.PARAMVALUE.Split(';'); //转换数组 + + if (versionArr[0].ToString() == appVersion) + { + return WebResponseContent.Instance.Error("已经是最新版本!"); + } + else + { + return WebResponseContent.Instance.OK("获取最新版本成功!", versionArr[1]); + } + } + public string 获取出库费计算时机() { var 出库费计算时机 = Sys_Param_SetRepository.Instance.FindAsIQueryable(x => x.PARAMNAME == "DSWMSOUTFEE").ToList(); diff --git a/Vue.Net/VOL.WebApi/Controllers/System/Partial/Sys_Param_SetController.cs b/Vue.Net/VOL.WebApi/Controllers/System/Partial/Sys_Param_SetController.cs index dee2bed7..e370eeff 100644 --- a/Vue.Net/VOL.WebApi/Controllers/System/Partial/Sys_Param_SetController.cs +++ b/Vue.Net/VOL.WebApi/Controllers/System/Partial/Sys_Param_SetController.cs @@ -11,6 +11,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Http; using VOL.Entity.DomainModels; using VOL.System.IServices; +using VOL.Core.Filters; +using VOL.Core.Enums; namespace VOL.System.Controllers { @@ -29,5 +31,15 @@ namespace VOL.System.Controllers _service = service; _httpContextAccessor = httpContextAccessor; } + /// + /// app更新 + /// + /// + /// + [Route("AppUpdate"), HttpGet, ApiActionPermission("Sys_Param_Set", ActionPermissionOptions.Search)] + public async Task AppUpdate([FromQuery] string appVersion) + { + return Json( Service.AppUpdate(appVersion)); + } } } diff --git a/Vue.Net/VOL.WebApi/Startup.cs b/Vue.Net/VOL.WebApi/Startup.cs index bc5f7dcf..1fa20b24 100644 --- a/Vue.Net/VOL.WebApi/Startup.cs +++ b/Vue.Net/VOL.WebApi/Startup.cs @@ -26,6 +26,7 @@ using VOL.Core.Filters; using VOL.Core.Middleware; using VOL.Core.ObjectActionValidator; using ConvertHelper; +using Microsoft.AspNetCore.StaticFiles; namespace VOL.WebApi { @@ -183,8 +184,17 @@ namespace VOL.WebApi //ڴ˴ȡϢȨ֤ // staticFile.File // staticFile.Context.Response.StatusCode; - } + }, + //FileProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory()), + //òcontent-type ÿ͵ļDzôãΪȫ + //ÿapknupkg͵ļ + ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary + { + { ".apk", "application/vnd.android.package-archive" }, + { ".png", "application/png" } + }) }); + //HttpContext app.UseStaticHttpContext(); diff --git a/Vue.Net/VOL.WebApi/VOL.WebApi.csproj b/Vue.Net/VOL.WebApi/VOL.WebApi.csproj index 52a8440f..2215ba77 100644 --- a/Vue.Net/VOL.WebApi/VOL.WebApi.csproj +++ b/Vue.Net/VOL.WebApi/VOL.WebApi.csproj @@ -62,6 +62,7 @@ +