mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-02-23 14:59:07 +08:00
use relative URL for route
function (fix #222)
This commit is contained in:
parent
479e1cbda3
commit
d13e1ba2af
@ -23,7 +23,7 @@ class UserMenuComposer
|
||||
public function compose(View $view)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$avatarUrl = route('avatar.texture', ['tid' => $user->avatar, 'size' => 36]);
|
||||
$avatarUrl = route('avatar.texture', ['tid' => $user->avatar, 'size' => 36], false);
|
||||
$avatar = $this->filter->apply('user_avatar', $avatarUrl, [$user]);
|
||||
$cli = $this->request->is('admin', 'admin/*');
|
||||
|
||||
|
@ -25,7 +25,7 @@ class UserPanelComposer
|
||||
{
|
||||
/** @var User */
|
||||
$user = auth()->user();
|
||||
$avatarUrl = route('avatar.texture', ['tid' => $user->avatar, 'size' => 45]);
|
||||
$avatarUrl = route('avatar.texture', ['tid' => $user->avatar, 'size' => 45], false);
|
||||
$avatar = $this->filter->apply('user_avatar', $avatarUrl, [$user]);
|
||||
|
||||
$badges = [];
|
||||
|
@ -19,7 +19,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
{{ report.tid }}
|
||||
<a href="{{ route('skinlib.show', {texture: report.tid}) }}" target="_blank">
|
||||
<a href="{{ route('skinlib.show', {texture: report.tid}, false) }}" target="_blank">
|
||||
<i class="fas fa-share"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
@ -9,7 +9,7 @@
|
||||
{{ trans('auth.oauth.authorization.introduction', {name: client.name}) }}
|
||||
</p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<form method="post" action="{{ route('passport.authorizations.approve') }}">
|
||||
<form method="post" action="{{ route('passport.authorizations.approve', {}, false) }}">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" name="state" value="{{ request.state }}">
|
||||
<input type="hidden" name="client_id" value="{{ client.id }}">
|
||||
@ -18,7 +18,7 @@
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="{{ route('passport.authorizations.deny') }}">
|
||||
<form method="post" action="{{ route('passport.authorizations.deny', {}, false) }}">
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('DELETE') }}
|
||||
<input type="hidden" name="state" value="{{ request.state }}">
|
||||
|
@ -9,8 +9,8 @@ class UserMenuComposerTest extends TestCase
|
||||
public function testAvatar()
|
||||
{
|
||||
$user = factory(User::class)->create(['avatar' => 5]);
|
||||
$this->actingAs($user)->get('/')->assertSee(url('/avatar/5?size=36'));
|
||||
$this->get('/skinlib')->assertSee(url('/avatar/5?size=36'));
|
||||
$this->get('/user')->assertSee(url('/avatar/5?size=36'));
|
||||
$this->actingAs($user)->get('/')->assertSee('/avatar/5?size=36');
|
||||
$this->get('/skinlib')->assertSee('/avatar/5?size=36');
|
||||
$this->get('/user')->assertSee('/avatar/5?size=36');
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ class UserPanelComposerTest extends TestCase
|
||||
$user = factory(User::class)->create();
|
||||
$this->actingAs($user);
|
||||
|
||||
$this->get('/user')->assertSee(url('/avatar/0?size=45'));
|
||||
$this->get('/user')->assertSee('/avatar/0?size=45');
|
||||
}
|
||||
|
||||
public function testBadges()
|
||||
|
Loading…
Reference in New Issue
Block a user