|
|
|
@ -126,7 +126,14 @@ class Callback extends Controller
|
|
|
|
|
$code = Request::instance()->get('code');
|
|
|
|
|
$api = new Api(config('wework.corpId'), config('wework.corpSecret'));
|
|
|
|
|
$userInfo = $api->getUserInfo($code);
|
|
|
|
|
Session::set('user_id', $userInfo['userid']);
|
|
|
|
|
return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid=wxwork');
|
|
|
|
|
if ($userInfo) {
|
|
|
|
|
Session::set('wxuser_id', $userInfo['userid']);
|
|
|
|
|
$adminUser = db('admin_user')->where('wxwork_id', $userInfo['userid'])->find();
|
|
|
|
|
if ($adminUser) {
|
|
|
|
|
Session::set('user_id', $adminUser['id']);
|
|
|
|
|
return redirect('http://web.lbschem.com:8088/?authkey=wxwork&sessionid='.session_id());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return redirect('http://web.lbschem.com:8088/');
|
|
|
|
|
}
|
|
|
|
|
}
|