From 7dc8d59aa3a5ec22849b1ce342183761acec1a9c Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 17 Mar 2018 10:46:27 +0800 Subject: [PATCH 01/10] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=8F=9C=E5=8D=95=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/theme/css/console.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/static/theme/css/console.css b/static/theme/css/console.css index d357367b6..38790ed71 100644 --- a/static/theme/css/console.css +++ b/static/theme/css/console.css @@ -106,8 +106,6 @@ input[type=checkbox]:focus,input[type=radio]:focus{outline:none} .mobile-footer .sub-menu ul li{padding:0;display:block;width:100%;float:none;z-index:11} .mobile-footer .sub-menu ul li a{border:1px solid #fff} .mobile-footer .sub-menu ul li a.bottom-border{border-bottom:1px solid #e7e7eb} -.mobile-footer .sub-menu ul li:nth-last-child(2) a{border-bottom-color:#fff;} -.mobile-footer .sub-menu ul li:last-child a{border-top-color:#e7e7eb} .mobile-footer .arrow{position:absolute;left:50%;margin-left:-6px} .mobile-footer .arrow_in,.mobile-footer .arrow_out{z-index:10;width:0;height:0;display:inline-block;border-width:6px;border-style:dashed;border-color:transparent;border-bottom-width:0;border-top-style:solid} .mobile-footer .arrow_in{bottom:-5px;border-top-color:#fafafa}.mobile-footer .arrow_out{bottom:-6px;border-top-color:#d0d0d0} From 08e2dde019482e13c3761caaaaceceb6d10524e5 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 17 Mar 2018 11:17:20 +0800 Subject: [PATCH 02/10] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=88=E6=9D=83=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/WechatService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extend/service/WechatService.php b/extend/service/WechatService.php index a0589e1ac..2690a23ad 100644 --- a/extend/service/WechatService.php +++ b/extend/service/WechatService.php @@ -79,8 +79,8 @@ class WechatService } $service = self::instance('wechat'); $result = $service->oauth(session_id(), request()->url(true), $fullMode); - session("{$appid}_openid", $result['openid']); - session("{$appid}_fansinfo", $result['fans']); + session("{$appid}_openid", $openid = $result['openid']); + session("{$appid}_fansinfo", $fansinfo = $result['fans']); if ((empty($fullMode) && !empty($openid)) || (!empty($fullMode) && !empty($fansinfo))) { empty($fansinfo) || FansService::set($fansinfo); return ['openid' => $openid, 'fansinfo' => $fansinfo]; From 7082e96157a9e0f088302d99704a213f1ee5a6f7 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 17 Mar 2018 11:57:35 +0800 Subject: [PATCH 03/10] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/api/Tools.php | 39 ++++++++++++ application/wechat/view/api/tools/oauth.html | 66 ++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 application/wechat/controller/api/Tools.php create mode 100644 application/wechat/view/api/tools/oauth.html diff --git a/application/wechat/controller/api/Tools.php b/application/wechat/controller/api/Tools.php new file mode 100644 index 000000000..a599ec77c --- /dev/null +++ b/application/wechat/controller/api/Tools.php @@ -0,0 +1,39 @@ +fetch('', ['fans' => $fans]); + } + +} \ No newline at end of file diff --git a/application/wechat/view/api/tools/oauth.html b/application/wechat/view/api/tools/oauth.html new file mode 100644 index 000000000..5801da448 --- /dev/null +++ b/application/wechat/view/api/tools/oauth.html @@ -0,0 +1,66 @@ + + + + + 微信网页授权测试 + + + + + + + + + + +
+
+
+

操作失败

+

通过网页授权获取用户资料失败,请检查权限再试!

+
+ +
+ +
+ +

{$fans.fansinfo.nickname}

+
+
用户标识
+
+
+
OPENID
+
{$fans.fansinfo.openid}
+
+
+
UNIONID
+
{$fans.fansinfo.unionid}
+
+
+
详细资料
+
+
+
性别
+
{:[1=>'男',2=>'女'][$fans.fansinfo.sex]??'未知'}
+
+
+
系统语言
+
{$fans.fansinfo.language}
+
+
+
所在区域
+
{$fans.fansinfo.country}{$fans.fansinfo.province}{$fans.fansinfo.city}
+
+ {if isset($fans.fansinfo.privilege.0)} +
+
设备网络
+
{$fans.fansinfo.privilege.0}
+
+ {/if} +
+ + \ No newline at end of file From 677953dbc296f771a0913914ec2b4e1f7af3f426 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 17 Mar 2018 12:12:00 +0800 Subject: [PATCH 04/10] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/api/Tools.php | 13 +++++- application/wechat/view/api/tools/jssdk.html | 42 ++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 application/wechat/view/api/tools/jssdk.html diff --git a/application/wechat/controller/api/Tools.php b/application/wechat/controller/api/Tools.php index a599ec77c..f24686f11 100644 --- a/application/wechat/controller/api/Tools.php +++ b/application/wechat/controller/api/Tools.php @@ -26,7 +26,7 @@ class Tools extends BasicAdmin { /** * 网页授权测试 - * @return mixed + * @return string * @throws \think\Exception * @throws \think\exception\PDOException */ @@ -36,4 +36,15 @@ class Tools extends BasicAdmin return $this->fetch('', ['fans' => $fans]); } + /** + * JSSDK测试 + * @return string + */ + public function jssdk() + { + $wechat = WechatService::wechat(); + $options = $wechat->jsSign($this->request->url(true)); + return $this->fetch('', ['options' => $options]); + } + } \ No newline at end of file diff --git a/application/wechat/view/api/tools/jssdk.html b/application/wechat/view/api/tools/jssdk.html new file mode 100644 index 000000000..461e99364 --- /dev/null +++ b/application/wechat/view/api/tools/jssdk.html @@ -0,0 +1,42 @@ + + + + JSSDK签名验证测试 + + + + + + + + + + + +
+

JSSDK 功能测试

+
+ +
+ 调起摄像头扫码 +
+ + + + + From c8c51d088b61bf6a21a8871a5bbda662ff5c84c7 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 17 Mar 2018 12:13:52 +0800 Subject: [PATCH 05/10] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/view/api/tools/jssdk.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/wechat/view/api/tools/jssdk.html b/application/wechat/view/api/tools/jssdk.html index 461e99364..d566cd787 100644 --- a/application/wechat/view/api/tools/jssdk.html +++ b/application/wechat/view/api/tools/jssdk.html @@ -23,7 +23,7 @@