🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
​ ~~~html use EasyWeChat\Factory; ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") ~~~php /*分享链接*/ public function share(){ $url=$this->request->param()['url']; $info=$this->auth->getUserinfo(); $url = str_replace("amp;", "", $url); $config = [ 'app_id' =>get_addon_config("baseconfig")['appid'], 'secret' =>get_addon_config("baseconfig")['appsecret'], // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名 'response_type' => 'array', //... ]; $baseurl=$this->request->domain(); $app = Factory::officialAccount($config); // $config=$app->jssdk->buildConfig(array('onMenuShareAppMessage', 'onMenuShareTimeline'),$url ,false); $config=json_decode($app->jssdk->buildConfig(array('onMenuShareAppMessage', 'onMenuShareTimeline'),$url, false),true); // $config=json_decode($app->jssdk->buildConfig(array('updateAppMessageShareData', 'updateTimelineShareData'), true),true); $ret['config']=$config; $ret['text']['link']=$this->request->domain().'/insurance_mall/zmlRegister.html?register_code='.$info['register_code'];; $ret['text']['zftitle']=get_addon_config("baseconfig")['zftitle']; $ret['text']['zfcontent']=get_addon_config("baseconfig")['zfcontent']; $ret['text']['pyqtitle']=get_addon_config("baseconfig")['pyqtitle']; $ret['text']['pyqcontent']=get_addon_config("baseconfig")['pyqcontent']; $ret['text']['zfimage']=$baseurl.get_addon_config("baseconfig")['zfimage']; $ret['text']['pyqimage']=$baseurl.get_addon_config("baseconfig")['pyqimage']; $this->success('success',$ret); } ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") ![](https://img-blog.csdnimg.cn/2020122910434524.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM0MDUwMzYw,size_16,color_FFFFFF,t_70)![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")​编辑 ​