前端 let filePath = base64.encode(path);
后台
public AjaxResult export(String filePath) { log.info("需要删除的文件:{}", filePath); byte[] decode = Base64.getDecoder().decode(filePath); filePath = new String(decode); log.info("解密后的文件:{}", filePath); File file = new File(filePath); boolean result = false; if (file.exists()) { result = file.delete(); } return result ? success("操作成名"):error("操作失败"); }