ref; } if( data.use_actual_url == true ){ info.url = location.href; } if( data.error ){ console.error( '自定义微信分享: ', data.error ); } else if( data.appid ){ info.WXconfig = { swapTitleInWX: data.swapTitleInWX, appId: data.appid, timestamp: data.timestamp, nonceStr: data.nonceStr, signature: data.signature }; } setShareInfo( info ); } }; xhr.open( 'POST', url, true); xhr.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); xhr.send( formatPostData( formData ) ); } } new WX_Custom_Share().init();