mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48:14 -05:00
fix: telegram机器人setwebhook接口url设置为站点网址,防止一些反向代理配置导致绑定机器人失败的问题
This commit is contained in:
parent
fe5e448dfb
commit
b0a504a44c
@ -51,7 +51,12 @@ class ConfigController extends Controller
|
|||||||
|
|
||||||
public function setTelegramWebhook(Request $request)
|
public function setTelegramWebhook(Request $request)
|
||||||
{
|
{
|
||||||
$hookUrl = url('/api/v1/guest/telegram/webhook?access_token=' . md5(admin_setting('telegram_bot_token', $request->input('telegram_bot_token'))));
|
// 判断站点网址
|
||||||
|
$app_url = admin_setting('app_url');
|
||||||
|
if(blank($app_url)) return $this->fail([422, '请先设置站点网址']);
|
||||||
|
$hookUrl = $app_url .'/api/v1/guest/telegram/webhook?' . http_build_query([
|
||||||
|
'access_token' => md5(admin_setting('telegram_bot_token', $request->input('telegram_bot_token')))
|
||||||
|
]);
|
||||||
$telegramService = new TelegramService($request->input('telegram_bot_token'));
|
$telegramService = new TelegramService($request->input('telegram_bot_token'));
|
||||||
$telegramService->getMe();
|
$telegramService->getMe();
|
||||||
$telegramService->setWebhook($hookUrl);
|
$telegramService->setWebhook($hookUrl);
|
||||||
|
Loading…
Reference in New Issue
Block a user