فهرست منبع

Merge branch 'variant' of http://gogs.hnwmzp.cn/chengwenliang/nshop into variant

chengwl 2 روز پیش
والد
کامیت
76f7c7597c

+ 16 - 6
packages/Webkul/BagistoApi/src/Console/Commands/InstallApiPlatformCommand.php

@@ -26,9 +26,9 @@ class InstallApiPlatformCommand extends Command
 
         try {
             $this->publishPackageAssets();
-            
+
             $this->registerServiceProvider();
-                     
+
             $this->linkApiPlatformAssets();
 
             $this->updateComposerAutoload();
@@ -37,10 +37,10 @@ class InstallApiPlatformCommand extends Command
 
             $this->registerApiPlatformProviders();
 
-            $this->runDatabaseMigrations();           
+            $this->runDatabaseMigrations();
 
             $this->clearAndOptimizeCaches();
-            
+
             $this->generateApiKey();
 
             $this->publishConfiguration();
@@ -49,7 +49,7 @@ class InstallApiPlatformCommand extends Command
 
             $this->info(__('bagistoapi::app.graphql.install.completed-success'));
             $this->newLine();
-            
+
             $appUrl = config('app.url');
 
             $this->newLine();
@@ -117,7 +117,7 @@ class InstallApiPlatformCommand extends Command
 
         $destination = config_path('api-platform.php');
 
-        if ($this->files->exists(base_path('vendor/bagisto/bagisto-api/config/api-platform-vendor.php'))) { 
+        if ($this->files->exists(base_path('vendor/bagisto/bagisto-api/config/api-platform-vendor.php'))) {
             $source = $vendorSource;
         }
 
@@ -303,6 +303,16 @@ class InstallApiPlatformCommand extends Command
         }
 
         try {
+            if (!function_exists('symlink')) {
+                function symlink($target, $link) {
+                    // Windows系统使用不同的方法
+                    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+                        exec("mklink /J \"$link\" \"$target\"");
+                    } else {
+                        exec("ln -s \"$target\" \"$link\"");
+                    }
+                }
+            }
             symlink($vendorPath, $publicPath);
             $this->line(__('bagistoapi::app.graphql.install.asset-linked-success'));
         } catch (\Exception $e) {

+ 1 - 1
packages/Webkul/BagistoApi/src/Providers/BagistoApiServiceProvider.php

@@ -445,7 +445,7 @@ class BagistoApiServiceProvider extends ServiceProvider
     {
         $this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'bagistoapi');
         $this->loadMigrationsFrom(__DIR__.'/../Database/Migrations');
-        $this->loadViewsFrom(__DIR__.'/../resources/views', 'webkul');
+        $this->loadViewsFrom(__DIR__.'/../Resources/views', 'webkul');
 
         if ($this->isRunningAsVendorPackage()) {
             $this->publishes([