chenjiahe
2022-06-02 fd3fb983d12879d028e95e9b46b8fc080ea0af11
src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java
@@ -162,14 +162,15 @@
    * @return
    */
   public static File createLimitedQrCode(String at, String page, int width, boolean autoColor,
                                 JSONObject lineColor, boolean isHyaline) throws IOException {
                                 JSONObject lineColor, boolean isHyaline) {
      String imgUrl = null;
      InputStream in = null;
      HttpURLConnection conn = null;
      //创建临时文件
      File file = File.createTempFile("temp", ".jpg");
      File file = null;
      try {
         file = File.createTempFile("temp", ".jpg");
         //生成发送数据
         JSONObject obj = new JSONObject();
         obj.put("width", width);
@@ -245,7 +246,9 @@
            conn = null;
         }
      }finally {
         file.deleteOnExit();
         if(file != null){
            file.deleteOnExit();
         }
      }
      return file;
   }