代码生成新增是否显示指定按钮
This commit is contained in:
@@ -206,25 +206,24 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <summary>
|
||||
/// 预览代码
|
||||
/// </summary>
|
||||
/// <param name="tableId"></param>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("preview/{tableId}")]
|
||||
[HttpPost("preview/{tableId}")]
|
||||
[ActionPermissionFilter(Permission = "tool:gen:preview")]
|
||||
public IActionResult Preview(long tableId)
|
||||
public IActionResult Preview([FromBody] GenerateDto dto)
|
||||
{
|
||||
if (tableId <= 0)
|
||||
if (dto == null || dto.TableId <= 0)
|
||||
{
|
||||
throw new CustomException(ResultCode.CUSTOM_ERROR, "请求参数为空");
|
||||
}
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(tableId);
|
||||
genTableInfo.Columns = GenTableColumnService.GenTableColumns(tableId);
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
|
||||
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
|
||||
|
||||
//var dictList = genTableInfo.Columns.FindAll(x => !string.IsNullOrEmpty(x.DictType));
|
||||
//foreach (var item in dictList)
|
||||
//{
|
||||
// item.DictDatas = SysDictDataService.SelectDictDataByType(item.DictType);
|
||||
//}
|
||||
GenerateDto dto = new();
|
||||
dto.GenTable = genTableInfo;
|
||||
dto.ZipPath = Path.Combine(WebHostEnvironment.WebRootPath, "Generatecode");
|
||||
dto.GenCodePath = Path.Combine(dto.ZipPath, DateTime.Now.ToString("yyyyMMdd"));
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ZR.Admin.WebApi.Framework
|
||||
/// <returns></returns>
|
||||
public static LoginUser GetLoginUser(HttpContext httpContext)
|
||||
{
|
||||
string token = HttpContextExtension.GetToken(httpContext);
|
||||
string token = httpContext.GetToken();
|
||||
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ namespace ZR.Admin.WebApi.Framework
|
||||
Audience = jwtSettings.Audience,
|
||||
IssuedAt = authTime,//token生成时间
|
||||
Expires = expiresAt,
|
||||
NotBefore = authTime,
|
||||
//NotBefore = authTime,
|
||||
TokenType = "Bearer",
|
||||
//对称秘钥,签名证书
|
||||
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature)
|
||||
@@ -86,7 +86,8 @@ namespace ZR.Admin.WebApi.Framework
|
||||
ValidAudience = jwtSettings.Audience,
|
||||
IssuerSigningKey = new SymmetricSecurityKey(key),
|
||||
ValidateLifetime = true,//是否验证Token有效期,使用当前时间与Token的Claims中的NotBefore和Expires对比
|
||||
RequireExpirationTime = true,//过期时间
|
||||
ClockSkew = TimeSpan.FromSeconds(30)
|
||||
//RequireExpirationTime = true,//过期时间
|
||||
};
|
||||
return tokenDescriptor;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\business\" />
|
||||
<Folder Include="DataProtection\" />
|
||||
<Folder Include="wwwroot\export\" />
|
||||
<Folder Include="wwwroot\Generatecode\" />
|
||||
<Folder Include="wwwroot\uploads\" />
|
||||
|
||||
@@ -20,9 +20,11 @@ ${vueQueryFormHtml}
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
$if(replaceDto.ShowBtnExport)
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['${replaceDto.PermissionPrefix}:export']">导出</el-button>
|
||||
</el-col>
|
||||
$end
|
||||
$if(genTable.SortField != "" && 1 == 2)
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="el-icon-edit" size="mini" @click="handleShowSort" v-hasPermi="['${replaceDto.PermissionPrefix}:update']">修改排序</el-button>
|
||||
@@ -101,6 +103,13 @@ export default {
|
||||
form: {},
|
||||
// 时间范围数组
|
||||
timeRange: [],
|
||||
columns: [
|
||||
$set(index = 0)
|
||||
$foreach(column in genTable.Columns)
|
||||
{ index: $index, key: '${column.ColumnName}', label: `${column.ColumnComment}`, checked: $if(index < 9) true $else false $end },
|
||||
$set(index = index + 1)
|
||||
$end
|
||||
],
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox"))
|
||||
// ${item.ColumnComment}选项列表
|
||||
|
||||
Reference in New Issue
Block a user