| | |
| | | } |
| | | |
| | | /** |
| | | * @param HtmlContentVO |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/common/htmlContent") |
| | | @PostMapping("/htmlContent") |
| | | public AjaxResult htmlContent(@RequestBody HtmlContentVO htmlContentVO) { |
| | | // 获取文件的原始名称 |
| | | String fileName = htmlContentVO.getFileName(); |
| | | // 将文件保存到指定目录 |
| | | File outputFile = new File(RuoYiConfig.getUploadPath() + "/show/" + fileName.split("\\.", 2)[0] + fileName); |
| | | try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile))) { |
| | | File outputFile = new File(RuoYiConfig.getUploadPath() + "/show/" + fileName.split("\\.", 2)[0] + "/" + fileName); |
| | | try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"))) { |
| | | writer.write(htmlContentVO.getContent()); |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return AjaxResult.success(); |
| | | String url = serverConfig.getUrl() + "/profile/upload/show/" + fileName.split("\\.", 2)[0] + "/" + fileName; |
| | | return AjaxResult.success(url); |
| | | } |
| | | |
| | | |