fix relative urls

This commit is contained in:
printempw 2016-08-28 22:15:26 +08:00
parent ca775a2809
commit f11070dcf0
3 changed files with 3 additions and 14 deletions

View File

@ -82,17 +82,6 @@ class Http
return self::getBaseUrl().$_SERVER["REQUEST_URI"];
}
/**
* Generate absolute url according to relative one
*
* @param string $relative
* @return string
*/
public static function urlTo($relative)
{
return Option::get('site_url').$relative;
}
public static function abort($code, $msg = "Something happened.", $is_json = false)
{
http_response_code((int)$code);

View File

@ -1,6 +1,6 @@
<div class="item" tid="{{ $texture['tid'] }}">
<div class="item-body">
<img src="{{ Http::urlTo('/preview/'.$texture['tid'].'.png') }}">
<img src="{{ url('preview/'.$texture['tid'].'.png') }}">
</div>
<div class="item-footer">
@ -9,7 +9,7 @@
</p>
@if (session()->has('uid'))
@if (Session::has('uid'))
@if ($user->closet->has($texture['tid']))
<a title="从衣柜中移除" class="more like liked" tid="{{ $texture['tid'] }}" href="javascript:removeFromCloset({{ $texture['tid'] }});" data-placement="top" data-toggle="tooltip"><i class="fa fa-heart"></i></a>

View File

@ -75,7 +75,7 @@
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li><a href="{{ Http::urlTo('/skinlib/upload') }}"><i class="fa fa-upload" aria-hidden="true"></i> 上传新皮肤</a></li>
<li><a href="{{ url('skinlib/upload') }}"><i class="fa fa-upload" aria-hidden="true"></i> 上传新皮肤</a></li>
@if (!is_null($user))
<!-- User Account Menu -->
<li class="dropdown user user-menu">