fix: 修改log文件名称

This commit is contained in:
fit2cloud-chenyw 2022-05-30 10:22:23 +08:00
parent 5e6e00e84c
commit fb446e3943
2 changed files with 5 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -266,7 +267,9 @@ public class LogService {
response.setContentType("application/vnd.ms-excel");
//文件名称
response.setHeader("Content-disposition", "attachment;filename=log.xlsx");
String fileName = "DataEase操作日志";
String encodeFileName = URLEncoder.encode(fileName, "UTF-8");
response.setHeader("Content-disposition", "attachment;filename="+encodeFileName+".xlsx");
wb.write(outputStream);
outputStream.flush();
outputStream.close();

View File

@ -116,7 +116,7 @@ export default {
const link = document.createElement('a')
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.download = 'log.xlsx' //
link.download = 'DataEase操作日志.xlsx' //
document.body.appendChild(link)
link.click()
document.body.removeChild(link)