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 @@ +