# 微信授权
public function WxShouquan () {
# 秘钥
$appid = Lay3()['appid'];
$secret = Lay3()['serect'];
$code = $_POST['code'];
$token = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$appid}&secret={$secret}&code={$code}&grant_type=authorization_code";
# 将整个文件读入一个字符串
$token = file_get_contents($token);
# 转为数组
$access= json_decode($token, true);
# 获取
$access_token = $access['access_token'];
$openid = $access['openid'];
$con = getCurl("https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang=zh_CN");
return json($con['nickname']);
}