账号登录
This commit is contained in:
@@ -67,10 +67,10 @@ class AuthController extends BaseController
|
||||
try {
|
||||
$data = $request->all();
|
||||
|
||||
if(empty($data['feishu_code']) || empty($data['app_id'])){
|
||||
$data['login_type'] = $request->login_type;
|
||||
if($data['login_type'] == 'feishu' && (empty($data['feishu_code']) || empty($data['app_id']))){
|
||||
throw new BusinessException('参数错误');
|
||||
}
|
||||
|
||||
$result = (new AuthService())->login($data);
|
||||
return $this->success($result, '登录成功');
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\controller;
|
||||
|
||||
use app\common\model\CorpFeishuApp;
|
||||
use app\common\service\AuthService;
|
||||
use app\common\validate\UserValidate;
|
||||
use support\exception\BusinessException;
|
||||
use support\Request;
|
||||
|
||||
class PresetController extends BaseController
|
||||
{
|
||||
|
||||
/**
|
||||
* 不需要头信息的方法
|
||||
*/
|
||||
protected $noNeedHeaderData = ['corps'];
|
||||
|
||||
protected $noNeedLogin = ['corps'];
|
||||
|
||||
|
||||
// 调试
|
||||
public function corps(Request $request)
|
||||
{
|
||||
try {
|
||||
$fsAppInfo = CorpFeishuApp::where('status', 1)->select(['id','name','app_id'])->get();
|
||||
return $this->success($fsAppInfo);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user