mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
Merge branch 'main' of https://gitee.com/dotnetchina/OpenAuth.Net into main
This commit is contained in:
commit
41c1596679
@ -40,10 +40,10 @@ namespace OpenAuth.App
|
||||
{
|
||||
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
|
||||
}
|
||||
var properties = loginContext.GetProperties("<%=Table.Name%>");
|
||||
if (properties == null || properties.Count == 0)
|
||||
var columnFields = loginContext.GetTableColumns("<%=Table.Name%>");
|
||||
if (columnFields == null || columnFields.Count == 0)
|
||||
{
|
||||
throw new Exception("当前登录用户没有访问该模块字段的权限,请联系管理员配置");
|
||||
throw new Exception("请在代码生成界面配置Category表的字段属性");
|
||||
}
|
||||
var result = new TableData();
|
||||
var objs = UnitWork.Find<<%=Table.Name%>>(null);
|
||||
@ -51,8 +51,8 @@ namespace OpenAuth.App
|
||||
{
|
||||
objs = objs.Where(u => u.Id.Contains(request.key));
|
||||
}
|
||||
var propertyStr = string.Join(',', properties.Select(u => u.Key));
|
||||
result.columnHeaders = properties;
|
||||
var propertyStr = string.Join(',', columnFields.Select(u =>u.ColumnName));
|
||||
result.columnFields = columnFields;
|
||||
result.data = objs.OrderBy(u => u.Id)
|
||||
.Skip((request.page - 1) * request.limit)
|
||||
.Take(request.limit).Select($"new ({propertyStr})");
|
||||
|
@ -28,12 +28,12 @@ layui.config({
|
||||
$.getJSON('/<%=ModuleName%>s/Load',
|
||||
{ page: 1, limit: 1 },
|
||||
function (data) {
|
||||
var columns = data.columnHeaders.map(function (e) {
|
||||
return {
|
||||
field: e.Key,
|
||||
title: e.Description
|
||||
};
|
||||
});
|
||||
var columns = data.columnFields.filter(u => u.IsList ===true).map(function (e) {
|
||||
return {
|
||||
field: e.ColumnName,
|
||||
title: e.Comment
|
||||
};
|
||||
});
|
||||
columns.unshift({
|
||||
type: 'checkbox',
|
||||
fixed: 'left'
|
||||
|
@ -38,12 +38,7 @@ namespace OpenAuth.App.Response
|
||||
/// </summary>
|
||||
public int count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的列表头信息(已过时,请使用columnFields代替)
|
||||
/// </summary>
|
||||
[Obsolete("请使用ColumnFields以获得更丰富的配置信息")]
|
||||
public List<KeyDescription> columnHeaders;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 返回的表格列定义
|
||||
/// 该属性基于代码生成使用的列定义
|
||||
@ -59,7 +54,6 @@ namespace OpenAuth.App.Response
|
||||
{
|
||||
code = 200;
|
||||
msg = "加载成功";
|
||||
columnHeaders = new List<KeyDescription>();
|
||||
columnFields = new List<BuilderTableColumn>();
|
||||
}
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ namespace OpenAuth.App
|
||||
+ "` ( Id varchar(50) not null primary key,") ; //主键
|
||||
|
||||
|
||||
string sqlDefault = "";
|
||||
// string sqlDefault = "";
|
||||
|
||||
foreach (var json in jsonArray)
|
||||
{
|
||||
|
@ -7,6 +7,9 @@ using Quartz;
|
||||
|
||||
namespace OpenAuth.App.HostedService
|
||||
{
|
||||
/// <summary>
|
||||
/// 自启动服务,本服务用于启动所有状态为【正在运行】的定时任务
|
||||
/// </summary>
|
||||
public class QuartzService : IHostedService, IDisposable
|
||||
{
|
||||
private readonly ILogger<QuartzService> _logger;
|
||||
@ -23,15 +26,15 @@ namespace OpenAuth.App.HostedService
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_scheduler.Start();
|
||||
_openJobApp.StartAll();
|
||||
return Task.CompletedTask;
|
||||
var result = _openJobApp.StartAll();
|
||||
return result;
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_scheduler.Shutdown();
|
||||
var result =_scheduler.Shutdown();
|
||||
_logger.LogInformation("关闭定时job");
|
||||
return Task.CompletedTask;
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
@ -176,10 +176,12 @@ namespace OpenAuth.App.SSO
|
||||
_cacheContext.Remove(token);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -40,7 +40,7 @@ namespace OpenAuth.App.Test
|
||||
{
|
||||
Console.WriteLine($"开始异步测试");
|
||||
|
||||
AddOrUpdate();
|
||||
var result =AddOrUpdate();
|
||||
|
||||
Console.WriteLine("异步测试结束");
|
||||
|
||||
|
@ -93,7 +93,8 @@ namespace OpenAuth.App
|
||||
|
||||
|
||||
|
||||
var userViews = userOrgs.ToList().GroupBy(b => b.Account).Select(u =>new UserView
|
||||
var userViews = (await userOrgs.ToListAsync()).GroupBy(b => b.Account)
|
||||
.Select(u =>new UserView
|
||||
{
|
||||
Id = u.First().Id,
|
||||
Account = u.Key,
|
||||
@ -159,7 +160,7 @@ namespace OpenAuth.App
|
||||
userOrgs = userOrgs.Where(u => u.Key == Define.USERORG && u.OrgId == request.orgId);
|
||||
}
|
||||
|
||||
var userViews = userOrgs.ToList().GroupBy(b => b.Account).Select(u =>new UserView
|
||||
var userViews = (await userOrgs.ToListAsync()).GroupBy(b => b.Account).Select(u =>new UserView
|
||||
{
|
||||
Id = u.First().Id,
|
||||
Account = u.Key,
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
|
Loading…
Reference in New Issue
Block a user