mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: new feature
This commit is contained in:
parent
1adb1bcfa0
commit
ebf98d42a8
@ -68,7 +68,7 @@ class UserController extends Controller
|
||||
$res[$i]['plan_name'] = $plan[$k]['name'];
|
||||
}
|
||||
}
|
||||
$res[$i]['subscribe_url'] = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $res[$i]['token'];
|
||||
$res[$i]['subscribe_url'] = Helper::getSubscribeHost() . '/api/v1/client/subscribe?token=' . $res[$i]['token'];
|
||||
}
|
||||
return response([
|
||||
'data' => $res,
|
||||
|
@ -118,12 +118,7 @@ class UserController extends Controller
|
||||
abort(500, __('Subscription plan does not exist'));
|
||||
}
|
||||
}
|
||||
$subscribeUrl = config('v2board.app_url');
|
||||
$subscribeUrls = explode(',', config('v2board.subscribe_url'));
|
||||
if ($subscribeUrls && $subscribeUrls[0]) {
|
||||
$subscribeUrl = $subscribeUrls[rand(0, count($subscribeUrls) - 1)];
|
||||
}
|
||||
$user['subscribe_url'] = "{$subscribeUrl}/api/v1/client/subscribe?token={$user['token']}";
|
||||
$user['subscribe_url'] = Helper::getSubscribeHost() . "/api/v1/client/subscribe?token={$user['token']}";
|
||||
$user['reset_day'] = $this->getResetDay($user);
|
||||
return response([
|
||||
'data' => $user
|
||||
|
@ -95,4 +95,14 @@ class Helper
|
||||
return round($byte, 2) . ' B';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSubscribeHost()
|
||||
{
|
||||
$subscribeUrl = config('v2board.app_url');
|
||||
$subscribeUrls = explode(',', config('v2board.subscribe_url'));
|
||||
if ($subscribeUrls && $subscribeUrls[0]) {
|
||||
$subscribeUrl = $subscribeUrls[rand(0, count($subscribeUrls) - 1)];
|
||||
}
|
||||
return $subscribeUrl;
|
||||
}
|
||||
}
|
||||
|
2
public/assets/admin/umi.css
vendored
2
public/assets/admin/umi.css
vendored
File diff suppressed because one or more lines are too long
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user