获取飞书配置

This commit is contained in:
2025-03-22 11:59:23 +08:00
parent d122c1936a
commit ef03474254
4 changed files with 27 additions and 2 deletions
+22
View File
@@ -19,6 +19,28 @@ class FeishuController
*/
protected $noNeedLogin = ['auth', 'send', 'show'];
/**
* 获取应用信息
* @return \support\Response
*/
public function getinfo(Request $request)
{
$config = Util::getParam($request, 'config');
if (Util::isEmpty($config)) {
$config = $this->config;
}
// 获取凭证
$certificate = config($config);
$arr = [
'app_id' => $certificate['appId'],
'redirect_uri' => $certificate['rUrl'],
'scope' => $certificate['scope'],
'state' => $certificate['state'].'_'. $request->user['id']
];
return Util::success($arr,trans('success'));
}
/**
* 获取飞书code
* @return \support\Response
+2
View File
@@ -2,6 +2,7 @@
namespace app\controller;
use app\model\FeishuUser;
use app\model\User;
use app\service\MailService;
use app\util\JwtUtil;
@@ -58,6 +59,7 @@ class UserController
$result = $user;
unset($result['password']);
$result['token'] = $token;
$result['feishu_openid'] = FeishuUser::where('id', $userId)->value('openid');
if (Util::isEmpty($language)) {
User::where('id', $userId)
+2 -2
View File
@@ -4,7 +4,7 @@ return [
'xinyouhe' => [
'appId' => "cli_a73e1e6406fa501c",
'appSecret' => "9cMfxujjGG9JPmNfNcOwUdCoIXqaM1wY",
'rUrl' => "http://219.157.255.213:9007/feishu/auth",
'rUrl' => "http://219.157.255.213:25321/feishu/auth",
'scope' => "contact:user.base:readonly contact:contact.base:readonly contact:user.employee_id:readonly im:message:send_as_bot",
'state' => "xinyouhe",
'baseUri' => "https://open.feishu.cn/open-apis/"
@@ -12,7 +12,7 @@ return [
'mbaf' => [
'appId' => "cli_a75839fb4ff85028",
'appSecret' => "VsqLvwsRzpmisBVbrTIuKdNCvRCO447d",
'rUrl' => "http://219.157.255.213:9007/feishu/auth",
'rUrl' => "http://219.157.255.213:25321/feishu/auth",
'scope' => "contact:user.base:readonly contact:contact.base:readonly contact:user.employee_id:readonly im:message:send_as_bot",
'state' => "mbaf",
'baseUri' => "https://open.larksuite.com/open-apis/"
+1
View File
@@ -28,6 +28,7 @@ Route::any('/upload', [app\controller\UploadController::class, 'uploadImage'])->
// 飞书
Route::post('/feishu/getinfo', [app\controller\FeishuController::class, 'getinfo']);
Route::post('/feishu/auth', [app\controller\FeishuController::class, 'auth']);
Route::post('/feishu/getAuth', [app\controller\FeishuController::class, 'getAuth']);
Route::post('/feishu/show', [app\controller\FeishuController::class, 'show']);