master
cody 11 months ago
parent 78810188ef
commit a715ef89b9

@ -39,7 +39,7 @@ class UserController extends CommonController
} }
// 获取配置信息 // 获取配置信息
$appid = \config('app.wechat_appid'); $appid = \config('app.wechat_appid');
$appSecret = \config('app.wechat_appsecret'); $appSecret = \config('app.wechat_secret');
$url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $appSecret . "&js_code={$all['code']}&grant_type=authorization_code"; $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $appSecret . "&js_code={$all['code']}&grant_type=authorization_code";
$userInfo = json_decode(file_get_contents($url), true); $userInfo = json_decode(file_get_contents($url), true);
if (!isset($userInfo['openid'])) { if (!isset($userInfo['openid'])) {

Loading…
Cancel
Save