Sfoglia il codice sorgente

fix 设置二维码地址

tjf 3 anni fa
parent
commit
908c11ea78

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java

@@ -138,6 +138,6 @@ public class RuoYiConfig
      */
     public static String getUploadQrPath()
     {
-        return  "/profile/qrUpload";
+        return getProfile() + "/qrUpload";
     }
 }

+ 3 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/QRCodeUtils.java

@@ -128,12 +128,13 @@ public class QRCodeUtils {
                                 boolean needCompress) throws Exception {
         BufferedImage image = QRCodeUtils.createImage(content, imgPath,
                 needCompress);
-        destPath = destPath+"/" +DateUtils.datePath();
+        String date = DateUtils.datePath();
+        destPath = destPath+"/" + date;
         mkdirs(destPath);
         String file = UUID.randomUUID() + ".jpg";
         File fileQR = new File(destPath + "/" + file);
         ImageIO.write(image, FORMAT_NAME, fileQR);
-        return fileQR.getAbsolutePath();
+        return "/profile/qrUpload/"+date+"/"+file;
     }