kuaifan 5 anos atrás
pai
commit
0fb8da1cfc

+ 1 - 1
app/Exceptions/Handler.php

@@ -53,7 +53,7 @@ class Handler extends ExceptionHandler
         if ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
             if ($exception->getStatusCode() == 404) {
                 if (!\App\Module\Base::leftExists($request->getRequestUri(), '/api')) {
-                    return response()->view('main');
+                    return response()->view('main', ['version' => \App\Module\Base::version]);
                 }
             }
         }

+ 1 - 3
app/Http/Controllers/IndexController.php

@@ -14,8 +14,6 @@ use Redirect;
 class IndexController extends Controller
 {
 
-    private $version = '1.4.6';
-
     public function __invoke($method, $action = '', $child = '')
     {
         $app = $method ? $method : 'main';
@@ -31,7 +29,7 @@ class IndexController extends Controller
      */
     public function main()
     {
-        return view('main', ['version' => $this->version]);
+        return view('main', ['version' => Base::version]);
     }
 
     /**

+ 1 - 0
app/Module/Base.php

@@ -13,6 +13,7 @@ use Storage;
 
 class Base
 {
+    const version = "1.4.6";
 
     /**
      * 获取数组或对象值

+ 1 - 1
resources/views/main.blade.php

@@ -37,7 +37,7 @@
     </div>
 </div>
 
-<script src="{{ mix('js/app.js') }}?__={{ $version }}"></script>
+<script src="{{ mix('js/app.js') }}?v={{ $version }}"></script>
 
 </body>
 </html>