update: set default url to app url

This commit is contained in:
tokumeikoi 2022-04-10 14:43:25 +08:00
parent 9dfe44bf82
commit 447ff0f554
2 changed files with 4 additions and 4 deletions

View File

@ -54,12 +54,12 @@ class ConfigController extends Controller
public function setTelegramWebhook(Request $request) public function setTelegramWebhook(Request $request)
{ {
$appUrl = config('v2board.app_url');
if (!$appUrl) abort(500, '请先配置正确的站点地址');
$telegramService = new TelegramService($request->input('telegram_bot_token')); $telegramService = new TelegramService($request->input('telegram_bot_token'));
$telegramService->getMe(); $telegramService->getMe();
$telegramService->setWebhook( $telegramService->setWebhook(
url( $appUrl . '/api/v1/guest/telegram/webhook?access_token=' . md5(config('v2board.telegram_bot_token', $request->input('telegram_bot_token')))
'/api/v1/guest/telegram/webhook?access_token=' . md5(config('v2board.telegram_bot_token', $request->input('telegram_bot_token')))
)
); );
return response([ return response([
'data' => true 'data' => true

View File

@ -26,7 +26,7 @@ class PaymentController extends Controller
{ {
$payments = Payment::all(); $payments = Payment::all();
foreach ($payments as $k => $v) { foreach ($payments as $k => $v) {
$notifyUrl = url("/api/v1/guest/payment/notify/{$v->payment}/{$v->uuid}"); $notifyUrl = config('v2board.app_url') . "/api/v1/guest/payment/notify/{$v->payment}/{$v->uuid}";
if ($v->notify_domain) { if ($v->notify_domain) {
$parseUrl = parse_url($notifyUrl); $parseUrl = parse_url($notifyUrl);
$notifyUrl = $v->notify_domain . $parseUrl['path']; $notifyUrl = $v->notify_domain . $parseUrl['path'];