更新
This commit is contained in:
@@ -9,13 +9,14 @@
|
||||
namespace app\controller\auth;
|
||||
|
||||
use app\controller\Base;
|
||||
use app\services\auth\LoginService;
|
||||
use app\services\auth\AuthService;
|
||||
use app\services\SocialiteService;
|
||||
|
||||
class Index extends Base{
|
||||
|
||||
public function login(LoginService $service){
|
||||
public function login(AuthService $service){
|
||||
try {
|
||||
$data = $service->authLogin($this->request);
|
||||
$data = $service->login($this->request);
|
||||
$this->data['data'] = $data;
|
||||
} catch (\think\Exception $e) {
|
||||
$this->data['code'] = 0;
|
||||
@@ -23,4 +24,14 @@ class Index extends Base{
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 第三方账号登录
|
||||
*/
|
||||
public function socialite(){
|
||||
//实例化第三方登录服务
|
||||
$service = new SocialiteService();
|
||||
|
||||
return $service->login();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user