陈昶聿
6 小时以前 afafd548b795b479409d270f2936827b38375f6c
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -155,8 +155,10 @@
            filePath = filePath + "/show/" + file.getOriginalFilename().split("\\.", 2)[0];
            // 上传并返回新文件名称
            String fileName = FileUploadUtils.uploadSort(filePath, file);
            //将word转成html
            convertDocToHtml(filePath + "\\" + file.getOriginalFilename(), filePath + "\\" + file.getOriginalFilename().split("\\.", 2)[0] + ".html");
            // 将word转成html(源文件以磁盘实际保存路径为准,保持分隔符一致,避免"/"和"\"混用导致找不到文件)
            String docFilePath = RuoYiConfig.getProfile() + fileName.replace(Constants.RESOURCE_PREFIX, "");
            String htmlFilePath = docFilePath.replaceAll("\\.[^.]*$", ".html");
            convertDocToHtml(docFilePath, htmlFilePath);
            String url = null;
            SysConfig config = new SysConfig();
@@ -387,14 +389,16 @@
     */
    @ApiOperation("删除RedisCache")
    @PostMapping("/deleteRedisCache")
    public String deleteRedisCache(@RequestBody String key) {
        String object = redisCache.getCacheObject(key);
        if(StringUtils.isNotEmpty(object)) {
            redisCache.deleteObject(key);
            return "删除RedisCache" + key + "成功!";
        }else {
            return "删除RedisCache" + key + "失败,未找到对应cache";
    public Set<String> deleteRedisCache(@RequestBody String key) {
        Set<String> allKeys =  redisCache.getAllKeys();
        Set<String> matchKeys = new HashSet<>();
        for (String redisKey : allKeys) {
            if(redisKey.contains(key)) {
                redisCache.deleteObject(redisKey);
                matchKeys.add(redisKey);
            }
        }
        return matchKeys;
    }
}