修改部门问题
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
# 项目相关配置
|
||||
ruoyi:
|
||||
# 名称
|
||||
name: sdwu_du
|
||||
name: sdwu_dw
|
||||
# 版本
|
||||
version: 3.9.0
|
||||
# 版权年份
|
||||
@ -52,7 +52,7 @@ spring:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: dev
|
||||
active: test
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
|
@ -61,20 +61,18 @@ public class CjOptionController extends BaseController
|
||||
{
|
||||
List<CjOption> listOption = cjOptionService.selectCjOptionByIds(userVo.getOptionId());
|
||||
List<CjStudent> listStudent = cjStudentService.selectCjStudentByIds(userVo.getStudentId());
|
||||
|
||||
// 设置响应头,通知浏览器下载 ZIP 文件
|
||||
String zipFileName = "export_data_" + System.currentTimeMillis() + ".zip";
|
||||
response.setContentType("application/zip");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + zipFileName + "\"");
|
||||
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + zipFileName);
|
||||
// 使用 ZipOutputStream 将两个 Excel 文件打包
|
||||
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
|
||||
// 1. 导出选项数据 Excel
|
||||
addExcelToZip(zipOut, listOption, "选项数据.xlsx", CjOption.class);
|
||||
|
||||
// 2. 导出学生信息 Excel
|
||||
addExcelToZip(zipOut, listStudent, "学生信息.xlsx", CjStudent.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,15 +82,12 @@ public class CjOptionController extends BaseController
|
||||
ExcelUtil<T> excelUtil = new ExcelUtil<>(clazz);
|
||||
excelUtil.init(dataList, "数据", StringUtils.EMPTY, Excel.Type.EXPORT);
|
||||
excelUtil.writeSheet();
|
||||
|
||||
// 创建 ZIP 条目
|
||||
ZipEntry zipEntry = new ZipEntry(fileName);
|
||||
zipOut.putNextEntry(zipEntry);
|
||||
|
||||
// 将 Excel 写入 ZIP 流
|
||||
Workbook workbook = excelUtil.getWb();
|
||||
workbook.write(zipOut);
|
||||
|
||||
// 关闭当前 ZIP 条目
|
||||
zipOut.closeEntry();
|
||||
}
|
||||
|
@ -86,7 +86,8 @@ public class DwQuestionController extends BaseController
|
||||
// 设置响应头,通知浏览器下载 ZIP 文件
|
||||
String zipFileName = "export_data_" + System.currentTimeMillis() + ".zip";
|
||||
response.setContentType("application/zip");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + zipFileName + "\"");
|
||||
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + zipFileName);
|
||||
// 使用 ZipOutputStream 将两个 Excel 文件打包
|
||||
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
|
||||
// 1. 导出选项数据 Excel
|
||||
|
@ -113,6 +113,7 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("id", config.getId());
|
||||
result.put("indexType", config.getIndexType());
|
||||
result.put("indexTitle", config.getIndexTitle());
|
||||
DwQuestion question = dwQuestionMapper.selectDwQuestionById(Long.valueOf(config.getQuestionId()));
|
||||
result.put("question", question.getQuestion());
|
||||
List<AnswerCountVo> list = dwIndexConfigMapper.selectIndex(Long.valueOf(config.getQuestionId()), config.getInfoId());
|
||||
|
@ -25,10 +25,19 @@ public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, S
|
||||
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e)
|
||||
throws IOException
|
||||
{
|
||||
int code = HttpStatus.UNAUTHORIZED;
|
||||
String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
|
||||
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
|
||||
try
|
||||
{
|
||||
response.setStatus(401);
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().print(JSON.toJSONString(AjaxResult.error(code, msg)));
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user