浏览代码

Fix 通知渠道设置错误

兔姬桑 4 年之前
父节点
当前提交
be293e2fd7

+ 1 - 1
app/Components/NetworkDetection.php

@@ -71,7 +71,7 @@ class NetworkDetection
      */
     public function networkCheck(string $ip, bool $is_icmp, int $port = null)
     {
-        $round = 0;
+        $round = 1;
         // 依次尝试接口
         while (true) {
             switch ($round) {

+ 2 - 1
app/Providers/AppServiceProvider.php

@@ -12,6 +12,7 @@ use App\Observers\NodeObserver;
 use App\Observers\OrderObserver;
 use App\Observers\UserGroupObserver;
 use App\Observers\UserObserver;
+use DB;
 use Illuminate\Support\ServiceProvider;
 use Schema;
 use URL;
@@ -30,7 +31,7 @@ class AppServiceProvider extends ServiceProvider
             $this->app->register(TelescopeServiceProvider::class);
             $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
         }
-        if (Schema::hasTable('config')) {
+        if (Schema::hasTable('config') && DB::table('config')->exists()) {
             $this->app->register(SettingServiceProvider::class);
         }
     }

+ 2 - 1
app/Providers/SettingServiceProvider.php

@@ -73,7 +73,8 @@ class SettingServiceProvider extends ServiceProvider
                 'serverChan' => ServerChanChannel::class,
             ] as $key => $channel
         ) {
-            if (($index = array_search($key, $channels, true)) && $index !== false) {
+            $index = array_search($key, $channels, true);
+            if ($index !== false) {
                 $channels[$index] = $channel;
             }
         }