切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
jinglong
6 years ago
提交
7990ca767548e103f1cd194bfa97a53bc3800cbc
1 个父辈
c9bc130f
1 个管道 的构建
通过
耗费 0 秒
分享
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
20 行增加
和
20 行删除
app/portal/controller/LoginController.php
public/themes/simpleboot3_mobile/portal/login/wx_share.html
app/portal/controller/LoginController.php
查看文件 @
7990ca7
...
...
@@ -523,25 +523,25 @@ class LoginController extends HomeBaseController
//获取微信分享配置信息
public
function
wxShare
(
$url
=
''
){
// $jsapiTicket = $this->getSignature();
// // 注意 URL 一定要动态获取,不能 hardcode.
// $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
// if($url === '') {
// $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
// }
// $timestamp = time();
// $nonceStr = $this->createNonceStr();
// $string = 'jsapi_ticket='.$jsapiTicket.'&noncestr='.$nonceStr.'×tamp='.$timestamp.'&url='.$url;
// $signature = sha1($string);
// $data = [
// "appId" => $this->appkey2,
// "nonceStr" => $nonceStr,
// "timestamp" => $timestamp,
// "url" => $url,
// "signature" => $signature,
// "rawString" => $string
// ];
// $this->assign('data',$data);
$jsapiTicket
=
$this
->
getSignature
();
// 注意 URL 一定要动态获取,不能 hardcode.
$protocol
=
(
!
empty
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
!==
'off'
||
$_SERVER
[
'SERVER_PORT'
]
==
443
)
?
"https://"
:
"http://"
;
if
(
$url
===
''
)
{
$url
=
"
$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]
"
;
}
$timestamp
=
time
();
$nonceStr
=
$this
->
createNonceStr
();
$string
=
'jsapi_ticket='
.
$jsapiTicket
.
'&noncestr='
.
$nonceStr
.
'×tamp='
.
$timestamp
.
'&url='
.
$url
;
$signature
=
sha1
(
$string
);
$data
=
[
"appId"
=>
$this
->
appkey2
,
"nonceStr"
=>
$nonceStr
,
"timestamp"
=>
$timestamp
,
"url"
=>
$url
,
"signature"
=>
$signature
,
"rawString"
=>
$string
];
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
();
}
...
...
public/themes/simpleboot3_mobile/portal/login/wx_share.html
查看文件 @
7990ca7
...
...
@@ -31,7 +31,7 @@
title
:
'分享标题'
,
// 分享标题
desc
:
'分享描述'
,
// 分享描述
link
:
'http://www.starplanet.cn/portal/enjoy/getEnjoyDetail?id=81'
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
'
https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562352770741&di=353c660582a6727a64cdfdc93c4fb0f0&imgtype=0&src=http%3A%2F%2Fpic.k73.com%2Fup%2Fsoft%2F2016%2F0102%2F092635_44907394.jpg
'
,
// 分享图标
imgUrl
:
''
,
// 分享图标
success
:
function
(
e
)
{
// 设置成功
alert
(
'分享朋友'
);
...
...
请
注册
或
登录
后发表评论