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