Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOOD
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
whb
10 years ago
Commit
f5f31eeb7877f46a5fb834b9cd8e836b265d40bb
1 parent
d58cc1e1
测试bug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
1 deletions
website/lib/wechat/JSSDK.class.php
website/lib/wechat/JSSDK.class.php
View file @
f5f31ee
...
...
@@ -10,7 +10,6 @@ class Lib_Wechat_JSSDK {
// 注意 URL 一定要动态获取,不能 hardcode.
$protocol
=
(
!
empty
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
!==
'off'
||
$_SERVER
[
'SERVER_PORT'
]
==
443
)
?
"https://"
:
"http://"
;
$url
=
"
$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]
"
;
echo
$url
;
// 确保你获取用来签名的url是动态获取的,动态页面可参见实例代码中php的实现方式。如果是html的静态页面在前端通过ajax将url传到后台签名,前端需要用js获取当前页面除去'#'hash部分的链接(可用location.href.split('#')[0]获取),因为页面一旦分享,微信客户端会在你的链接末尾加入其它参数,如果不是动态获取当前链接,将导致分享后的页面签名失败。
$timestamp
=
time
();
$nonceStr
=
self
::
createNonceStr
();
...
...
Please
register
or
login
to post a comment