作者 景龙
1 个管道 的构建 通过 耗费 0 秒

调式移动微信登录

@@ -24,8 +24,11 @@ class LoginController extends HomeBaseController @@ -24,8 +24,11 @@ class LoginController extends HomeBaseController
24 private $appsecret = 'd80b43a1e74e8ba095590b36a3459480';//微博appsecret 24 private $appsecret = 'd80b43a1e74e8ba095590b36a3459480';//微博appsecret
25 private $redirect_uri = 'http://www.starplanet.cn/portal/login/wb_login';//回调地址 25 private $redirect_uri = 'http://www.starplanet.cn/portal/login/wb_login';//回调地址
26 26
27 - private $appkey1 = 'wx9cfa880272f186bf';//微信appkey  
28 - private $appsecret1 = '11b643393b1e54d6ef5eaa984ba4e545';//微信appsecret 27 + private $appkey1 = 'wx9cfa880272f186bf';//微信开放平台appkey
  28 + private $appsecret1 = '11b643393b1e54d6ef5eaa984ba4e545';//微信开放平台appsecret
  29 +
  30 + private $appkey2 = 'wx0bd7bc2aa0f332d6';//微信公众号appkey
  31 + private $appsecret2 = 'b62e49f48f48de7b7fff2ea0af3939de';//微信公众号appsecret
29 //登录页面 32 //登录页面
30 public function login(){ 33 public function login(){
31 return $this->fetch(); 34 return $this->fetch();
@@ -410,7 +413,10 @@ class LoginController extends HomeBaseController @@ -410,7 +413,10 @@ class LoginController extends HomeBaseController
410 413
411 //第三方微信移动端网页登录 414 //第三方微信移动端网页登录
412 public function wx_login_mobile(){ 415 public function wx_login_mobile(){
413 - 416 + $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$this->appkey2.'&secret='.$this->appsecret2;
  417 + $res = $this->http_get($url);
  418 + $json_arr = json_decode($res,true);
  419 + var_dump($json_arr);exit;
414 } 420 }
415 421
416 //第三方微博登录 422 //第三方微博登录
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 <div class="index_tenth_seconds"> 44 <div class="index_tenth_seconds">
45 <div class="index_tenth_second"> 45 <div class="index_tenth_second">
46 <div class="index_tenth_second_one"> 46 <div class="index_tenth_second_one">
47 - <div class="index_tenth_second_img" id="login"> 47 + <div class="index_tenth_second_img" id="wx_login">
48 <img src="__TMPL__/public/assets/images/cicon_71@2x.png" alt="" /> 48 <img src="__TMPL__/public/assets/images/cicon_71@2x.png" alt="" />
49 </div> 49 </div>
50 <div class="index_tenth_second_title"> 50 <div class="index_tenth_second_title">
@@ -266,6 +266,11 @@ $(function() { @@ -266,6 +266,11 @@ $(function() {
266 $('#wb_login').click(function(){ 266 $('#wb_login').click(function(){
267 $('#wb_form').submit(); 267 $('#wb_form').submit();
268 }); 268 });
  269 +
  270 + //微信登录
  271 + $('#wx_login').click(function(){
  272 + window.location.href = '/portal/login/wx_login_mobile';
  273 + });
269 }); 274 });
270 //第三方分享 275 //第三方分享
271 function thirdShare(url){ 276 function thirdShare(url){