ѡ̳

 找回密码
 ע
搜索
查看: 61|回复: 1
打印 上一主题 下一主题

20180607 处理支付和第三方登录。

[复制链接]

789

主题

1158

帖子

4197

积分

Ա

Rank: 9Rank: 9Rank: 9

积分
4197
跳转到指定楼层
¥
发表于 2018-6-7 15:37:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
预计两天时间完成。也就是这周。 增加oa系统的邮箱。
回复

使用道具 举报

789

主题

1158

帖子

4197

积分

Ա

Rank: 9Rank: 9Rank: 9

积分
4197
ɳ
 楼主| 发表于 2018-6-7 16:10:04 | 只看该作者
第三方登陆--QQ登陆
/member/login.php?lang=cn&a=doother&type=qq

        public function doother() {
                global $_M;
                $other = $this->other($_M['form']['type']);
                $other->set_state();
                $url = $other->get_login_url();
                okinfo($url);
        }
public function other($type) {
   global $_M;
   if(!$type){
      okinfo($_M['url']['login'], $_M['word']['membererror4']);
   }
   if($type == 'qq'){
      $other = load::mod_class('user/web/class/qq', 'new');
   }
   if($type == 'weibo'){
      $other = load::mod_class('user/web/class/weibo', 'new');
   }
   if($type == 'weixin'){
      $other = load::mod_class('user/web/class/weixin', 'new');
   }
   return $other;
}
public function set_state(){
   load::sys_class('session', 'new')->set('other_state', random(10));
}
public function get_login_url(){
   global $_M;

   $redirect_uri = $_M['url']['site'].'member/login.php?a=doother_login&type=qq';
   $url .= "https://graph.qq.com/oauth2.0/authorize?";
   $url .= "client_id={$this->appid}";
   $url .= "&redirect_uri=".urlencode($redirect_uri);
   $url .= "&response_type=code";
   $url .= "&scope=get_user_info";   
   $url .= "&state=".$this->get_state();  
   return $url;
}


回复

使用道具 举报

您需要登录后才可以回帖 登录 | ע

本版积分规则

QQ|Archiver|ֻ|С|ѡ̳

GMT+8, 2026-5-2 06:25 , Processed in 0.078481 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表
0.0916s