更新目录结构
This commit is contained in:
37
app/controller/admin/auth/Index.php
Normal file
37
app/controller/admin/auth/Index.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\auth;
|
||||
|
||||
use app\controller\Base;
|
||||
use app\services\auth\AuthService;
|
||||
use app\services\SocialiteService;
|
||||
|
||||
class Index extends Base{
|
||||
|
||||
public function login(AuthService $service){
|
||||
try {
|
||||
$data = $service->login($this->request);
|
||||
$this->data['data'] = $data;
|
||||
} catch (\think\Exception $e) {
|
||||
$this->data['code'] = 0;
|
||||
$this->data['message'] = $e->getMessage();
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 第三方账号登录
|
||||
*/
|
||||
public function socialite(){
|
||||
//实例化第三方登录服务
|
||||
$service = new SocialiteService();
|
||||
|
||||
return $service->login();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user