首页 > 代码库 > 微信分享
微信分享
<?php /** * Description of WxShare *微信分享 * @author xinjun */ namespace Controller\Wx; use Controller\Home\HomeBase; use Model\Wx\UserModel; use Model\Wx\TokenModel; use Framework\Net\Request; class WxShare extends HomeBase { public function __construct() { parent::__construct(); } /** * 分享配置信息 * @return type */ public function getConfig() { $url = $_POST[‘url‘]; $conf = array(); $conf[‘debug‘] = true; $conf[‘appId‘] = $this->getAppid(); $conf[‘timestamp‘] = time(); $conf[‘nonceStr‘] = "Wm3WZYTPz0wzccnW"; $conf[‘signature‘] = $this->getSignature($conf[‘nonceStr‘],$conf[‘timestamp‘],$url); $conf[‘jsApiList‘] = [‘onMenuShareTimeline‘,‘onMenuShareAppMessage‘]; // print_r($conf);exit; return $this->getData($conf);//json_encode($conf,JSON_UNESCAPED_SLASHES) ; } /** * 获取appid * @return type */ public function getAppid() { $tokenModel = new TokenModel(); $appidData = http://www.mamicode.com/$tokenModel->getAccessToken(array(‘nf_type‘=>1));"https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=".$accesstokenData[‘nf_val‘]."&type=jsapi"; $https = true; $method = ‘get‘; $data = http://www.mamicode.com/null;>
微信分享
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。