You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
965 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace tencent\wechat\weixin;
use EasyWeChat\Factory;
class Jssdk extends Base
{
/**
* 获取JSSDK的配置数组
* @param array $api_list API数组
* @param boolean $debug 调试模式是否打开 false--关闭 true--打开
* @param string $url 设置当前URL如果不想用默认读取的URL可以使用此方法手动设置通常不需要。
* @date 2022-03-16
*/
public function buildConfig($api_list, $debug, $url = '')
{
$app = Factory::officialAccount($this->weixinConfig);
if(!empty($url)){
$app->jssdk->setUrl($url);
}
$data = $app->jssdk->buildConfig($api_list, $debug, false, false);
return $data;
}
/**
*
*
* @date 2022-03-16
*/
public function setUrl($url)
{
$app = Factory::officialAccount($this->weixinConfig);
$res = $app->jssdk->setUrl($url);
return $res;
}
}