make raw skin downloading more convenient
This commit is contained in:
parent
320a11023f
commit
acfc7c4478
|
|
@ -90,6 +90,16 @@ class TextureController extends BaseController
|
|||
$this->preview($tid, $size);
|
||||
}
|
||||
|
||||
public function raw($tid) {
|
||||
if ($t = Texture::find($tid)) {
|
||||
header('Content-Type: image/png');
|
||||
echo \Storage::fread(BASE_DIR."/textures/".$t->hash);
|
||||
} else {
|
||||
\Http::abort(404, '材质不存在');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function checkCache($player_name)
|
||||
{
|
||||
// Cache friendly
|
||||
|
|
|
|||
|
|
@ -123,5 +123,7 @@ Route::group(['middleware' => 'App\Middlewares\CheckPlayerExis
|
|||
Route::get('/avatar/{base64_email}.png', 'TextureController@avatar');
|
||||
Route::get('/avatar/{size}/{base64_email}.png', 'TextureController@avatarWithSize')->where(['base64_email' => '[^\\/]+?']);
|
||||
|
||||
Route::get('/raw/{tid}.png', 'TextureController@raw');
|
||||
|
||||
Route::get('/preview/{tid}.png', 'TextureController@preview');
|
||||
Route::get('/preview/{size}/{tid}.png', 'TextureController@previewWithSize');
|
||||
|
|
|
|||
|
|
@ -72,9 +72,11 @@
|
|||
<td>{{ $texture->type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hash</td>
|
||||
<td>Hash
|
||||
<i class="fa fa-question-circle" title="右键另存为即可下载原始皮肤文件" data-toggle="tooltip" data-placement="top"></i>
|
||||
</td>
|
||||
<td>
|
||||
<a href="../textures/{{ $texture->hash }}">{{ substr($texture->hash, 0, 15) }}...</a>
|
||||
<a href="../raw/{{ $texture->tid }}.png" title="{{ $texture->hash }}">{{ substr($texture->hash, 0, 15) }}...</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user