Remove get_base_url function
This commit is contained in:
parent
09b9959bc8
commit
6da5094cb4
|
|
@ -5,24 +5,11 @@ use App\Models\User;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
if (! function_exists('get_base_url')) {
|
|
||||||
function get_base_url()
|
|
||||||
{
|
|
||||||
$base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
|
|
||||||
$base_url .= $_SERVER['SERVER_NAME'];
|
|
||||||
$base_url .= ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'.$_SERVER['SERVER_PORT']);
|
|
||||||
|
|
||||||
return $base_url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! function_exists('webpack_assets')) {
|
if (! function_exists('webpack_assets')) {
|
||||||
function webpack_assets($relativeUri)
|
function webpack_assets($relativeUri)
|
||||||
{
|
{
|
||||||
if (app()->environment('development')) {
|
if (app()->environment('development')) {
|
||||||
// @codeCoverageIgnoreStart
|
return "http://127.0.0.1:8080/$relativeUri"; // @codeCoverageIgnore
|
||||||
return "http://127.0.0.1:8080/$relativeUri";
|
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
} else {
|
} else {
|
||||||
$path = app('webpack')->$relativeUri;
|
$path = app('webpack')->$relativeUri;
|
||||||
$cdn = option('cdn_address');
|
$cdn = option('cdn_address');
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
{!! get_string_replaced(option('comment_script'), [
|
{!! get_string_replaced(option('comment_script'), [
|
||||||
'{tid}' => $texture->tid,
|
'{tid}' => $texture->tid,
|
||||||
'{name}' => $texture->name,
|
'{name}' => $texture->name,
|
||||||
'{url}' => get_base_url().$_SERVER['REQUEST_URI']
|
'{url}' => request()->url()
|
||||||
]) !!}
|
]) !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user