update: get subscribe url

This commit is contained in:
tokumeikoi
2022-05-09 23:26:59 +08:00
parent d74ab728fe
commit ed749f85ae
9 changed files with 19 additions and 31 deletions

View File

@ -103,14 +103,12 @@ class Helper
}
}
public static function getSubscribeHost()
public static function getSubscribeUrl($path)
{
$subscribeUrl = config('v2board.app_url');
$subscribeUrls = explode(',', config('v2board.subscribe_url'));
if ($subscribeUrls && $subscribeUrls[0]) {
$subscribeUrl = $subscribeUrls[rand(0, count($subscribeUrls) - 1)];
}
return $subscribeUrl;
$subscribeUrl = $subscribeUrls[rand(0, count($subscribeUrls) - 1)];
if ($subscribeUrl) return $subscribeUrl . $path;
return url($path);
}
public static function randomPort($range) {