mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 05:13:25 +08:00
紧急修复CodeSmith模版
This commit is contained in:
parent
1c699eda26
commit
5c060f8ed9
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user