From e735967218837322c4b8e0aeb63b00b438b350ca Mon Sep 17 00:00:00 2001 From: ak Date: Tue, 11 Aug 2026 19:02:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=20Undefined=20array?= =?UTF-8?q?=20key=EF=BC=88unset=20=E5=90=8E=E8=AE=BF=E9=97=AE=E5=B7=B2?= =?UTF-8?q?=E5=88=A0=20key=EF=BC=89=EF=BC=9Bsablog=20=E4=B8=BB=E9=A2=98=20?= =?UTF-8?q?footer=20=E9=94=99=E4=BD=8D=EF=BC=88#page=20=E7=94=B1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=A7=86=E5=9B=BE=E8=87=AA=E9=97=AD=E5=90=88=EF=BC=89?= =?UTF-8?q?=EF=BC=9BPaymentSettings=20Section=20=E7=B1=BB=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=EF=BC=88v5=20=E7=A7=BB=E5=88=B0=20Schemas=EF=BC=89?= =?UTF-8?q?=EF=BC=9Bmodern=20=E4=B8=BB=E9=A2=98=E4=B8=A4=E6=A0=8F=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Blog/Controllers/AuthController.php | 10 +++++----- .../src/Filament/Pages/PaymentSettings.php | 2 +- themes/modern/assets/style.css | 5 +++-- themes/sablog/assets/style.css | 1 + themes/sablog/views/index.blade.php | 2 ++ themes/sablog/views/list.blade.php | 2 ++ themes/sablog/views/partials/footer.blade.php | 1 - themes/sablog/views/partials/header.blade.php | 1 - themes/sablog/views/search.blade.php | 2 ++ themes/sablog/views/show.blade.php | 2 ++ themes/sablog/views/tag.blade.php | 2 ++ 11 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/Blog/Controllers/AuthController.php b/app/Blog/Controllers/AuthController.php index a95e6f9..0c9af8b 100644 --- a/app/Blog/Controllers/AuthController.php +++ b/app/Blog/Controllers/AuthController.php @@ -25,13 +25,13 @@ class AuthController extends Controller 'password' => ['required', 'string'], ]); - $field = filter_var($credentials['email'], FILTER_VALIDATE_EMAIL) ? 'email' : 'name'; - $credentials[$field] = $credentials['email']; - unset($credentials['email']); + // 支持邮箱或用户名登录 + $login = $credentials['email']; + $field = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'name'; - $user = User::query()->where($field, $credentials[$field])->first(); + $user = User::query()->where($field, $login)->first(); - if ($user && $user->verifyPassword($request->password)) { + if ($user && $user->verifyPassword($credentials['password'])) { Auth::login($user, $request->boolean('remember')); $user->forceFill([ 'logincount' => $user->logincount + 1, diff --git a/plugins/neatstudio.payment/src/Filament/Pages/PaymentSettings.php b/plugins/neatstudio.payment/src/Filament/Pages/PaymentSettings.php index 1c465e1..2defc7f 100644 --- a/plugins/neatstudio.payment/src/Filament/Pages/PaymentSettings.php +++ b/plugins/neatstudio.payment/src/Filament/Pages/PaymentSettings.php @@ -4,7 +4,7 @@ namespace Plugins\Neatstudio\Payment\Filament\Pages; use App\Models\Setting; use Filament\Actions\Action; -use Filament\Forms\Components\Section; +use Filament\Schemas\Components\Section; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; use Filament\Forms\Concerns\InteractsWithForms; diff --git a/themes/modern/assets/style.css b/themes/modern/assets/style.css index 9e364c7..33ca763 100644 --- a/themes/modern/assets/style.css +++ b/themes/modern/assets/style.css @@ -31,8 +31,9 @@ a:hover { opacity: 0.8; } .m-link-btn { background: none; border: none; color: var(--accent); font-size: 14px; cursor: pointer; padding: 0; } .inline-form { display: inline; } -.main-layout { padding: 36px 20px; } -.main-layout .content { max-width: 720px; margin: 0 auto; } +.main-layout { display: flex; gap: 32px; align-items: flex-start; max-width: 1080px; margin: 0 auto; padding: 36px 20px; } +.main-layout .content { flex: 1; min-width: 0; max-width: 720px; } +.main-layout .sidebar { width: 300px; flex-shrink: 0; } .post-card, .post-full, .comments-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 26px 30px; margin-bottom: 22px; } .post-card.sticky { box-shadow: inset 3px 0 0 var(--accent); } diff --git a/themes/sablog/assets/style.css b/themes/sablog/assets/style.css index 4eb8a3c..131f5cf 100644 --- a/themes/sablog/assets/style.css +++ b/themes/sablog/assets/style.css @@ -84,6 +84,7 @@ a:hover { color: #f60; text-decoration: underline; } .sidebar .tagcloud a { color: #1c62b0; margin-right: 6px; } /* 兜底页面(归档/标签云/友链/评论/登录等使用默认布局) */ +.container.main-layout { max-width: 960px; margin: 0 auto; } .main-layout { display: flex; gap: 18px; align-items: flex-start; padding: 14px 10px; } .main-layout .content { flex: 1; min-width: 0; } .main-layout .sidebar { width: 280px; } diff --git a/themes/sablog/views/index.blade.php b/themes/sablog/views/index.blade.php index 2663390..5d9d2dc 100644 --- a/themes/sablog/views/index.blade.php +++ b/themes/sablog/views/index.blade.php @@ -1,6 +1,7 @@ @include('partials.head') @include('partials.header') +
@if(session('success'))
{{ session('success') }}
@@ -18,6 +19,7 @@ @include('partials.pagination', ['paginator' => $posts])
@include('partials.sidebar') +
{{-- #page --}} @include('partials.footer') diff --git a/themes/sablog/views/list.blade.php b/themes/sablog/views/list.blade.php index fce4aed..4e2b5dd 100644 --- a/themes/sablog/views/list.blade.php +++ b/themes/sablog/views/list.blade.php @@ -4,6 +4,7 @@ @include('partials.head') @include('partials.header') +

{{ $archiveTitle ?? ($category->name ?? '文章列表') }}

@@ -16,6 +17,7 @@ @include('partials.pagination', ['paginator' => $posts])
@include('partials.sidebar') +
{{-- #page --}} @include('partials.footer') diff --git a/themes/sablog/views/partials/footer.blade.php b/themes/sablog/views/partials/footer.blade.php index f0fb4fe..dafbfab 100644 --- a/themes/sablog/views/partials/footer.blade.php +++ b/themes/sablog/views/partials/footer.blade.php @@ -4,5 +4,4 @@

Powered by LaraLog · Laravel · Filament

-{{-- #page --}} {{-- #outmain --}} diff --git a/themes/sablog/views/partials/header.blade.php b/themes/sablog/views/partials/header.blade.php index aac4de6..07cffd8 100644 --- a/themes/sablog/views/partials/header.blade.php +++ b/themes/sablog/views/partials/header.blade.php @@ -27,4 +27,3 @@ -
diff --git a/themes/sablog/views/search.blade.php b/themes/sablog/views/search.blade.php index 25b9746..c96a375 100644 --- a/themes/sablog/views/search.blade.php +++ b/themes/sablog/views/search.blade.php @@ -2,6 +2,7 @@ @include('partials.head') @include('partials.header') +

搜索:{{ $keyword ?: '全部' }}

@@ -18,6 +19,7 @@ @include('partials.pagination', ['paginator' => $posts])
@include('partials.sidebar') +
{{-- #page --}} @include('partials.footer') diff --git a/themes/sablog/views/show.blade.php b/themes/sablog/views/show.blade.php index 76e2ac0..7409763 100644 --- a/themes/sablog/views/show.blade.php +++ b/themes/sablog/views/show.blade.php @@ -6,6 +6,7 @@ @include('partials.head') @include('partials.header') +
@if(session('success'))
{{ session('success') }}
@@ -82,6 +83,7 @@ @endif
@include('partials.sidebar') +
{{-- #page --}} @include('partials.footer') diff --git a/themes/sablog/views/tag.blade.php b/themes/sablog/views/tag.blade.php index c12615a..dbe8175 100644 --- a/themes/sablog/views/tag.blade.php +++ b/themes/sablog/views/tag.blade.php @@ -2,6 +2,7 @@ @include('partials.head') @include('partials.header') +

标签:{{ $tag->name }}

@@ -14,6 +15,7 @@ @include('partials.pagination', ['paginator' => $posts])
@include('partials.sidebar') +
{{-- #page --}} @include('partials.footer')