首页 > 编程语言 >浏览器打开微信小程序

浏览器打开微信小程序

时间:2022-12-15 11:34:04浏览次数:86  
标签:浏览器 dump url 微信 程序 wxa https res wx

function h5() {
	$wx = new Wx('appId', 'appSecret');
	// \dump($wx->getAccessToken());
	$url = 'https://api.weixin.qq.com/wxa/generatescheme?' . \http_build_query([
		'access_token' => $wx->getAccessToken(),
	]);
	$res = \jsonDecode(\post($url, \jsonEncode([
		'jump_wxa' => [
			'path' => '首页路径',
		],
		'expire_type' => 1,
		'expire_interval' => 30,
	])));
	// \dump($res);
	header('location:' . $res['openlink']);
}

相关文档:https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/url-scheme/generateScheme.html

标签:浏览器,dump,url,微信,程序,wxa,https,res,wx
From: https://www.cnblogs.com/sunr/p/16984574.html

相关文章