From e10efbf4a31a0c86343a2444f0ebb78cf72ce540 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Tue, 9 Jul 2019 21:23:20 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E5=AE=8C=E6=88=90=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/ThirdLogin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/ThirdLogin.php b/application/admin/controller/ThirdLogin.php index 7f76400..ddddc43 100644 --- a/application/admin/controller/ThirdLogin.php +++ b/application/admin/controller/ThirdLogin.php @@ -109,12 +109,12 @@ class ThirdLogin extends Base { $qrCode->setWriterByName('png'); $qrCode->setMargin(10); $qrCode->setEncoding('UTF-8'); - $qrCode->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH); + $qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::HIGH)); $qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]); $qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]); $qrCode->setRoundBlockSize(true); $qrCode->setValidateResult(false); - $qrCode->writeFile(Env::get('root_path') . '/public/qr/' . $state . '.png'); + $qrCode->writeFile(Env::get('root_path') . 'public/qr/' . $state . '.png'); cache($state, 1, 300); @@ -197,13 +197,13 @@ class ThirdLogin extends Base { if (is_numeric($userInfo)) { return $this->buildFailed(666, '等待扫码'); } else { - unlink(Env::get('root_path') . '/public/qr/' . $state . '.png'); + @unlink(Env::get('root_path') . 'public/qr/' . $state . '.png'); if (is_array($userInfo)) { cache($state, null); return $this->doLogin($userInfo['openid'], [ 'nickname' => $userInfo['nickname'], - 'head_img' => $userInfo['headimgurl'] + 'head_img' => $userInfo['head_img'] ]); } else { return $this->buildFailed(ReturnCode::INVALID, '登录状态已失效,请重新登录');