Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78aa48a975 | ||
|
|
13f8ec1cec | ||
|
|
32ada25a4a | ||
|
|
ac134308ed | ||
|
|
79b5015091 | ||
|
|
ebc44ef9c9 | ||
|
|
d37a1ffbd5 | ||
|
|
42c4ec914c | ||
|
|
5077d6888f | ||
|
|
c265d6d413 | ||
|
|
254c49e676 | ||
|
|
71bbc27b1e | ||
|
|
e209c4a192 | ||
|
|
c3325efbc6 | ||
|
|
17008fc9c9 | ||
|
|
756dc66350 | ||
|
|
d74b350f86 | ||
|
|
687160e0ae | ||
|
|
ef9baadf92 | ||
|
|
c6be4db66c | ||
|
|
2ae73a7d1d |
@@ -29,6 +29,12 @@ namespace Infrastructure.Enums
|
||||
/// 七牛
|
||||
/// </summary>
|
||||
[Description("七牛云")]
|
||||
QINIU = 4
|
||||
QINIU = 4,
|
||||
|
||||
/// <summary>
|
||||
/// 远程
|
||||
/// </summary>
|
||||
[Description("远程")]
|
||||
REMOTE = 5
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Infrastructure
|
||||
public string Password { get; set; }
|
||||
public string Smtp { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string Signature { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传
|
||||
@@ -31,6 +32,7 @@ namespace Infrastructure
|
||||
public class Upload
|
||||
{
|
||||
public string UploadUrl { get; set; }
|
||||
public string LocalSavePath { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 阿里云存储
|
||||
|
||||
@@ -110,13 +110,15 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
switch (storeType)
|
||||
{
|
||||
case StoreType.LOCAL:
|
||||
string savePath = AppSettings.App(new string[] { "Upload", "localSavePath" });
|
||||
if (savePath.IsEmpty())
|
||||
string savePath = Path.Combine(WebHostEnvironment.WebRootPath);
|
||||
if (fileDir.IsEmpty())
|
||||
{
|
||||
savePath = Path.Combine(WebHostEnvironment.WebRootPath, "uploads");
|
||||
fileDir = AppSettings.App(new string[] { "Upload", "localSavePath" });
|
||||
}
|
||||
file = await SysFileService.SaveFileToLocal(savePath, fileName, fileDir, HttpContext.GetName(), formFile);
|
||||
break;
|
||||
case StoreType.REMOTE:
|
||||
break;
|
||||
case StoreType.ALIYUN:
|
||||
if ((fileSize / 1024) > MaxContentLength)
|
||||
{
|
||||
|
||||
@@ -104,12 +104,10 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
throw new CustomException("请求实体不能为空");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var modal = parm.Adapt<ArticleCategory>().ToUpdate(HttpContext);
|
||||
|
||||
var response = _ArticleCategoryService.Update(w => w.CategoryId == modal.CategoryId, it => new ArticleCategory()
|
||||
{
|
||||
//Update 字段映射
|
||||
Name = modal.Name,
|
||||
ParentId = modal.ParentId,
|
||||
});
|
||||
|
||||
@@ -40,10 +40,8 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
[ActionPermissionFilter(Permission = "system:article:list")]
|
||||
public IActionResult Query([FromQuery] ArticleQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<Article>();
|
||||
|
||||
//搜索条件
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.Title), m => m.Title.Contains(parm.Title));
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.Status), m => m.Status == parm.Status);
|
||||
|
||||
@@ -59,10 +57,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
[HttpGet("newList")]
|
||||
public IActionResult QueryNew()
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<Article>();
|
||||
|
||||
//搜索条件
|
||||
predicate = predicate.And(m => m.Status == "1");
|
||||
|
||||
var response = _ArticleService.Queryable()
|
||||
@@ -99,7 +94,6 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
throw new CustomException("请求参数错误");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var addModel = parm.Adapt<Article>().ToCreate(context: HttpContext);
|
||||
addModel.AuthorName = HttpContext.GetName();
|
||||
|
||||
|
||||
@@ -6,14 +6,13 @@ using Infrastructure.Model;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Common;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Models;
|
||||
using ZR.Service.System.ISystemService;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
@@ -45,8 +44,10 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
if (parm.ShowMode == 2)
|
||||
{
|
||||
PagedInfo<dynamic> pagedInfo = new();
|
||||
pagedInfo.Result = _CommonLangService.GetListToPivot(parm);
|
||||
PagedInfo<dynamic> pagedInfo = new()
|
||||
{
|
||||
Result = _CommonLangService.GetListToPivot(parm)
|
||||
};
|
||||
|
||||
return SUCCESS(pagedInfo);
|
||||
}
|
||||
@@ -60,34 +61,11 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet("list/{lang}")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult QueryCommonLangs()
|
||||
public IActionResult QueryCommonLangs(string lang)
|
||||
{
|
||||
var msgList = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "zh-cn" });
|
||||
var msgListEn = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "en" });
|
||||
var msgListTw = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "zh-tw" });
|
||||
Dictionary<string, object> dic = new();
|
||||
Dictionary<string, object> dicEn = new();
|
||||
Dictionary<string, object> dicTw = new();
|
||||
SetLang(msgList, dic);
|
||||
SetLang(msgListEn, dicEn);
|
||||
SetLang(msgListTw, dicTw);
|
||||
return SUCCESS(new
|
||||
{
|
||||
en = dicEn,
|
||||
cn = dic,
|
||||
tw = dicTw
|
||||
});
|
||||
}
|
||||
var msgList = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = lang });
|
||||
|
||||
private static void SetLang(List<CommonLang> msgList, Dictionary<string, object> dic)
|
||||
{
|
||||
foreach (var item in msgList)
|
||||
{
|
||||
if (!dic.ContainsKey(item.LangKey))
|
||||
{
|
||||
dic.Add(item.LangKey, item.LangName);
|
||||
}
|
||||
}
|
||||
return SUCCESS(_CommonLangService.SetLang(msgList));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -137,17 +115,9 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
throw new CustomException("请求实体不能为空");
|
||||
}
|
||||
|
||||
List<CommonLang> langs = new();
|
||||
foreach (var item in parm.LangList)
|
||||
{
|
||||
langs.Add(new CommonLang() { Addtime = DateTime.Now, LangKey = parm.LangKey, LangCode = item.LangCode, LangName = item.LangName });
|
||||
}
|
||||
var storage = _CommonLangService.Storageable(langs).WhereColumns(it => new { it.LangKey, it.LangCode }).ToStorage();
|
||||
_CommonLangService.StorageCommonLang(parm);
|
||||
|
||||
long r = storage.AsInsertable.ExecuteReturnSnowflakeId();//执行插入
|
||||
storage.AsUpdateable.UpdateColumns(it => new { it.LangName }).ExecuteCommand();//执行修改
|
||||
|
||||
return ToResponse(r);
|
||||
return ToResponse(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -41,10 +41,8 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
[ActionPermissionFilter(Permission = "system:config:list")]
|
||||
public IActionResult QuerySysConfig([FromQuery] SysConfigQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<SysConfig>();
|
||||
|
||||
//TODO 搜索条件
|
||||
predicate = predicate.AndIF(!parm.ConfigType.IsEmpty(),m => m.ConfigType == parm.ConfigType);
|
||||
predicate = predicate.AndIF(!parm.ConfigName.IsEmpty(),m => m.ConfigName.Contains(parm.ConfigType));
|
||||
predicate = predicate.AndIF(!parm.ConfigKey.IsEmpty(),m => m.ConfigKey.Contains(parm.ConfigKey));
|
||||
@@ -79,7 +77,6 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
[AllowAnonymous]
|
||||
public IActionResult GetConfigKey(string configKey)
|
||||
{
|
||||
//TODO 增加缓存
|
||||
var response = _SysConfigService.Queryable().First(f=> f.ConfigKey == configKey);
|
||||
|
||||
return SUCCESS(response?.ConfigValue);
|
||||
@@ -98,7 +95,6 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
throw new CustomException("请求参数错误");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var model = parm.Adapt<SysConfig>().ToCreate(HttpContext);
|
||||
|
||||
return SUCCESS(_SysConfigService.Insert(model, it => new
|
||||
@@ -126,12 +122,10 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
throw new CustomException("请求实体不能为空");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var model = parm.Adapt<SysConfig>().ToUpdate(HttpContext);
|
||||
|
||||
var response = _SysConfigService.Update(w => w.ConfigId == model.ConfigId, it => new SysConfig()
|
||||
{
|
||||
//Update 字段映射
|
||||
ConfigName = model.ConfigName,
|
||||
ConfigKey = model.ConfigKey,
|
||||
ConfigValue = model.ConfigValue,
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model;
|
||||
using ZR.Model.System;
|
||||
@@ -54,6 +55,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
return SUCCESS(SysDictDataService.SelectDictDataByType(dictType));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据字典类型查询字典数据信息
|
||||
/// </summary>
|
||||
@@ -101,7 +103,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[HttpPost()]
|
||||
public IActionResult Add([FromBody] SysDictData dict)
|
||||
{
|
||||
dict.Create_by = User.Identity.Name;
|
||||
dict.Create_by = HttpContext.GetName();
|
||||
dict.Create_time = DateTime.Now;
|
||||
return SUCCESS(SysDictDataService.InsertDictData(dict));
|
||||
}
|
||||
@@ -116,7 +118,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[HttpPut()]
|
||||
public IActionResult Edit([FromBody] SysDictData dict)
|
||||
{
|
||||
dict.Update_by = User.Identity.Name;
|
||||
dict.Update_by = HttpContext.GetName();
|
||||
return SUCCESS(SysDictDataService.UpdateDictData(dict));
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
return ToResponse(ApiResult.Error($"新增字典'{dict.DictName}'失败,字典类型已存在"));
|
||||
}
|
||||
//设置添加人
|
||||
dict.Create_by = HttpContext.User.Identity.Name;
|
||||
dict.Create_by = HttpContext.GetName();
|
||||
dict.Create_time = DateTime.Now;
|
||||
return SUCCESS(SysDictService.InsertDictType(dict));
|
||||
}
|
||||
|
||||
@@ -123,25 +123,31 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
/// <summary>
|
||||
/// 添加菜单
|
||||
/// </summary>
|
||||
/// <param name="MenuDto"></param>
|
||||
/// <param name="menuDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("add")]
|
||||
[Log(Title = "菜单管理", BusinessType = BusinessType.INSERT)]
|
||||
[ActionPermissionFilter(Permission = "system:menu:add")]
|
||||
public IActionResult MenuAdd([FromBody] SysMenu MenuDto)
|
||||
public IActionResult MenuAdd([FromBody] MenuDto menuDto)
|
||||
{
|
||||
if (MenuDto == null) { return ToResponse(ApiResult.Error(101, "请求参数错误")); }
|
||||
if (UserConstants.NOT_UNIQUE.Equals(sysMenuService.CheckMenuNameUnique(MenuDto)))
|
||||
var config = new TypeAdapterConfig();
|
||||
//映射规则
|
||||
config.ForType<SysMenu, MenuDto>()
|
||||
.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase);
|
||||
var menu = menuDto.Adapt<SysMenu>(config).ToCreate(HttpContext);
|
||||
|
||||
if (menu == null) { return ToResponse(ApiResult.Error(101, "请求参数错误")); }
|
||||
if (UserConstants.NOT_UNIQUE.Equals(sysMenuService.CheckMenuNameUnique(menu)))
|
||||
{
|
||||
return ToResponse(ApiResult.Error($"新增菜单'{MenuDto.MenuName}'失败,菜单名称已存在"));
|
||||
return ToResponse(ApiResult.Error($"新增菜单'{menu.MenuName}'失败,菜单名称已存在"));
|
||||
}
|
||||
if (UserConstants.YES_FRAME.Equals(MenuDto.isFrame) && !MenuDto.path.StartsWith("http"))
|
||||
if (UserConstants.YES_FRAME.Equals(menu.isFrame) && !menu.path.StartsWith("http"))
|
||||
{
|
||||
return ToResponse(ApiResult.Error($"新增菜单'{MenuDto.MenuName}'失败,地址必须以http(s)://开头"));
|
||||
return ToResponse(ApiResult.Error($"新增菜单'{menu.MenuName}'失败,地址必须以http(s)://开头"));
|
||||
}
|
||||
|
||||
MenuDto.Create_by = User.Identity.Name;
|
||||
int result = sysMenuService.AddMenu(MenuDto);
|
||||
menu.Create_by = HttpContext.GetName();
|
||||
int result = sysMenuService.AddMenu(menu);
|
||||
|
||||
return ToResponse(result);
|
||||
}
|
||||
|
||||
@@ -44,10 +44,8 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[HttpGet("queryNotice")]
|
||||
public IActionResult QueryNotice([FromQuery] SysNoticeQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<SysNotice>();
|
||||
|
||||
//搜索条件查询语法参考Sqlsugar
|
||||
predicate = predicate.And(m => m.Status == "0");
|
||||
var response = _SysNoticeService.GetPages(predicate.ToExpression(), parm);
|
||||
return SUCCESS(response);
|
||||
@@ -61,10 +59,8 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[ActionPermissionFilter(Permission = "system:notice:list")]
|
||||
public IActionResult QuerySysNotice([FromQuery] SysNoticeQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<SysNotice>();
|
||||
|
||||
//搜索条件查询语法参考Sqlsugar
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.NoticeTitle), m => m.NoticeTitle.Contains(parm.NoticeTitle));
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.NoticeType), m => m.NoticeType == parm.NoticeType);
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.CreateBy), m => m.Create_by.Contains(parm.CreateBy) || m.Update_by.Contains(parm.CreateBy));
|
||||
@@ -102,7 +98,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var modal = parm.Adapt<SysNotice>().ToCreate(HttpContext);
|
||||
modal.Create_by = User.Identity.Name;
|
||||
modal.Create_by = HttpContext.GetName();
|
||||
modal.Create_time = DateTime.Now;
|
||||
|
||||
int result = _SysNoticeService.Insert(modal, it => new
|
||||
@@ -143,7 +139,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
NoticeContent = model.NoticeContent,
|
||||
Status = model.Status,
|
||||
Remark = model.Remark,
|
||||
Update_by = User.Identity.Name,
|
||||
Update_by = HttpContext.GetName(),
|
||||
Update_time = DateTime.Now
|
||||
});
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using Infrastructure.Enums;
|
||||
using Infrastructure;
|
||||
using ZR.Service.System.IService;
|
||||
using ZR.Common;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
@@ -34,7 +35,6 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[ActionPermissionFilter(Permission = "system:post:list")]
|
||||
public IActionResult List([FromQuery] SysPost post, [FromQuery] PagerInfo pagerInfo)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<SysPost>();
|
||||
predicate = predicate.AndIF(post.Status.IfNotEmpty(), it => it.Status == post.Status);
|
||||
var list = PostService.GetPages(predicate.ToExpression(), pagerInfo, s => new { s.PostSort });
|
||||
@@ -73,7 +73,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
throw new CustomException($"修改岗位{post.PostName}失败,岗位编码已存在");
|
||||
}
|
||||
|
||||
post.Create_by = User.Identity.Name;
|
||||
post.Create_by = HttpContext.GetName();
|
||||
return ToResponse(ToJson(PostService.Add(post)));
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
throw new CustomException($"修改岗位{post.PostName}失败,岗位编码已存在");
|
||||
}
|
||||
post.Update_by = User.Identity.Name;
|
||||
post.Update_by = HttpContext.GetName();
|
||||
return ToResponse(PostService.Update(post));
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
throw new CustomException(ResultCode.PARAM_ERROR, "请求参数错误");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var user = userDto.Adapt<SysUser>().ToUpdate(HttpContext);
|
||||
|
||||
int result = UserService.ChangeUser(user);
|
||||
@@ -130,7 +129,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
LoginUser loginUser = Framework.JwtUtil.GetLoginUser(HttpContext);
|
||||
if (formFile == null) throw new CustomException("请选择文件");
|
||||
|
||||
SysFile file = await FileService.SaveFileToLocal(hostEnvironment.WebRootPath, "", "", HttpContext.GetName(), formFile);
|
||||
SysFile file = await FileService.SaveFileToLocal(hostEnvironment.WebRootPath, "", "avatar", HttpContext.GetName(), formFile);
|
||||
|
||||
UserService.UpdatePhoto(new SysUser() { Avatar = file.AccessUrl, UserId = loginUser.UserId });
|
||||
return SUCCESS(new { imgUrl = file.AccessUrl });
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
return ToResponse(ApiResult.Error((int)ResultCode.CUSTOM_ERROR, $"新增角色'{sysRoleDto.RoleName}'失败,角色权限已存在"));
|
||||
}
|
||||
|
||||
sysRoleDto.Create_by = User.Identity.Name;
|
||||
sysRoleDto.Create_by = HttpContext.GetName();
|
||||
long roleId = sysRoleService.InsertRole(sysRoleDto);
|
||||
|
||||
return ToResponse(ToJson(roleId));
|
||||
@@ -101,7 +101,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
return ToResponse(ApiResult.Error($"编辑角色'{sysRoleDto.RoleName}'失败,角色权限已存在"));
|
||||
}
|
||||
}
|
||||
sysRoleDto.Update_by = User.Identity.Name;
|
||||
sysRoleDto.Update_by = HttpContext.GetName();
|
||||
int upResult = sysRoleService.UpdateRole(sysRoleDto);
|
||||
if (upResult > 0)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
[HttpGet("list")]
|
||||
public IActionResult GetList([FromQuery] PagerInfo pager, [FromQuery] TasksLogQueryDto queryDto)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
queryDto.BeginTime = DateTimeHelper.GetBeginTime(queryDto.BeginTime, -7);
|
||||
queryDto.EndTime = DateTimeHelper.GetBeginTime(queryDto.EndTime, 7);
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
|
||||
/// <summary>
|
||||
/// 查询登录日志
|
||||
/// /monitor/logininfor/list
|
||||
/// </summary>
|
||||
/// <param name="sysLogininfoDto"></param>
|
||||
/// <param name="pagerInfo"></param>
|
||||
@@ -44,7 +43,6 @@ namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
|
||||
/// <summary>
|
||||
/// 清空登录日志
|
||||
/// /monitor/logininfor/clean
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Log(Title = "清空登录日志", BusinessType= BusinessType.CLEAN)]
|
||||
@@ -61,7 +59,6 @@ namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// /monitor/logininfor/1
|
||||
/// </summary>
|
||||
/// <param name="infoIds"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Constant;
|
||||
using Infrastructure.Model;
|
||||
using IPTools.Core;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Framework;
|
||||
@@ -19,8 +20,8 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
//创建用户集合,用于存储所有链接的用户数据
|
||||
private static readonly List<OnlineUsers> clientUsers = new();
|
||||
private readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
private ISysNoticeService SysNoticeService;
|
||||
|
||||
private readonly ISysNoticeService SysNoticeService;
|
||||
|
||||
public MessageHub(ISysNoticeService noticeService)
|
||||
{
|
||||
SysNoticeService = noticeService;
|
||||
@@ -43,17 +44,23 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
{
|
||||
var name = Context.User.Identity.Name;
|
||||
var ip = HttpContextExtension.GetClientUserIp(App.HttpContext);
|
||||
var ip_info = IpTool.Search(ip);
|
||||
|
||||
LoginUser loginUser = JwtUtil.GetLoginUser(App.HttpContext);
|
||||
var user = clientUsers.Any(u => u.ConnnectionId == Context.ConnectionId);
|
||||
//判断用户是否存在,否则添加集合
|
||||
if (!user && Context.User.Identity.IsAuthenticated)
|
||||
{
|
||||
clientUsers.Add(new OnlineUsers(Context.ConnectionId, name, loginUser?.UserId, ip));
|
||||
OnlineUsers users = new(Context.ConnectionId, name, loginUser?.UserId, ip)
|
||||
{
|
||||
Location = ip_info.City
|
||||
};
|
||||
clientUsers.Add(users);
|
||||
Console.WriteLine($"{DateTime.Now}:{name},{Context.ConnectionId}连接服务端success,当前已连接{clientUsers.Count}个");
|
||||
//Clients.All.SendAsync("welcome", $"欢迎您:{name},当前时间:{DateTime.Now}");
|
||||
Clients.All.SendAsync(HubsConstant.MoreNotice, SendNotice());
|
||||
}
|
||||
|
||||
|
||||
Clients.All.SendAsync(HubsConstant.OnlineNum, clientUsers.Count);
|
||||
Clients.All.SendAsync(HubsConstant.OnlineUser, clientUsers);
|
||||
return base.OnConnectedAsync();
|
||||
@@ -69,14 +76,34 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
//判断用户是否存在,否则添加集合
|
||||
if (user != null)
|
||||
{
|
||||
Console.WriteLine($"用户{user?.Name}离开了,当前已连接{clientUsers.Count}个");
|
||||
clientUsers.Remove(user);
|
||||
Clients.All.SendAsync(HubsConstant.OnlineNum, clientUsers.Count);
|
||||
Clients.All.SendAsync(HubsConstant.OnlineUser, clientUsers);
|
||||
Console.WriteLine($"用户{user?.Name}离开了,当前已连接{clientUsers.Count}个");
|
||||
}
|
||||
return base.OnDisconnectedAsync(exception);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 注册信息
|
||||
/// </summary>
|
||||
/// <param name="connectId"></param>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
[HubMethodName("SendMessage")]
|
||||
public async Task SendMessage(string connectId, string userName, string message)
|
||||
{
|
||||
Console.WriteLine($"{connectId},message={message}");
|
||||
bool isDemoMode = AppSettings.GetAppConfig("DemoMode", true);
|
||||
if (isDemoMode)
|
||||
{
|
||||
await Clients.Caller.SendAsync("receiveChat", new { userName, message = "当前环境为演示环境,消息不会发送给对方" });
|
||||
return;
|
||||
}
|
||||
await Clients.Client(connectId).SendAsync("receiveChat", new { userName, message });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace ZR.Model
|
||||
public string Name { get; set; }
|
||||
public DateTime LoginTime { get; set; }
|
||||
public string UserIP { get; set; }
|
||||
public string Location { get; set; }
|
||||
|
||||
public OnlineUsers(string clientid, string name, long? userid, string userip)
|
||||
{
|
||||
|
||||
@@ -106,16 +106,18 @@ namespace ZR.Admin.WebApi.Middleware
|
||||
sysOperLog.jsonResult = logAttribute.IsSaveResponseData ? sysOperLog.jsonResult : "";
|
||||
}
|
||||
}
|
||||
LogEventInfo ei = new(logLevel, "GlobalExceptionMiddleware", error);
|
||||
|
||||
ei.Exception = ex;
|
||||
ei.Message = error;
|
||||
LogEventInfo ei = new(logLevel, "GlobalExceptionMiddleware", error)
|
||||
{
|
||||
Exception = ex,
|
||||
Message = error
|
||||
};
|
||||
ei.Properties["status"] = 1;//走正常返回都是通过走GlobalExceptionFilter不通过
|
||||
ei.Properties["jsonResult"] = responseResult;
|
||||
ei.Properties["requestParam"] = sysOperLog.operParam;
|
||||
ei.Properties["user"] = HttpContextExtension.GetName(context);
|
||||
|
||||
Logger.Log(ei);
|
||||
context.Response.ContentType = "text/json;charset=utf-8";
|
||||
await context.Response.WriteAsync(responseResult, System.Text.Encoding.UTF8);
|
||||
|
||||
SysOperLogService.InsertOperlog(sysOperLog);
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" />
|
||||
<PackageReference Include="EPPlus" Version="5.8.6" />
|
||||
<PackageReference Include="EPPlus" Version="6.0.4" />
|
||||
<PackageReference Include="Hei.Captcha" Version="0.3.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
<PackageReference Include="CSRedisCore" Version="3.6.9" />
|
||||
<PackageReference Include="CSRedisCore" Version="3.8.2" />
|
||||
<PackageReference Include="Mapster" Version="7.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" NoWarn="NU1605" />
|
||||
<PackageReference Include="NETCore.Encrypt" Version="2.1.0" />
|
||||
@@ -25,8 +25,8 @@
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
|
||||
<PackageReference Include="Snowflake.Core" Version="2.0.0" />
|
||||
<PackageReference Include="SqlSugar.IOC" Version="1.8.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.3" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
},
|
||||
"DemoMode": false, //是否演示模式
|
||||
"Upload": {
|
||||
"UploadUrl": "http://localhost:8888",
|
||||
"localSavePath": "" //本地上传文件存储目录/home/website/uploads
|
||||
"UploadUrl": "http://localhost:8888", //本地存储资源访问路径
|
||||
"localSavePath": "uploads" //本地上传默认文件存储目录 wwwroot/uploads
|
||||
},
|
||||
//阿里云存储配置
|
||||
"ALIYUN_OSS": {
|
||||
@@ -47,7 +47,8 @@
|
||||
"Password": "123456",
|
||||
//协议
|
||||
"Smtp": "smtp.qq.com",
|
||||
"Port": 587
|
||||
"Port": 587,
|
||||
"Signature": "系统邮件,请勿回复!"
|
||||
},
|
||||
//redis服务配置
|
||||
"RedisServer": {
|
||||
@@ -56,20 +57,12 @@
|
||||
},
|
||||
//接口请求限制
|
||||
"IpRateLimiting": {
|
||||
//例如设置了5次每分钟访问限流。当False时:项目中每个接口都加入计数,不管你访问哪个接口,只要在一分钟内累计够5次,将禁止访问。
|
||||
//True:当一分钟请求了5次GetData接口,则该接口将在时间段内禁止访问,但是还可以访问PostData()5次,总得来说是每个接口都有5次在这一分钟,互不干扰。
|
||||
"EnableEndpointRateLimiting": true,
|
||||
//false,拒绝的API调用不会添加到调用次数计数器上;如 客户端每秒发出3个请求并且您设置了每秒一个调用的限制,则每分钟或每天计数器等其他限制将仅记录第一个调用,即成功的API调用。如果您希望被拒绝的API调用计入其他时间的显示(分钟,小时等)
|
||||
//,则必须设置StackBlockedRequests为true。
|
||||
"StackBlockedRequests": false,
|
||||
"RealIpHeader": "X-Real-IP",
|
||||
//取白名单的客户端ID。如果此标头中存在客户端ID并且与ClientWhitelist中指定的值匹配,则不应用速率限制。
|
||||
"ClientIdHeader": "X-ClientId",
|
||||
"HttpStatusCode": 429,
|
||||
//端点白名单
|
||||
"EndpointWhitelist": [ "post:/system/dict/data/types", "*:/msghub/negotiate", "*:/LogOut" ],
|
||||
//客户端白名单
|
||||
//"ClientWhitelist": [ "dev-id-1", "dev-id-2" ],
|
||||
"QuotaExceededResponse": {
|
||||
"Content": "{{\"code\":429,\"msg\":\"访问过于频繁,请稍后重试\"}}",
|
||||
"ContentType": "application/json",
|
||||
@@ -95,27 +88,6 @@
|
||||
"Period": "3s",
|
||||
"Limit": 1
|
||||
}
|
||||
//{
|
||||
// "Endpoint": "*",
|
||||
// //时间段,格式:{数字}{单位};可使用单位:s, m, h, d
|
||||
// "Period": "1s",
|
||||
// "Limit": 2
|
||||
//}
|
||||
//{
|
||||
// "Endpoint": "*",
|
||||
// "Period": "15m",
|
||||
// "Limit": 100
|
||||
//},
|
||||
//{
|
||||
// "Endpoint": "*",
|
||||
// "Period": "12h",
|
||||
// "Limit": 1000
|
||||
//},
|
||||
//{
|
||||
// "Endpoint": "*",
|
||||
// "Period": "7d",
|
||||
// "Limit": 10000
|
||||
//}
|
||||
],
|
||||
"IpRateLimitPolicies": {
|
||||
//ip规则
|
||||
|
||||
@@ -90,7 +90,6 @@ $if(replaceDto.ShowBtnAdd)
|
||||
{
|
||||
throw new CustomException("请求参数错误");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var modal = parm.Adapt<${replaceDto.ModelTypeName}>().ToCreate(HttpContext);
|
||||
|
||||
var response = _${replaceDto.ModelTypeName}Service.Add${replaceDto.ModelTypeName}(modal);
|
||||
@@ -113,18 +112,9 @@ $if(replaceDto.ShowBtnEdit)
|
||||
{
|
||||
throw new CustomException("请求实体不能为空");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var modal = parm.Adapt<${replaceDto.ModelTypeName}>().ToUpdate(HttpContext);
|
||||
|
||||
var response = _${replaceDto.ModelTypeName}Service.Update(w => w.${replaceDto.PKName} == modal.${replaceDto.PKName}, it => new ${replaceDto.ModelTypeName}()
|
||||
{
|
||||
//Update 字段映射
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.IsEdit))
|
||||
$item.CsharpField = modal.$item.CsharpField,
|
||||
$end
|
||||
${end}
|
||||
});
|
||||
var response = _${replaceDto.ModelTypeName}Service.Update${replaceDto.ModelTypeName}(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
@@ -20,5 +20,7 @@ $if(genTable.TplCategory == "tree")
|
||||
List<${replaceDto.ModelTypeName}> GetTreeList(${replaceDto.ModelTypeName}QueryDto parm);
|
||||
$end
|
||||
int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm);
|
||||
|
||||
int Update${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,12 +38,12 @@ $end
|
||||
|
||||
$if(genTable.TplCategory == "subNav" && genTable.SubTable != null)
|
||||
[Navigate(NavigateType.Dynamic, null)] //自定义关系映射
|
||||
public ${genTable.SubTable.ClassName} Sub { get; set; }
|
||||
public ${genTable.SubTable.ClassName} ${genTable.SubTable.ClassName} { get; set; }
|
||||
$end
|
||||
|
||||
$if(genTable.TplCategory == "subNavMore" && genTable.SubTable != null)
|
||||
[Navigate(NavigateType.Dynamic, null)] //自定义关系映射
|
||||
public List<${genTable.SubTable.ClassName}> Sub { get; set; }
|
||||
public List<${genTable.SubTable.ClassName}> ${genTable.SubTable.ClassName} { get; set; }
|
||||
$end
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ $end
|
||||
var response = _${replaceDto.ModelTypeName}Repository
|
||||
.Queryable()
|
||||
$if(null != genTable.SubTableName && "" != genTable.SubTableName)
|
||||
.Includes(it => it.Sub.MappingField(z => z.${genTable.SubTableFkName}, () => it.${replaceDto.PKName}))
|
||||
.Includes(it => it.${genTable.SubTable.ClassName}.MappingField(z => z.${genTable.SubTableFkName}, () => it.${replaceDto.PKName}))
|
||||
$end
|
||||
$if(genTable.Options.SortField != "" && genTable.Options.SortField != null)
|
||||
.OrderBy("${genTable.Options.SortField} ${genTable.Options.SortType}")
|
||||
@@ -106,6 +106,24 @@ ${foreach(item in genTable.Columns)}
|
||||
$if((item.IsInsert))
|
||||
it.$item.CsharpField,
|
||||
$end
|
||||
${end}
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改${genTable.FunctionName}
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public int Update${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm)
|
||||
{
|
||||
var response = _${replaceDto.ModelTypeName}Repository.Update(w => w.${replaceDto.PKName} == parm.${replaceDto.PKName}, it => new ${replaceDto.ModelTypeName}()
|
||||
{
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.IsEdit))
|
||||
$item.CsharpField = parm.$item.CsharpField,
|
||||
$end
|
||||
${end}
|
||||
});
|
||||
return response;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<!-- :model属性用于表单验证使用 比如下面的el-form-item 的 prop属性用于对表单值进行验证操作 -->
|
||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
|
||||
$foreach(column in genTable.Columns)
|
||||
$set(labelName = "")
|
||||
@@ -41,13 +40,13 @@ $if(column.HtmlType == "datetime")
|
||||
$elseif(column.HtmlType == "select" || column.HtmlType == "radio")
|
||||
<el-form-item label="${labelName}" prop="${columnName}">
|
||||
<el-select v-model="queryParams.${columnName}" placeholder="请选择${labelName}">
|
||||
<el-option v-for="item in $if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||
<el-option v-for="item in $if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
$elseif(column.HtmlType == "radio")
|
||||
<el-form-item label="${labelName}" prop="${columnName}">
|
||||
<el-radio-group v-model="queryParams.${columnName}">
|
||||
<el-radio v-for="item in $if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictValue">{{item.dictLabel}}</el-radio>
|
||||
<el-radio v-for="item in $if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictValue">{{item.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
$else
|
||||
@@ -136,9 +135,9 @@ $elseif(column.HtmlType == "checkbox" || column.HtmlType == "select" || column.H
|
||||
<el-table-column prop="${columnName}" label="${labelName}" align="center"${column.sortStr}>
|
||||
<template #default="scope">
|
||||
$if(column.HtmlType == "checkbox")
|
||||
<dict-tag :options="$if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :value="scope.row.${columnName} ? scope.row.${columnName}.split(',') : []" />
|
||||
<dict-tag :options="$if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :value="scope.row.${columnName} ? scope.row.${columnName}.split(',') : []" />
|
||||
$else
|
||||
<dict-tag :options="$if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :value="scope.row.${columnName}" />
|
||||
<dict-tag :options="$if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :value="scope.row.${columnName}" />
|
||||
$end
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -200,7 +199,7 @@ $if(column.HtmlType == "inputNumber" || column.HtmlType == "customInput")
|
||||
$elseif(column.HtmlType == "datetime")
|
||||
<el-col :lg="${options.ColNum}">
|
||||
<el-form-item label="${labelName}" prop="${columnName}">
|
||||
<el-date-picker v-model="form.${columnName}" type="datetime" placeholder="选择日期时间"${column.DisabledStr}></el-date-picker>
|
||||
<el-date-picker v-model="form.${columnName}" type="datetime" :teleported="false" placeholder="选择日期时间"${column.DisabledStr}></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
$elseif(column.HtmlType == "imageUpload")
|
||||
@@ -219,7 +218,7 @@ $elseif(column.HtmlType == "radio")
|
||||
<el-col :lg="${options.ColNum}">
|
||||
<el-form-item label="${labelName}" prop="${columnName}">
|
||||
<el-radio-group v-model="form.${columnName}"${column.DisabledStr}>
|
||||
<el-radio v-for="item in $if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="${value}">{{item.dictLabel}}</el-radio>
|
||||
<el-radio v-for="item in $if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="${value}">{{item.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -239,7 +238,7 @@ $elseif(column.HtmlType == "select")
|
||||
<el-col :lg="${options.ColNum}">
|
||||
<el-form-item label="${labelName}" prop="${columnName}">
|
||||
<el-select v-model="form.${columnName}" placeholder="请选择${labelName}"${column.DisabledStr}>
|
||||
<el-option v-for="item in $if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictLabel" :value="${value}"></el-option>
|
||||
<el-option v-for="item in $if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictLabel" :value="${value}"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -247,7 +246,7 @@ $elseif(column.HtmlType == "checkbox")
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="${labelName}" prop="${columnName}">
|
||||
<el-checkbox-group v-model="form.${columnName}Checked"${column.DisabledStr}>
|
||||
<el-checkbox v-for="item in $if(column.DictType != "") ${column.DictType} $else ${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictValue">{{item.dictLabel}}</el-checkbox>
|
||||
<el-checkbox v-for="item in $if(column.DictType != "") options.${column.DictType} $else options.${column.CsharpFieldFl}Options$end" :key="item.dictValue" :label="item.dictValue">{{item.dictLabel}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -273,8 +272,7 @@ $end
|
||||
|
||||
|
||||
<script setup name="${genTable.BusinessName.ToLower()}">
|
||||
import { list${genTable.BusinessName}, add${genTable.BusinessName}, del${genTable.BusinessName}, update${genTable.BusinessName}, get${genTable.BusinessName},
|
||||
$if(replaceDto.ShowBtnExport) export${genTable.BusinessName}, $end $if(showCustomInput) changeSort $end } from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||
import { list${genTable.BusinessName}, add${genTable.BusinessName}, del${genTable.BusinessName}, update${genTable.BusinessName}, get${genTable.BusinessName},$if(replaceDto.ShowBtnExport) export${genTable.BusinessName}, $end $if(showCustomInput) changeSort $end } from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
// 选中${replaceDto.FistLowerPk}数组数组
|
||||
@@ -283,11 +281,8 @@ const ids = ref([])
|
||||
const single = ref(true)
|
||||
// 非多个禁用
|
||||
const multiple = ref(true)
|
||||
// 遮罩层
|
||||
const loading = ref(false)
|
||||
// 显示搜索条件
|
||||
const showSearch = ref(true)
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -299,13 +294,11 @@ $if(item.IsQuery == true)
|
||||
$end
|
||||
$end
|
||||
})
|
||||
// 弹出层标题
|
||||
|
||||
const title = ref("")
|
||||
// 操作类型 1、add 2、edit
|
||||
// 操作类型 1、add 2、edit 3、view
|
||||
const opertype = ref(0)
|
||||
// 是否显示弹出层
|
||||
const open = ref(false)
|
||||
// 表单参数
|
||||
const state = reactive({
|
||||
form: {},
|
||||
rules: {
|
||||
@@ -314,28 +307,31 @@ $if(column.IsRequired && column.IsIncrement == false)
|
||||
${column.CsharpFieldFl}: [{ required: true, message: "${column.ColumnComment}不能为空", trigger: $if(column.htmlType == "select")"change"$else"blur"$end
|
||||
$if(column.CsharpType == "int" || column.CsharpType == "long"), type: "number"$end }],
|
||||
$end
|
||||
$end
|
||||
},
|
||||
options: {
|
||||
$foreach(column in genTable.Columns)
|
||||
$if((column.HtmlType == "radio" || column.HtmlType == "select" || column.HtmlType == "checkbox"))
|
||||
// $if(column.ColumnComment != "") ${column.ColumnComment} $else ${column.CsharpFieldFl}$end选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
$if(column.DictType != "")${column.DictType}$else${column.CsharpFieldFl}Options$end: [],
|
||||
$end
|
||||
$end
|
||||
}
|
||||
})
|
||||
|
||||
const { form, rules } = toRefs(state)
|
||||
// 总记录数
|
||||
const { form, rules, options } = toRefs(state)
|
||||
const total = ref(0)
|
||||
const dataList = ref([])
|
||||
const queryRef = ref()
|
||||
const formRef = ref()
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox"))
|
||||
// ${item.ColumnComment}选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
const $if(item.DictType != "")${item.DictType}$else${item.CsharpFieldFl}Options$end = ref([])
|
||||
$elseif(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
$if(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
// ${item.ColumnComment}时间范围
|
||||
const dateRange${item.CsharpField} = ref([])
|
||||
|
||||
$elseif(item.HtmlType == "customInput")
|
||||
// ******************自定义编辑 start **********************
|
||||
const editIndex = ref(-1)
|
||||
// 动态ref设置值
|
||||
const columnRefs = ref([])
|
||||
const setColumnsRef = (el) => {
|
||||
if (el) {
|
||||
@@ -381,7 +377,7 @@ $end
|
||||
$if(index > 0)
|
||||
proxy.getDicts(dictParams).then((response) => {
|
||||
response.data.forEach((element) => {
|
||||
proxy[element.dictType] = element.list
|
||||
state.options[element.dictType] = element.list
|
||||
})
|
||||
})
|
||||
$end
|
||||
|
||||
@@ -48,16 +48,17 @@ namespace ZR.CodeGenerator
|
||||
|
||||
string PKName = "Id";
|
||||
string PKType = "int";
|
||||
ReplaceDto replaceDto = new();
|
||||
replaceDto.ModelTypeName = dto.GenTable.ClassName;//表名对应C# 实体类名
|
||||
replaceDto.PermissionPrefix = dto.GenTable?.Options?.PermissionPrefix;
|
||||
replaceDto.Author = dto.GenTable.FunctionAuthor;
|
||||
replaceDto.ShowBtnAdd = dto.GenTable.Options.CheckedBtn.Any(f => f == 1);
|
||||
replaceDto.ShowBtnEdit = dto.GenTable.Options.CheckedBtn.Any(f => f == 2);
|
||||
replaceDto.ShowBtnDelete = dto.GenTable.Options.CheckedBtn.Any(f => f == 3);
|
||||
replaceDto.ShowBtnExport = dto.GenTable.Options.CheckedBtn.Any(f => f == 4);
|
||||
replaceDto.ShowBtnView = dto.GenTable.Options.CheckedBtn.Any(f => f == 5);
|
||||
|
||||
ReplaceDto replaceDto = new()
|
||||
{
|
||||
ModelTypeName = dto.GenTable.ClassName,//表名对应C# 实体类名
|
||||
PermissionPrefix = dto.GenTable?.Options?.PermissionPrefix,
|
||||
Author = dto.GenTable.FunctionAuthor,
|
||||
ShowBtnAdd = dto.GenTable.Options.CheckedBtn.Any(f => f == 1),
|
||||
ShowBtnEdit = dto.GenTable.Options.CheckedBtn.Any(f => f == 2),
|
||||
ShowBtnDelete = dto.GenTable.Options.CheckedBtn.Any(f => f == 3),
|
||||
ShowBtnExport = dto.GenTable.Options.CheckedBtn.Any(f => f == 4),
|
||||
ShowBtnView = dto.GenTable.Options.CheckedBtn.Any(f => f == 5)
|
||||
};
|
||||
|
||||
//循环表字段信息
|
||||
foreach (GenTableColumn dbFieldInfo in dto.GenTable.Columns.OrderBy(x => x.Sort))
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JinianNet.JNTemplate" Version="2.3.0" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.8" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.9.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
+14
-11
@@ -27,10 +27,13 @@ namespace ZR.Common
|
||||
/// </summary>
|
||||
public int Port { get; set; } = 587;
|
||||
/// <summary>
|
||||
/// 邮件签名
|
||||
/// </summary>
|
||||
public string Signature { get; set; }
|
||||
/// <summary>
|
||||
/// 是否使用SSL协议
|
||||
/// </summary>
|
||||
public bool UseSsl { get; set; } = false;
|
||||
public string mailSign = @"邮件来自C# 程序发送";
|
||||
private readonly MailOptions mailOptions = new();
|
||||
|
||||
public MailHelper()
|
||||
@@ -56,7 +59,7 @@ namespace ZR.Common
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送一个人
|
||||
/// 发送一个
|
||||
/// </summary>
|
||||
/// <param name="toAddress"></param>
|
||||
/// <param name="subject"></param>
|
||||
@@ -105,8 +108,8 @@ namespace ZR.Common
|
||||
//收件人
|
||||
message.To.AddRange(toAddress);
|
||||
message.Subject = subject;
|
||||
//message.Date = DateTime.Now;
|
||||
|
||||
message.Date = DateTime.Now;
|
||||
|
||||
//创建附件Multipart
|
||||
Multipart multipart = new Multipart("mixed");
|
||||
var alternative = new MultipartAlternative();
|
||||
@@ -120,14 +123,14 @@ namespace ZR.Common
|
||||
alternative.Add(Html);
|
||||
}
|
||||
//文本内容
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
//if (!string.IsNullOrEmpty(text))
|
||||
//{
|
||||
var plain = new TextPart(TextFormat.Plain)
|
||||
{
|
||||
var plain = new TextPart(TextFormat.Plain)
|
||||
{
|
||||
Text = text + "\r\n\n\n" + mailSign
|
||||
};
|
||||
alternative.Add(plain);
|
||||
}
|
||||
Text = text + "\r\n\n\n" + mailOptions.Signature
|
||||
};
|
||||
alternative.Add(plain);
|
||||
//}
|
||||
|
||||
//附件
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||
<PackageReference Include="CSRedisCore" Version="3.6.9" />
|
||||
<PackageReference Include="EPPlus" Version="5.8.6" />
|
||||
<PackageReference Include="MailKit" Version="3.1.1" />
|
||||
<PackageReference Include="CSRedisCore" Version="3.8.2" />
|
||||
<PackageReference Include="EPPlus" Version="6.0.4" />
|
||||
<PackageReference Include="MailKit" Version="3.3.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ZR.Model.System.Dto
|
||||
/// <summary>
|
||||
/// 父菜单ID
|
||||
/// </summary>
|
||||
public long parentId { get; set; }
|
||||
public long? parentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示顺序
|
||||
|
||||
@@ -56,7 +56,8 @@ namespace ZR.Model.System
|
||||
public static string LAYOUT = "Layout";
|
||||
/** ParentView组件标识 */
|
||||
public static string PARENT_VIEW = "ParentView";
|
||||
|
||||
/** InnerLink组件标识 */
|
||||
public static string INNER_LINK = "InnerLink";
|
||||
/** 校验返回结果码 */
|
||||
public static string UNIQUE = "0";
|
||||
public static string NOT_UNIQUE = "1";
|
||||
|
||||
@@ -39,19 +39,32 @@ namespace ZR.Model.System.Vo
|
||||
/// </summary>
|
||||
public bool NoCache { get; set; }
|
||||
public string TitleKey { get; set; } = string.Empty;
|
||||
public string Link { get; set; } = string.Empty;
|
||||
|
||||
public Meta(string title, string icon)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
}
|
||||
public Meta(string title, string icon, string path)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
Link = path;
|
||||
}
|
||||
public Meta(string title, string icon, bool noCache)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
NoCache = noCache;
|
||||
}
|
||||
public Meta(string title, string icon, bool noCache, string titleKey)
|
||||
public Meta(string title, string icon, bool noCache, string titleKey, string path)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
NoCache = noCache;
|
||||
TitleKey = titleKey;
|
||||
Link = path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EPPlus" Version="5.8.6" />
|
||||
<PackageReference Include="EPPlus" Version="6.0.4" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.8" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.9.1" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<PackageReference Include="MySql.Data" Version="8.0.29" />
|
||||
<PackageReference Include="NETCore.Encrypt" Version="2.1.0" />
|
||||
<PackageReference Include="SqlSugar.IOC" Version="1.8.0" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.8" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.9.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
using Infrastructure.Attribute;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Models;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.System.ISystemService;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
namespace ZR.Service.System
|
||||
{
|
||||
@@ -40,7 +41,6 @@ namespace ZR.Service.System
|
||||
//搜索条件查询语法参考Sqlsugar
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangCode), it => it.LangCode == parm.LangCode);
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangKey), it => it.LangKey.Contains(parm.LangKey));
|
||||
//predicate = predicate.AndIF(parm.BeginAddtime == null, it => it.Addtime >= DateTime.Now.AddDays(-1));
|
||||
predicate = predicate.AndIF(parm.BeginAddtime != null, it => it.Addtime >= parm.BeginAddtime && it.Addtime <= parm.EndAddtime);
|
||||
var response = _CommonLangrepository
|
||||
.Queryable()
|
||||
@@ -62,7 +62,6 @@ namespace ZR.Service.System
|
||||
//搜索条件查询语法参考Sqlsugar
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangCode), it => it.LangCode == parm.LangCode);
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangKey), it => it.LangKey.Contains(parm.LangKey));
|
||||
//predicate = predicate.AndIF(parm.BeginAddtime == null, it => it.Addtime >= DateTime.Now.AddDays(-1));
|
||||
predicate = predicate.AndIF(parm.BeginAddtime != null, it => it.Addtime >= parm.BeginAddtime && it.Addtime <= parm.EndAddtime);
|
||||
var response = _CommonLangrepository
|
||||
.Queryable()
|
||||
@@ -79,14 +78,47 @@ namespace ZR.Service.System
|
||||
//搜索条件查询语法参考Sqlsugar
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangCode), it => it.LangCode == parm.LangCode);
|
||||
//predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.LangKey), it => it.LangKey.Contains(parm.LangKey));
|
||||
//predicate = predicate.AndIF(parm.BeginAddtime == null, it => it.Addtime >= DateTime.Now.AddDays(-1));
|
||||
//predicate = predicate.AndIF(parm.BeginAddtime != null, it => it.Addtime >= parm.BeginAddtime && it.Addtime <= parm.EndAddtime);
|
||||
var response = _CommonLangrepository
|
||||
.Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToList();
|
||||
return response;
|
||||
}
|
||||
|
||||
public void StorageCommonLang(CommonLangDto parm)
|
||||
{
|
||||
List<CommonLang> langs = new();
|
||||
foreach (var item in parm.LangList)
|
||||
{
|
||||
langs.Add(new CommonLang()
|
||||
{
|
||||
Addtime = DateTime.Now,
|
||||
LangKey = parm.LangKey,
|
||||
LangCode = item.LangCode,
|
||||
LangName = item.LangName,
|
||||
});
|
||||
}
|
||||
var storage = _CommonLangrepository.Storageable(langs)
|
||||
.WhereColumns(it => new { it.LangKey, it.LangCode })
|
||||
.ToStorage();
|
||||
|
||||
storage.AsInsertable.ExecuteReturnSnowflakeIdList();//执行插入
|
||||
storage.AsUpdateable.UpdateColumns(it => new { it.LangName }).ExecuteCommand();//执行修改
|
||||
}
|
||||
|
||||
public Dictionary<string, object> SetLang(List<CommonLang> msgList)
|
||||
{
|
||||
Dictionary<string, object> dic = new();
|
||||
|
||||
foreach (var item in msgList)
|
||||
{
|
||||
if (!dic.ContainsKey(item.LangKey))
|
||||
{
|
||||
dic.Add(item.LangKey, item.LangName);
|
||||
}
|
||||
}
|
||||
return dic;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace ZR.Service.System
|
||||
var info = GenTableRepository.GetId(tableId);
|
||||
if (info != null && !info.SubTableName.IsEmpty())
|
||||
{
|
||||
info.SubTable = GenTableRepository.Queryable().Where(f => f.SubTableName == info.TableName).First();
|
||||
info.SubTable = GenTableRepository.Queryable().Where(f => f.TableName == info.SubTableName).First();
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@ using ZR.Model.Dto;
|
||||
using ZR.Model.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Service.System.ISystemService
|
||||
namespace ZR.Service.System.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 多语言配置service接口
|
||||
@@ -17,5 +17,7 @@ namespace ZR.Service.System.ISystemService
|
||||
PagedInfo<CommonLang> GetList(CommonLangQueryDto parm);
|
||||
List<CommonLang> GetLangList(CommonLangQueryDto parm);
|
||||
dynamic GetListToPivot(CommonLangQueryDto parm);
|
||||
void StorageCommonLang(CommonLangDto parm);
|
||||
Dictionary<string, object> SetLang(List<CommonLang> msgList);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,17 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.IO;
|
||||
using ZR.Service.System.IService;
|
||||
using ZR.Common;
|
||||
using Infrastructure;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography;
|
||||
using System.Net;
|
||||
using ZR.Model.System;
|
||||
using ZR.Repository.System;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Common;
|
||||
using ZR.Model.System;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
namespace ZR.Service.System
|
||||
{
|
||||
@@ -44,7 +43,7 @@ namespace ZR.Service.System
|
||||
{
|
||||
string fileExt = Path.GetExtension(formFile.FileName);
|
||||
fileName = (fileName.IsEmpty() ? HashFileName() : fileName) + fileExt;
|
||||
|
||||
|
||||
string filePath = GetdirPath(fileDir);
|
||||
string finalFilePath = Path.Combine(rootPath, filePath, fileName);
|
||||
double fileSize = Math.Round(formFile.Length / 1024.0, 2);
|
||||
@@ -58,7 +57,7 @@ namespace ZR.Service.System
|
||||
{
|
||||
await formFile.CopyToAsync(stream);
|
||||
}
|
||||
string uploadUrl = SysConfigService.GetSysConfigByKey("sys.file.uploadUrl")?.ConfigValue ?? OptionsSetting.Upload.UploadUrl;
|
||||
string uploadUrl = OptionsSetting.Upload.UploadUrl;
|
||||
string accessPath = string.Concat(uploadUrl, "/", filePath.Replace("\\", "/"), "/", fileName);
|
||||
SysFile file = new(formFile.FileName, fileName, fileExt, fileSize + "kb", filePath, userName)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using ZR.Model.Vo.System;
|
||||
using ZR.Repository.System;
|
||||
using ZR.Service.System.IService;
|
||||
using ZR.Common;
|
||||
using Infrastructure.Extensions;
|
||||
|
||||
namespace ZR.Service
|
||||
{
|
||||
@@ -86,7 +87,7 @@ namespace ZR.Service
|
||||
var list = MenuRepository.GetList(f => f.parentId == menuId).OrderBy(f => f.orderNum).ToList();
|
||||
Context.ThenMapper(list, item =>
|
||||
{
|
||||
item.SubNum = Context.Queryable<SysMenu>().SetContext(x => x.parentId, () => item.MenuId, item).Count();
|
||||
item.SubNum = Context.Queryable<SysMenu>().SetContext(x => x.parentId, () => item.MenuId, item).Count;
|
||||
});
|
||||
return list;
|
||||
}
|
||||
@@ -281,13 +282,13 @@ namespace ZR.Service
|
||||
|
||||
foreach (var menu in menus)
|
||||
{
|
||||
RouterVo router = new RouterVo
|
||||
RouterVo router = new()
|
||||
{
|
||||
Hidden = "1".Equals(menu.visible),
|
||||
Name = GetRouteName(menu),
|
||||
Path = GetRoutePath(menu),
|
||||
Component = GetComponent(menu),
|
||||
Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache), menu.MenuNameKey)
|
||||
Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache), menu.MenuNameKey, menu.path)
|
||||
};
|
||||
|
||||
List<SysMenu> cMenus = menu.children;
|
||||
@@ -300,17 +301,32 @@ namespace ZR.Service
|
||||
}
|
||||
else if (IsMeunFrame(menu))
|
||||
{
|
||||
List<RouterVo> childrenList = new List<RouterVo>();
|
||||
RouterVo children = new RouterVo
|
||||
router.Meta = null;
|
||||
List<RouterVo> childrenList = new();
|
||||
RouterVo children = new()
|
||||
{
|
||||
Path = menu.path,
|
||||
Component = menu.component,
|
||||
Name = string.IsNullOrEmpty(menu.path) ? "" : menu.path.ToLower(),
|
||||
Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache), menu.MenuNameKey)
|
||||
Meta = new Meta(menu.MenuName, menu.icon, "1".Equals(menu.isCache), menu.MenuNameKey, menu.path)
|
||||
};
|
||||
childrenList.Add(children);
|
||||
router.Children = childrenList;
|
||||
}
|
||||
else if (menu.parentId == 0 && IsInnerLink(menu))
|
||||
{
|
||||
router.Meta = new Meta(menu.MenuName, menu.icon);
|
||||
router.Path = "/";
|
||||
List<RouterVo> childrenList = new();
|
||||
RouterVo children = new();
|
||||
string routerPath = InnerLinkReplaceEach(menu.path);
|
||||
children.Path = routerPath;
|
||||
children.Component = UserConstants.INNER_LINK;
|
||||
children.Name = routerPath.ToLower();
|
||||
children.Meta = new Meta(menu.MenuName, menu.icon, menu.path);
|
||||
childrenList.Add(children);
|
||||
router.Children = childrenList;
|
||||
}
|
||||
routers.Add(router);
|
||||
}
|
||||
|
||||
@@ -384,10 +400,10 @@ namespace ZR.Service
|
||||
{
|
||||
string routerPath = menu.path;
|
||||
// 内链打开外网方式
|
||||
//if (menu.parentId != 0 && IsInnerLink(menu))
|
||||
//{
|
||||
// routerPath = innerLinkReplaceEach(routerPath);
|
||||
//}
|
||||
if (menu.parentId != 0 && IsInnerLink(menu))
|
||||
{
|
||||
routerPath = InnerLinkReplaceEach(routerPath);
|
||||
}
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (0 == menu.parentId && UserConstants.TYPE_DIR.Equals(menu.menuType)
|
||||
&& UserConstants.NO_FRAME.Equals(menu.isFrame))
|
||||
@@ -413,6 +429,10 @@ namespace ZR.Service
|
||||
{
|
||||
component = menu.component;
|
||||
}
|
||||
else if (menu.component.IsEmpty() && menu.parentId != 0 && IsInnerLink(menu))
|
||||
{
|
||||
component = UserConstants.INNER_LINK;
|
||||
}
|
||||
else if (string.IsNullOrEmpty(menu.component) && IsParentView(menu))
|
||||
{
|
||||
component = UserConstants.PARENT_VIEW;
|
||||
@@ -451,16 +471,16 @@ namespace ZR.Service
|
||||
{
|
||||
return menu.parentId != 0 && UserConstants.TYPE_DIR.Equals(menu.menuType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内链域名特殊字符替换
|
||||
/// </summary>
|
||||
/// <param name = "path" ></ param >
|
||||
/// < returns ></ returns >
|
||||
//public string innerLinkReplaceEach(string path)
|
||||
//{
|
||||
// return stringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS },
|
||||
// new String[] { "", "" });
|
||||
//}
|
||||
public string InnerLinkReplaceEach(string path)
|
||||
{
|
||||
return path.IsNotEmpty() ? path.Replace(UserConstants.HTTP, "").Replace(UserConstants.HTTPS, "") : path;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace ZR.Tasks.TaskScheduler
|
||||
internal class Job_HttpRequest : JobBase, IJob
|
||||
{
|
||||
private readonly ISysTasksQzService tasksQzService;
|
||||
private readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
|
||||
public Job_HttpRequest(ISysTasksQzService tasksQzService)
|
||||
{
|
||||
@@ -32,7 +33,11 @@ namespace ZR.Tasks.TaskScheduler
|
||||
if (info != null)
|
||||
{
|
||||
var result = await HttpHelper.HttpGetAsync("http://" + info.ApiUrl);
|
||||
Console.WriteLine(result);
|
||||
logger.Info($"任务【{info.Name}】网络请求执行结果=" + result);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new CustomException("任务网络请求执行失败,任务不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="字段信息" name="cloum">
|
||||
<el-table ref="dragTable" v-loading="loading" :data="columns" row-key="columnId" min-height="150px" :max-height="tableHeight">
|
||||
<el-table-column label="序号" type="index" class-name="allowDrag" fixed />
|
||||
<el-table-column label="字段列名" prop="columnName" :show-overflow-tooltip="true" fixed />
|
||||
<el-table-column label="字段描述" fixed>
|
||||
<el-table-column label="序号" type="index" class-name="allowDrag" />
|
||||
<el-table-column label="字段列名" prop="columnName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="字段描述" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.columnComment" :ref="scope.row.columnId" @keydown.native="nextFocus(scope.row, scope.$index, $event)">
|
||||
</el-input>
|
||||
|
||||
Reference in New Issue
Block a user