Skip to content

Commit

Permalink
php>7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pl1998 committed Mar 9, 2021
1 parent 83726d8 commit 0ec47e3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ composer.lock
.php_cs.cache
test.php
test
src/Handle/AlipayOauth.php
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
Expand Down
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


## 兼容
> * 支持php >=7.0
> * 支持php >=7.2
> 兼容laravel*

Expand All @@ -24,19 +24,18 @@
## 目前支持第三方登录


* 1.QQ(app/h5/web).
* 2.微信(web扫码).
* 3.微博(app/h5/web.
* 4.支付宝(web/h5/app).
* 5.小米(web/h5).
* 6.抖音.
* 7.世纪互联(微软).
* 8.微软.
* 9.gitee.
* 10.github.
* 11.gitlab.
* 12.google(有墙).
* 13 line.
* 1.QQ(app/h5/web)
* 2.微信(web扫码)
* 3.微博(app/h5/web)
* 4.小米(web/h5)
* 5.抖音
* 6.世纪互联(微软)
* 7.微软
* 8.gitee
* 9.github
* 10.gitlab
* 11.google(有墙)
* 12.line

## 安装

Expand All @@ -58,7 +57,6 @@ $ composer require pltrue/thirdparty_oauth
| 日期 | 更新级别 | 更新内容 | 贡献者 | 当前状态 |
| ------| -------- | --------- | ---- | ---- |
| 2020-12-06| fix 、feat | 新增`Microsoft`登录 修复微信、QQ的bug | [742481030](https://github.com/742481030) | 已合并到master分支 |
| 2020-12-07| feat | 新增`支付宝`登录 | [742481030](https://github.com/742481030) | 已合并到master分支 |
| 2020-12-08| feat | 新增`小米账户`登录 | [742481030](https://github.com/742481030) | 已合并到master分支 |
| 2020-12-09| feat | 新增`google账户`登录 | [742481030](https://github.com/742481030) | 已合并到master分支 |
| 2020-12-10| feat | 新增`华为账户`登录 | [742481030](https://github.com/742481030) | 已合并到master分支 |
Expand Down Expand Up @@ -88,12 +86,10 @@ $ composer require pltrue/thirdparty_oauth
* [微博应用创建地址](https://open.weibo.com/)
* [microcoft应用创建地址](https://azure.com/)
* [QQ互联创建地址](https://connect.qq.com/index.html)
* [支付宝应用](https://open.alipay.com/platform/home.htm?from=wwwalipay)
* [小米应用](https://dev.mi.com/console/)
* [google应用](https://console.developers.google.com)
* [京东应用](https://jos.jd.com/)



##### 参数说明

Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
}
],
"require": {
"guzzlehttp/guzzle": "~6.0",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "~6"
"guzzlehttp/guzzle": "6.3.1|^7.0.1"
},
"autoload": {
"psr-4": {
Expand Down
15 changes: 1 addition & 14 deletions src/Api/SocialiteApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Pl1998\ThirdpartyOauth\Api;

use Pl1998\ThirdpartyOauth\Handle\AlipayOauth;
use Pl1998\ThirdpartyOauth\Handle\GiteeOauth;
use Pl1998\ThirdpartyOauth\Handle\Line;
use Pl1998\ThirdpartyOauth\Handle\QqOauth;
Expand All @@ -36,9 +35,6 @@ public function __construct($deiver, array $config)
{
$this->deliver = $deiver;
switch ($deiver) {
case 'alipay':
return $this->api = new AlipayOauth($config);
break;
case 'jd':
return $this->api = new JdOauth($config);
break;
Expand Down Expand Up @@ -101,17 +97,8 @@ public function getUserInfo(): object

if ('weixin' == $this->deliver) {
return $this->api->getUserInfo(json_decode($oauth, true));
}
/*elseif ('microsoft' == $this->deliver) {
$access_token = Helpers::getAccessToken($this->deliver, $oauth['$access_token']);
$userinfo = $this->api->getUserInfo($access_token);
$userinfo->unionid = $oauth['unionid'];
//$userinfo->openid=$oauth['sub'];
return $userinfo;
} */
else {
} else {
$access_token = Helpers::getAccessToken($this->deliver, $oauth);

return $this->api->getUserInfo($access_token);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/SocialiteAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SocialiteAuth implements Socialite
* @var string[]
*/
private static $deiver = ['gitee', 'github', 'weibo', 'gitlab',
'qq', 'weixin', 'microsoft', 'alipay', 'xiaomi', 'google',
'qq', 'weixin', 'microsoft', 'xiaomi', 'google',
'huawei', 'douyin', 'line', 'qqapp', 'alipayapp', 'jd', ];

/**
Expand Down

0 comments on commit 0ec47e3

Please sign in to comment.