HomeController.cs
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using Hh.Mes.Common.config;
using Hh.Mes.Common.Json;
using Hh.Mes.Common.log;
using Hh.Mes.Common.Redis;
using Hh.Mes.Service;
using Hh.Mes.Service.Configure;
using Hh.Mes.Service.SystemAuth;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
namespace WebMvc
{
public class HomeController : BaseController
{
private readonly SysCompanyService SysCompanyService;
private readonly BaseInfoCacheService baseInfo;
public HomeController(IAuth authUtil, SysCompanyService sysCompanyService, BaseInfoCacheService baseInfo) : base(authUtil)
{
this.baseInfo = baseInfo;
SysCompanyService = sysCompanyService;
}
[ResponseCache(Duration = 60)]
public ActionResult Index()
{
ViewBag.copyright = "Copyright © " + DateTime.Now.ToString("yyyy ") + AppSettings.GetAppSeting("copyright");
ResponseEnumJosn();
var dt = baseInfo.GetOneBaseInfo("base_equipment_type", false);
ViewBag.equipmentType = dt.ToJson();
ViewBag.IsDevelopment = string.Format("let IsDevelopment={0}", ConfigRead.GetInstance.GetAppsetConnection().IsDevelopment.ToString().ToLower());
return View();
}
public ActionResult Main()
{
return View();
}
public ActionResult ProjectMap()
{
return View();
}
/// <summary>
/// 统计错误信息
/// </summary>
/// <returns></returns>
public string LogTips()
{
var result = SysCompanyService.LogTips();
return Serialize(result);
}
/// <summary>
/// 更新清空日志提示
/// </summary>
[HttpGet]
public string UpdateLogTips(string flag)
{
return Serialize(SysCompanyService.UpdateLogTips(flag));
}
}
}