css
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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' => '',
|
'markdown' => '',
|
||||||
]);
|
]);
|
||||||
} catch (Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
report($exception);
|
report($exception);
|
||||||
|
|||||||
1096
resources/css/home.css
Normal file
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
@@ -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(),
|
||||||
|
|||||||
Reference in New Issue
Block a user