diff --git a/beike/Admin/View/Components/Alert.php b/beike/Admin/View/Components/Alert.php index 4564d292..6752e63f 100644 --- a/beike/Admin/View/Components/Alert.php +++ b/beike/Admin/View/Components/Alert.php @@ -9,9 +9,9 @@ class Alert extends Component public string $type; public string $msg; - public function __construct(string $type, string $msg) + public function __construct(?string $type = 'success', string $msg) { - $this->type = $type; + $this->type = $type ?? 'success'; $this->msg = $msg; } diff --git a/beike/Shop/View/Components/Alert.php b/beike/Shop/View/Components/Alert.php index be6c2454..e9f178ed 100644 --- a/beike/Shop/View/Components/Alert.php +++ b/beike/Shop/View/Components/Alert.php @@ -9,9 +9,9 @@ class Alert extends Component public string $type; public string $msg; - public function __construct(string $type, string $msg) + public function __construct(?string $type = 'success', string $msg) { - $this->type = $type; + $this->type = $type ?? 'success'; $this->msg = $msg; } diff --git a/resources/beike/admin/views/components/alert.blade.php b/resources/beike/admin/views/components/alert.blade.php index 9ab92d72..0fe2eae1 100644 --- a/resources/beike/admin/views/components/alert.blade.php +++ b/resources/beike/admin/views/components/alert.blade.php @@ -1,4 +1,4 @@ -
+
{{ $msg }} diff --git a/resources/beike/admin/views/pages/pages/index.blade.php b/resources/beike/admin/views/pages/pages/index.blade.php index 739c0ee2..aaa5e2b7 100644 --- a/resources/beike/admin/views/pages/pages/index.blade.php +++ b/resources/beike/admin/views/pages/pages/index.blade.php @@ -5,7 +5,7 @@ @section('content') @if ($errors->has('error')) - + @endif
diff --git a/themes/default/cart/cart.blade.php b/themes/default/cart/cart.blade.php index 23131450..5a9cb7a3 100644 --- a/themes/default/cart/cart.blade.php +++ b/themes/default/cart/cart.blade.php @@ -17,9 +17,8 @@
@include('shared.steps', ['steps' => 1])
- {{-- @dump($errors) --}} @if ($errors->has('error')) - + @endif
diff --git a/themes/default/components/alert.blade.php b/themes/default/components/alert.blade.php index 9ab92d72..0fe2eae1 100644 --- a/themes/default/components/alert.blade.php +++ b/themes/default/components/alert.blade.php @@ -1,4 +1,4 @@ -
+
{{ $msg }}