| | |
| | | using MES.Service.Dto.@base; |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.@base; |
| | | using MES.Service.service; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System.Dynamic; |
| | | |
| | | namespace MESApplication.Controllers.Base; |
| | | |
| | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取App最新版本信息 |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <returns></returns> |
| | | [HttpPost("getAppUpgradeInfo")] |
| | | public async Task<ResponseResult> getAppUpgradeInfo() |
| | | { |
| | | try |
| | | { |
| | | HttpClient client = new(); |
| | | var requestUrl = |
| | | "http://192.168.1.104:8081/UpgradeInformation.json"; |
| | | var response = await client.GetAsync(requestUrl); |
| | | response.EnsureSuccessStatusCode(); // 检查HTTP状态码 |
| | | var responseContent = await response.Content.ReadAsStringAsync(); |
| | | var a = JsonConvert.DeserializeObject<Root>(responseContent); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = a |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public class Root |
| | | { |
| | | public string version { get; set; } |
| | | |
| | | public string apkUrl { get; set; } |
| | | } |
| | | } |