下载打印模板放开AllowAnonymous,解决前端保存文件乱码的bug

optimize
wanghaomei 2 years ago
parent 35246de5fa
commit ef9cf13414

@ -22,6 +22,7 @@ using System.Collections.Generic;
using Myshipping.Application.Service.BookingPrintTemplate.Dto;
using Myshipping.Core.Entity;
using Myshipping.Application.Service.BookingTemplate.Dto;
using Microsoft.AspNetCore.Authorization;
namespace Myshipping.Application
{
@ -75,9 +76,9 @@ namespace Myshipping.Application
[HttpGet("/BookingPrintTemplate/GetPrintTemplateList")]
public async Task<dynamic> GetPrintTemplateList(string KeyWord)
{
return await _rep.AsQueryable().Where(x => x.TenantId == UserManager.TENANT_ID).WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.FileName.StartsWith(KeyWord))
.ToListAsync();
return await _rep.AsQueryable().Where(x => x.TenantId == UserManager.TENANT_ID).WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.FileName.StartsWith(KeyWord))
.ToListAsync();
}
@ -328,7 +329,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("/BookingPrintTemplate/download")]
[HttpGet("/BookingPrintTemplate/download"), AllowAnonymous]
public async Task<IActionResult> Download(long id)
{
var printFile = await _rep.FirstOrDefaultAsync(u => u.Id == id);
@ -388,7 +389,7 @@ namespace Myshipping.Application
/// </summary>
/// <returns></returns>
[HttpGet("/BookingPrintTemplate/GetPrinttemplateRightList")]
public async Task<dynamic> GetPrinttemplateRightList(long userId,string cateCode,string type)
public async Task<dynamic> GetPrinttemplateRightList(long userId, string cateCode, string type)
{
var userlist = await _repUser.AsQueryable().Filter(null, true).ToListAsync();
var list = await _repRight.AsQueryable().InnerJoin<BookingPrintTemplate>((d, t) => d.PrintTemplateId == t.Id && t.TenantId == UserManager.TENANT_ID).

@ -5445,7 +5445,7 @@
<param name="rowNum">创建第几行(从0开始)</param>
<param name="rowHeight">行高</param>
</member>
<member name="M:Myshipping.Core.Helper.NpoiExcelExportHelper.CreateCells(NPOI.HSSF.UserModel.HSSFRow,NPOI.HSSF.UserModel.HSSFCellStyle,System.Int32,System.String)">
<member name="M:Myshipping.Core.Helper.NpoiExcelExportHelper.CreateCells(NPOI.HSSF.UserModel.HSSFRow,System.Int32,System.String,NPOI.HSSF.UserModel.HSSFCellStyle)">
<summary>
创建行内指定的单元格
</summary>

Loading…
Cancel
Save