css
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
zhongjy001
2026-02-14 02:28:10 +08:00
parent a16d73af0a
commit 4c9790d140
5 changed files with 1212 additions and 1213 deletions

View File

@@ -156,6 +156,6 @@ class AuthController extends Controller
private function loginRateLimiterKey(Request $request, string $username): string private function loginRateLimiterKey(Request $request, string $username): string
{ {
return Str::lower($username).'|'.$request->ip(); return Str::lower($username) . '|' . $request->ip();
} }
} }

View File

@@ -42,7 +42,7 @@ class UploadController extends Controller
public function markdownImage(Request $request): JsonResponse public function markdownImage(Request $request): JsonResponse
{ {
$validated = $request->validate([ $validated = $request->validate([
'image' => ['required', 'file', 'image', 'mimes:jpg,jpeg,png,webp,gif', 'max:'.self::MAX_FILE_KB], 'image' => ['required', 'file', 'image', 'mimes:jpg,jpeg,png,webp,gif', 'max:' . self::MAX_FILE_KB],
], [ ], [
'image.required' => '请选择要上传的图片。', 'image.required' => '请选择要上传的图片。',
'image.image' => '仅支持图片文件上传。', 'image.image' => '仅支持图片文件上传。',
@@ -77,22 +77,22 @@ class UploadController extends Controller
$thumbBinary = $this->encodeWebp($thumbImage, self::THUMB_WEBP_QUALITY); $thumbBinary = $this->encodeWebp($thumbImage, self::THUMB_WEBP_QUALITY);
$subDir = now()->format('Y/m/d'); $subDir = now()->format('Y/m/d');
$baseName = now()->format('YmdHis').'-'.Str::lower(Str::random(8)); $baseName = now()->format('YmdHis') . '-' . Str::lower(Str::random(8));
$mainPath = "markdown-images/{$subDir}/{$baseName}.webp"; $mainPath = "markdown-images/{$subDir}/{$baseName}.webp";
$thumbPath = "markdown-images/{$subDir}/{$baseName}_thumb.webp"; $thumbPath = "markdown-images/{$subDir}/{$baseName}_thumb.webp";
Storage::disk('public')->put($mainPath, $mainBinary); Storage::disk('public')->put($mainPath, $mainBinary);
Storage::disk('public')->put($thumbPath, $thumbBinary); Storage::disk('public')->put($thumbPath, $thumbBinary);
$mainUrl = '/storage/'.ltrim($mainPath, '/'); $mainUrl = '/storage/' . ltrim($mainPath, '/');
$thumbUrl = '/storage/'.ltrim($thumbPath, '/'); $thumbUrl = '/storage/' . ltrim($thumbPath, '/');
return response()->json([ return response()->json([
'success' => true, 'success' => true,
'url' => $mainUrl, 'url' => $mainUrl,
'thumb_url' => $thumbUrl, 'thumb_url' => $thumbUrl,
'filename' => basename($mainPath), 'filename' => basename($mainPath),
'markdown' => '![]('.$mainUrl.')', 'markdown' => '![](' . $mainUrl . ')',
]); ]);
} catch (Throwable $exception) { } catch (Throwable $exception) {
report($exception); report($exception);

1096
resources/css/home.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@ import tailwindcss from '@tailwindcss/vite';
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
laravel({ laravel({
input: ['resources/css/app.css', 'resources/js/app.js'], input: ['resources/css/app.css', 'resources/css/home.css', 'resources/js/app.js'],
refresh: true, refresh: true,
}), }),
tailwindcss(), tailwindcss(),