Browse Source

no message

kuaifan 5 năm trước cách đây
mục cha
commit
4d25bc1170

+ 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', ['version' => \App\Module\Base::version]);
+                    return response()->view('main', ['version' => \App\Module\Base::getVersion()]);
                 }
             }
         }

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

@@ -29,7 +29,7 @@ class IndexController extends Controller
      */
     public function main()
     {
-        return view('main', ['version' => Base::version]);
+        return view('main', ['version' => Base::getVersion()]);
     }
 
     /**

+ 16 - 1
app/Module/Base.php

@@ -13,7 +13,22 @@ use Storage;
 
 class Base
 {
-    const version = "1.4.6";
+
+    /**
+     * 获取版本号
+     * @return string
+     */
+    public static function getVersion()
+    {
+        return Cache::remember("Base::version", now()->addSeconds(10), function () {
+            $file = base_path('package.json');
+            if (file_exists($file)) {
+                $packageArray = json_decode(file_get_contents($file), true);
+                return isset($packageArray['version']) ? $packageArray['version'] : '1.0.0';
+            }
+            return '1.0.0';
+        });
+    }
 
     /**
      * 获取数组或对象值

+ 2 - 0
package.json

@@ -1,4 +1,6 @@
 {
+    "version": "1.4.7",
+    "name": "wookteam",
     "private": true,
     "scripts": {
         "ide-helper": "php artisan ide-helper:generate",

+ 9 - 0
resources/assets/js/main/components/project/gantt/GSTC.vue

@@ -76,6 +76,9 @@
                 element: this.$refs.gstc,
                 state: this.state
             });
+            if (this.isMac()) {
+                this.$refs.gstc.addEventListener('mousewheel', this.mouseHandler, { passive: false });
+            }
             //
             this.$watch(
                 "config",
@@ -95,6 +98,12 @@
             this.gstc.app.destroy();
         },
         methods: {
+            isMac() {
+                return /macintosh|mac os x/i.test(navigator.userAgent);
+            },
+            mouseHandler(e) {
+                e.preventDefault();
+            },
             getGstc() {
                 return this.gstc;
             },