mirror of
https://github.com/v2board/v2board.git
synced 2025-06-16 06:37:53 +08:00
Refactor ConfigController to use ConfigService
This commit is contained in:
@ -110,9 +110,10 @@ class Helper
|
||||
|
||||
public static function getSubscribeUrl($token)
|
||||
{
|
||||
$path = config('v2board.subscribe_path', '/client/subscribe');
|
||||
$c = new \App\Services\ConfigService();
|
||||
$path = $c->get('site.subscribe_path');
|
||||
$path = "/api/v1{$path}?token={$token}";
|
||||
$subscribeUrls = explode(',', config('v2board.subscribe_url'));
|
||||
$subscribeUrls = explode(',', config('v2board.subscribe_url', '/client/subscribe'));
|
||||
$subscribeUrl = $subscribeUrls[rand(0, count($subscribeUrls) - 1)];
|
||||
if ($subscribeUrl) return $subscribeUrl . $path;
|
||||
return url($path);
|
||||
|
Reference in New Issue
Block a user