app升级功能

temp
ZR20090193-陈敬勇 2 years ago
parent f8e5d6d55d
commit 7740db688c

@ -13,5 +13,7 @@ namespace VOL.System.IServices
{
public string ();
public WebResponseContent AppUpdate(string appVersion);
}
}

@ -47,6 +47,26 @@ namespace VOL.System.Services
return _r;
}
/// <summary>
/// APP更新
/// </summary>
/// <param name="appVersion"></param>
/// <returns></returns>
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();

@ -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;
}
/// <summary>
/// app更新
/// </summary>
/// <param name="appVersion"></param>
/// <returns></returns>
[Route("AppUpdate"), HttpGet, ApiActionPermission("Sys_Param_Set", ActionPermissionOptions.Search)]
public async Task<IActionResult> AppUpdate([FromQuery] string appVersion)
{
return Json( Service.AppUpdate(appVersion));
}
}
}

@ -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 该设置可以下载所有类型的文件,但是不建议这么设置,因为不安全
//下面设置可以下载apk和nupkg类型的文件
ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary<string, string>
{
{ ".apk", "application/vnd.android.package-archive" },
{ ".png", "application/png" }
})
});
//配置HttpContext
app.UseStaticHttpContext();

@ -62,6 +62,7 @@
<Folder Include="wwwroot\Upload\Tables\" />
<Folder Include="Upload\" />
<Folder Include="wwwroot\Upload\Tables\OP_YARD_COMPANY" />
<Folder Include="wwwroot\Update\" />
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save