From c054595a94ccf55e515df18092a904a9101d46d9 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 27 Dec 2019 13:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1=E5=88=86?= =?UTF-8?q?=E4=BA=ABbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/HomeController.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 0c8145339..aaed98006 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -42,7 +42,13 @@ class HomeController extends Controller $secret = 'd3219c70a45c5e1954be4608b288d38b'; $tokenUrl = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $secret; - $content = file_get_contents(RUNTIME_PATH . 'Data/wechat_ticket'); + $tempDataDir = RUNTIME_PATH . 'Data'; + if(!is_dir($tempDataDir)) { + @mkdir($tempDataDir); + } + + $content = file_get_contents($tempDataDir . '/wechat_ticket'); + $ticketData = null; if ($content) { $ticketData = json_decode($content, true);