update: fix default app_url with subscribe_url

This commit is contained in:
tokumeikoi 2021-07-30 23:53:37 +09:00
parent bb8da6e2c5
commit 1adb1bcfa0

View File

@ -118,9 +118,9 @@ class UserController extends Controller
abort(500, __('Subscription plan does not exist'));
}
}
$subscribeUrl = config('v2board.app_url', env('APP_URL'));
$subscribeUrl = config('v2board.app_url');
$subscribeUrls = explode(',', config('v2board.subscribe_url'));
if ($subscribeUrls) {
if ($subscribeUrls && $subscribeUrls[0]) {
$subscribeUrl = $subscribeUrls[rand(0, count($subscribeUrls) - 1)];
}
$user['subscribe_url'] = "{$subscribeUrl}/api/v1/client/subscribe?token={$user['token']}";