修改文件app/m/main.php 123行下代码,对应替换即可
if (in_weixin())
{
$noncestr = mt_rand(1000000000, 9999999999);
TPL::assign('weixin_noncestr', $noncestr);
$jsapi_ticket = $this->model('openid_weixin_weixin')->get_jsapi_ticket($this->model('openid_weixin_weixin')->get_access_token(get_setting('weixin_app_id'), get_setting('weixin_app_secret')));
$url = ($_SERVER['HTTPS'] AND !in_array(strtolower($_SERVER['HTTPS']), array('off', 'no'))) ? 'https' : 'http';
$url_old= explode('&',$_SERVER['REQUEST_URI']);
foreach ($url_old as $key => &$value) {
$num_d=explode('=',$value);
if (count($num_d)==2 && empty($num_d[1])) {
$value=trim($value,'=');
}
$url_new .=$value.'&';
}
$url_new = trim($url_new,'&');
$url .= '://' . $_SERVER['HTTP_HOST'] . $url_new;
TPL::assign('weixin_signature', $this->model('openid_weixin_weixin')->generate_jsapi_ticket_signature(
$jsapi_ticket,
$noncestr,
TIMESTAMP,
$url
));
}
阅读全文
收起全文