diff --git a/application/crm/controller/Callback.php b/application/crm/controller/Callback.php index e9c8744..ee2186f 100644 --- a/application/crm/controller/Callback.php +++ b/application/crm/controller/Callback.php @@ -126,7 +126,7 @@ class Callback extends Controller $code = Request::instance()->get('code'); $api = new Api(config('wework.corpId'), config('wework.corpSecret')); $userInfo = $api->getUserInfo($code); - if ($userInfo) { + if ($userInfo['userid']) { Session::set('wxuser_id', $userInfo['userid']); $adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find(); if ($adminUser) {