Browse Source

404页面找不到

moshaorui 2 weeks ago
parent
commit
f23b1d0ba0

+ 11 - 0
app/Http/Controllers/HomeController.php

@@ -24,4 +24,15 @@ class HomeController extends Controller
         return response($output);
 
     }
+
+    /*
+     * 404页面
+     */
+    public function abort404() {
+        $output = LiquidRenderer::render('404.liquid', [
+
+        ]);
+
+        return response($output);
+    }
 }

+ 54 - 0
resources/views/liquid_src/1/screen_protector_solutions/404.liquid

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html lang="{{site.dist.country_lang}}">
+<head>
+    <meta charset="UTF-8">
+    <title>Page not found | Mietubl</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <meta name="keywords" content="" />
+    <meta name="description" content="" />
+    <link rel="canonical" href="{{site.current_url}}" />
+    <meta property="og:locale" content="en" />
+    <meta property="og:type" content="website" />
+    <meta property="og:title" content="" />
+    <meta property="og:description" content="" />
+    <meta property="og:url" content="{{site.current_url}}" />
+    <meta property="og:site_name" content="{{ site.dist.site_name | strip_html| strip_newlines }}" />
+    <link rel='shortlink' href="{{site.current_url}}" />
+    <!-- Bootstrap CSS -->
+    <link href="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+    <!-- Font Awesome para ícones sociais -->
+    <link href="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/lib/fontawesome/css/all.min.css" rel="stylesheet">
+    <!-- CSS Personalizado -->
+    <link rel="stylesheet" href="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/lib/swiper/css/swiper.min.css">
+    <link href="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/css/styles.css" rel="stylesheet">
+</head>
+<body>
+
+{% include '_header.liquid' %}
+
+
+<section>
+    <div class="container">
+        <div class="page-bg">
+        </div>
+        <div class="wrapper">
+            <div class="breadcrumb"><a href="/">Home</a><strong>Page not found</strong></div>
+        </div>
+        <div class="wrapper">
+            <img src="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/image/404.png" style="margin:60px auto;display:block;">
+            <div >
+                <a href="/" style="display:block;margin:auto;background:#5298ff;color:#FFF;width:240px;border-radius:3px;height:42px;line-height:42px;font-size:16px;text-align:center;margin-bottom: 120px;">Back to the home page</a>
+            </div>
+        </div>
+    </div>
+</section>
+
+
+{% include '_footer.liquid' %}
+<script>
+    setTimeout(function() {
+        window.location.href = "/"; // 替换为主页URL
+    }, 5000); // 5000毫秒=5秒[3,4](@ref)
+</script>
+</body>
+</html>

+ 61 - 0
resources/views/liquid_src/1/screenprotector/404.liquid

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html lang="{{site.dist.country_lang}}">
+<head><meta charset="UTF-8">
+    <title>{{tag.seo_title}}</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <meta name="description" content="{{ site.dist.seo_description  | strip_html| strip_newlines }}" />
+    <link rel="canonical" href="{{site.current_url}}" />
+    <meta property="og:locale" content="en_US" />
+    <meta property="og:type" content="website" />
+    <meta property="og:title" content="{{site.dist.company_name}}" />
+    <meta property="og:description" content="{{ site.dist.seo_description  | strip_html| strip_newlines }}" />
+    <meta property="og:url" content="{{site.current_url}}" />
+    <meta property="og:site_name" content="{{site.dist.site_name}}" />
+    <meta name="twitter:card" content="summary_large_image" />
+    <link rel='shortlink' href='{{site.current_url}}' />
+    <link rel="stylesheet" href="{{ site.asset_base_url}}static/tpl/screenprotector/css/css.css?ver=0705">
+    <link rel="stylesheet" href="{{ site.asset_base_url}}static/tpl/screenprotector/css/responsive.css?ver=0118">
+    <link rel="stylesheet" href="{{ site.asset_base_url}}static/tpl/screenprotector/css/swiper-bundle.min.css?ver=0705">
+    <script src="{{ site.asset_base_url}}static/tpl/screenprotector/js/jquery.min.js"></script>
+    <script src="{{ site.asset_base_url}}static/tpl/screenprotector/js/swiper-bundle.min.js"></script>
+    <script src="{{ site.asset_base_url}}static/tpl/screenprotector/js/main.js?ver=0705"></script>
+</head>
+<body>
+{% include '_header.liquid' %}
+
+<section class="page-header">
+    <div class="section-wrapper">
+        <h1 class="page-title">Page not found</h1>
+        <div class="breadcrumb-wrapper">
+                <a href="/">Home</a> <span>/</span> <strong>Page not found</strong>
+        </div>
+    </div>
+</section>
+
+<section>
+    <div class="page-bg">
+    </div>
+    <div class="wrapper">
+        <img src="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/image/404.png" style="margin:60px auto;display:block;">
+        <div >
+            <a href="/" style="display:block;margin:auto;background:#5298ff;color:#FFF;width:240px;border-radius:3px;height:42px;line-height:42px;font-size:16px;text-align:center;margin-bottom: 120px;">Back to the home page</a>
+        </div>
+    </div>
+</section>
+
+
+
+
+
+
+
+
+
+{% include '_footer.liquid' %}
+<script>
+    setTimeout(function() {
+        window.location.href = "/"; // 替换为主页URL
+    }, 5000); // 5000毫秒=5秒[3,4](@ref)
+</script>
+</body>
+</html>

+ 63 - 0
resources/views/liquid_src/1/tech_vista/404.liquid

@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html lang="{{site.dist.country_lang }}">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="robots" content="index, follow">
+    <meta property="og:locale" content="{{site.dist.country_lang | replace: '-', '_' }}" />
+    <meta name="description" content="">
+    <meta name="keywords" content="">
+    <meta name="author" content="Mietubl">
+    <title>Page not found | Mietubl</title>
+    {% include '_header_css.liquid' %}
+</head>
+<body>
+
+
+<!-- MAIN WRAPPER -->
+<div class="body-wrap shop-default shop-cards shop-tech">
+    <div id="st-container" class="st-container">
+
+        <div class="st-pusher">
+            <div class="st-content">
+                <div class="st-content-inner">
+                    <!-- HEADER -->
+                    {% include '_header.liquid' %}
+                    <!-- END: HEADER -->
+
+
+
+
+                    <section>
+                        <div class="container">
+                            <div class="page-bg">
+                            </div>
+                            <div class="wrapper" style="margin-top: 100px;">
+                                <div><a href="/">Home</a> <span style="padding:0 10px"> / </span> <strong>Page not found</strong></div>
+                            </div>
+                            <div class="wrapper">
+                                <img src="{{ site.asset_base_url }}static/tpl/screen_protector_solutions/image/404.png" style="margin:60px auto;display:block;">
+                                <div >
+                                    <a href="/" style="display:block;margin:auto;background:#5298ff;color:#FFF;width:240px;border-radius:3px;height:42px;line-height:42px;font-size:16px;text-align:center;margin-bottom: 120px;">Back to the home page</a>
+                                </div>
+                            </div>
+
+                        </div>
+                    </section>
+
+                    
+                    <!-- FOOTER -->
+                    {% include '_footer.liquid' %}
+                </div>
+            </div>
+        </div><!-- END: st-pusher -->
+    </div><!-- END: st-container -->
+</div><!-- END: body-wrap -->
+
+<script>
+    setTimeout(function() {
+        window.location.href = "/"; // 替换为主页URL
+    }, 50000); // 5000毫秒=5秒[3,4](@ref)
+</script>
+</body>
+</html>

+ 5 - 2
routes/web.php

@@ -106,6 +106,9 @@ Route::prefix('collections')->group(function () {
 Route::get('/sitemap.xml', [SitemapController::class, 'index'])->name('sitemap.index');
 
 
-
-
+// 404 路由
+Route::fallback(function () {
+    $obj = new HomeController();
+    return $obj->abort404();
+});