切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
ac633f7388f622245ef4f093d16863e0b4a2cebc
1 个父辈
9e14497c
1 个管道 的构建
通过
耗费 11 秒
调试手机微信登录
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
20 行增加
和
12 行删除
app/portal/controller/LoginController.php
public/themes/simpleboot3_mobile/portal/login/login.html
simplewind/cmf/controller/HomeBaseController.php
app/portal/controller/LoginController.php
查看文件 @
ac633f7
...
...
@@ -405,17 +405,20 @@ class LoginController extends HomeBaseController
//第三方微信移动端网页登录
public
function
wx_login_mobile
(){
$url
=
'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='
.
$this
->
appkey2
.
'&secret='
.
$this
->
appsecret2
;
$code
=
$this
->
request
->
get
(
'code'
);
var_dump
(
$code
);
exit
;
$url
=
'https://api.weixin.qq.com/sns/oauth2/access_token?appid='
.
$this
->
appkey1
.
'&secret='
.
$this
->
appsecret1
.
'&code='
.
$code
.
'&grant_type=authorization_code'
;
$res
=
$this
->
http_get
(
$url
);
$json_arr
=
json_decode
(
$res
,
true
);
if
(
!
isset
(
$json_arr
[
'access_token'
])
&&
empty
(
$json_arr
[
'access_token'
])){
//用户取消登录
$this
->
redirect
(
'/portal/login/thirdLogin'
);
}
$token
=
$json_arr
[
'access_token'
];
$openid
=
'oYOYl5hbULoKimG5R8Uk-Paha0d8'
;
$openid
=
$json_arr
[
'openid'
]
;
//通过access_token获取用户信息
$url1
=
'https://api.weixin.qq.com/
cgi-bin/user/info?access_token='
.
$token
.
'&openid='
.
$openid
.
'&lang=zh_CN'
;
$url1
=
'https://api.weixin.qq.com/
sns/userinfo?access_token='
.
$token
.
'&openid='
.
$openid
;
$res1
=
$this
->
http_get
(
$url1
);
$info
=
json_decode
(
$res1
,
true
);
var_dump
(
$info
);
exit
;
...
...
public/themes/simpleboot3_mobile/portal/login/login.html
查看文件 @
ac633f7
...
...
@@ -43,14 +43,16 @@
</div>
<div
class=
"index_tenth_seconds"
>
<div
class=
"index_tenth_second"
>
<div
class=
"index_tenth_second_one"
>
<div
class=
"index_tenth_second_img"
id=
"wx_login"
>
<img
src=
"__TMPL__/public/assets/images/cicon_71@2x.png"
alt=
""
/>
</div>
<div
class=
"index_tenth_second_title"
>
微信登录
<a
href=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3f1a38ee1e74f2bc&redirect_uri=http://www.starplanet.cn/portal/login/wx_login_mobile&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
>
<div
class=
"index_tenth_second_one"
>
<div
class=
"index_tenth_second_img"
>
<img
src=
"__TMPL__/public/assets/images/cicon_71@2x.png"
alt=
""
/>
</div>
<div
class=
"index_tenth_second_title"
>
微信登录
</div>
</div>
</
div
>
</
a
>
<form
action=
"https://api.weibo.com/oauth2/authorize"
method=
"POST"
id=
"wb_form"
>
<div
class=
"index_tenth_second_one"
>
...
...
simplewind/cmf/controller/HomeBaseController.php
查看文件 @
ac633f7
...
...
@@ -28,8 +28,11 @@ class HomeBaseController extends BaseController
public
$appkey1
=
'wx9cfa880272f186bf'
;
//微信开放平台appkey
public
$appsecret1
=
'11b643393b1e54d6ef5eaa984ba4e545'
;
//微信开放平台appsecret
public
$appkey2
=
'wx0bd7bc2aa0f332d6'
;
//微信公众号appkey
public
$appsecret2
=
'b62e49f48f48de7b7fff2ea0af3939de'
;
//微信公众号appsecret
public
$appkey2
=
'wx0bd7bc2aa0f332d6'
;
//微信公众订阅号appkey
public
$appsecret2
=
'b62e49f48f48de7b7fff2ea0af3939de'
;
//微信公众订阅号appsecret
public
$appkey3
=
'wx3f1a38ee1e74f2bc'
;
//微信公众服务号appkey
public
$appsecret3
=
'87f9c080450979db7d6a5e296529b577'
;
//微信公众服务号appsecret
protected
function
initialize
()
{
...
...
请
注册
或
登录
后发表评论