From 8af9b52e63967575713d77ad23b43d29d9826dc7 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期五, 17 六月 2022 10:56:20 +0800
Subject: [PATCH] 新增启动项注解-redis

---
 src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java b/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java
index 260fc88..2035142 100644
--- a/src/main/java/com/hx/mp/util/MPWeixinBaseUtil.java
+++ b/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;
 	}

--
Gitblit v1.8.0