xiaoyong931011
2022-05-16 671660360e591c153ab16f99205930b283baaa1d
zq-erp/src/main/java/com/matrix/system/padApi/action/PadApiCommonAction.java
@@ -252,6 +252,7 @@
        if (!uploadDir.isDirectory()) {
            uploadDir.mkdir();
        }
        log.info("uploadDto:" + uploadDto.getBase64Str());
        BASE64Decoder decoder = new BASE64Decoder();
        byte[] bytes = new byte[0];
        try {
@@ -271,7 +272,7 @@
        if (bytes.length > maxSize) {
            return AjaxResult.buildFailInstance("上传文件大小超过限制");
        }
        String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + "." +".jpg";
        String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + ".png";
        File uploadedFile = new File(savePath, newFileName);
        try {
            FileCopyUtils.copy(bytes, uploadedFile);
@@ -283,7 +284,7 @@
        log.info("上传一个文件:" + newFileName);
        log.info("访问路径:" + visitPath);
        AjaxResult result = new AjaxResult();
        AjaxResult result = AjaxResult.buildSuccessInstance("上传成功");
        result.putInMap("path", visitPath);
        result.putInMap("fileName", newFileName);
        return result;