我正在尝试在 Nuxt.js Vue 文件的 @apply 标签中使用 Tailwindcss <style> 指令。一切正常,但我不断收到一些烦人的红色波浪线。拜托了,伙计们,我需要帮助...谢谢!
顺晟科技
2021-06-16 10:56:13
319
首先需要设置您的安全域名,登录微信公众号-公众号设置-功能设置- JS接口安全域名,如图:
然后需要用到开发者身份和开发者密码以及设置互联网协议(互联网协议的缩写)白名单(ip白名单设置为服务器或虚拟主机的互联网协议(互联网协议的缩写)即可),登录微信公众号-基本配置-公众号开发信息,如图
首先把以下代码保存为服务器端编程语言(专业超文本预处理器的缩写)文件,命名为fenxiang.php
?服务器端编程语言(专业超文本预处理器的缩写)
//微信分享接口
//步骤1.设置应用编号和密钥
$ appid=//此处填写绑定的微信公众号的应用编号
$ appsecret=//此处填写绑定的微信公众号的密钥编号
//步骤2.生成签名的随机串
函数NonStr($ length){
$ str=' 0123456789 abcdefghijklmnopqrstuvwxyzabdefghijk 1 ngjbqrsthuvwxyz ';//随即串,62个字符
$ strlen=62
while($length $strlen){
$str .=$ str
$ strlen=62
}
$ str=str _ shuffle($ str);
返回substr($str,0,$ length);
}
//步骤3.获取access_token
$ result=http _ get(' https://API。微信。QQ。com/CGI-bin/token?grant _ type=client _ credentialpid=' .$appid .秘密=' .$ app secret);
$json=json_decode($result,true);
$ access _ token=$ JSON[' access _ token '];
函数http_get($url){
$ oCurl=curl _ init();
if(stripos($url,' https://')!==FALSE){
curl_setopt($oCurl,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($oCurl,CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($oCurl,CURLOPT _ SSLVERSION,1);//CURL _ SSLVERVERSION _ TLSV 1
}
curl_setopt($oCurl,CURLOPT_URL,$ URL);
curl_setopt($oCurl,CURLOPT _ RETURNTRANSFER,1);
$ SCO content=curl _ exec($ oCurl);
$ aStatus=curl _ getinfo($ oCurl);
curl _ close($ oCurl);
if(int val($ aStatus[' http _ code '])==200){
返回s内容
}else{
返回错误的
}
}
//步骤4.获取票
$ URL='https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi access _ token=$ access _ token ';
$ RES=JSON _ decode(http _ get($ URL));
$ ticket=$ RES-ticket;
//步骤5.生成wx.config需要的参数
$ surl=$ _ GET[' link '];
$ws=getWxConfig($ticket,$surl,time(),non estr(16));
函数getWxConfig($jsapiTicket,$myurl,$timestamp,$ non estr){
global $ appid
$ string=' jsapi _ ticket=$ JSapticket non estr=$ non estr timestamp=$ timestampur=$ my URL ';
$ signature=sha1($ string);
$ Wxconfig[' appid ']=$ appid;
$ Wxconfig[' non estr ']=$ non estr;
$ Wxconfig[' timestamp ']=$ timestamp;
$ Wxconfig[' URL ']=$ my URL;
$ Wxconfig[' signature ']=$ signature;
$ Wxconfig[' raw string ']=$ string;
返回$ WxConfig
}
echo JSON _ encode($ ws);
?
然后在需要分享的页面增加以下射流研究…代码,需要注意的是代码中全球资源定位器(统一资源定位符)参数的安全超文本传输协议和超文本传送协议(超文本传输协议的缩写)不要写错哦
!-微信分享-
脚本src=' https://RES . wx。QQ。com/open/js/jweixin-1。4 .0 .js '/脚本
脚本类型='text/javascript '
var URL=encodeURIComponent(位置。href。split(' # ')[0]);
$.ajax({
type: 'get ',
url: ' http://你的域名】/fenxiang.php?链接=' url,
dataType: 'json ',
contentType: '应用程序/JSON;charset=utf-8 ',
成功:函数(e) {
var d=e.appid,
i=即时间戳,
t=e .非波峰,
n=e。签名;
wx.config({
debug: 0,
appId: d,
timestamp: i,
noncrest :t,
签名北纬:度,
jsApiList: [
//以下3个接口即将作废,请尽快迁移。作废后删除这3个接口即可
' onMenuShareTimeline ',//【即将作废】分享到朋友圈
onMenuShareAppMessage ',//【即将作废】分享给朋友
onMenuShareQQ ',//【即将作废】分享到即时通信软件
//微信客户端6.7.2及JSSDK 1.4.0以上版本,旧版接口不可用,请使用下面3个新版接口。
updateAppMessageShareData ',//分享给朋友及分享到即时通信软件
updateTimelineShareData ',//分享到朋友圈及分享到即时通信软件空间
onMenuShareWeibo'//分享到微博
]
}),
wx.ready (function () {
//微信分享的数据
var shareData={
标题' : ' ',//分享标题
desc' : ' ',//分享描述
ImgUrl' : ' ',//共享显示的缩略图
链接' : ' ',//共享链接
success : function () {
提醒(“共享成功”);
}
};
wx.onMenuShareTimeline(共享数据);//旧界面[即将失效,失效后删除此界面]
wx.onMenuShareAppMessage(共享数据);//旧界面[即将失效,失效后删除此界面]
wx . OnMenuShareQQ(shareData);//旧界面[即将失效,失效后删除此界面]
wx . updateappmessagesharedata(shareData);//新界面
wx . updatetimelinesharedata(shareData);//新界面
wx . OnMenuShareWeibo(shareData);//新界面
});
wx.error(function(res){
alert好像有问题(’!');
});
}
});
/script
!-微信分享端-
你完了。分享一下。
29
2021-08
16
2021-06
16
2021-06
16
2021-06
16
2021-06
16
2021-06