Browse Source

清缓存

moshaorui 4 months ago
parent
commit
ffd922afb4

+ 2 - 2
app/Distributor/Controllers/CacheController.php

@@ -39,8 +39,8 @@ class CacheController extends Controller
     {
         $url = $request->input('url');
         $url = $url . '/?__clear_cache=1';
-        //curl 访问
-        curlGet($url,3);
+        //curl访问,2秒超时
+        curlGet($url,2);
         $form = new Form();
         return $form->response()->success('Success');
     }

+ 4 - 0
app/Distributor/bootstrap.php

@@ -29,6 +29,7 @@ use Illuminate\Support\ServiceProvider;
 // 设置后台布局
 $newContent = new Content();
 $newContent->view('distributor.layouts.content');
+
 app()->singleton(Content::class, function () use ($newContent) {
     return $newContent;
 });
@@ -39,6 +40,9 @@ $user = Admin::guard()->check() ? Admin::user() : null;
 // 设置应用程序的本地化
 config(['app.locale' => $user && $user->language ? $user->language : config('app.locale')]);
 
+//覆盖默认配置
+config(['distributor.layout.home_url'=>getDistributorDomain()]);
+
 
 
 //// 覆盖默认配置

+ 20 - 0
app/helpers.php

@@ -47,6 +47,26 @@ if (!function_exists('getDistributor')) {
     }
 }
 
+if (!function_exists('getDistributorDomain')) {
+    function getDistributorDomain()
+    {
+        $domain = '';
+        $row = getDistributor();
+        if ($row) {
+            if ($row['domain_type'] == 0) {
+                $domain = 'http://'.$row['secondary_domain'];
+            } else {
+                $domain = 'http://'.$row['custom_domain'];
+            }
+        }
+        if (env('DIST_SITE_PORT') != 80) {
+            $domain .= ':' . env('DIST_SITE_PORT');
+        }
+        return $domain;
+
+    }
+}
+
 if (!function_exists('getDistributorId')) {
     /**
      * 获取会话中的 distributor 的 ID

+ 1 - 1
config/admin.php

@@ -355,7 +355,7 @@ return [
         // bg-primary, bg-info, bg-warning, bg-success, bg-danger, bg-dark
         'navbar_color' => 'bg-primary',
 
-        'full_screen' => true, // 是否展示全屏按钮
+        'full_screen' => false, // 是否展示全屏按钮
 
         'home_url'=> env('APP_URL') // 是否展示官网url
     ],

+ 1 - 0
config/distributor.php

@@ -342,6 +342,7 @@ return [
 
         // bg-primary, bg-info, bg-warning, bg-success, bg-danger, bg-dark
         'navbar_color' => '',
+
     ],
 
     /*

+ 6 - 1
resources/views/distributor/partials/navbar.blade.php

@@ -39,6 +39,10 @@
 
                 <div class="navbar-right d-flex align-items-center">
                     {!! Dcat\Admin\Admin::navbar()->render() !!}
+
+                    <a href="{{getDistributorDomain()}}" target="_blank" class="nav-link"><i class="fa fa-home f18"></i></a>
+
+                    <!--
                     @if(!empty($configData['home_url']))
                         <a href="{{$configData['home_url']}}" target="_blank" class="nav-link"><i class="fa fa-home f18"></i></a>
                     @endif
@@ -46,6 +50,7 @@
                     @if(isset($configData['full_screen']) && $configData['full_screen'])
                     <a href="javascript:;"  data-check-screen="full" class="nav-link"><i class="feather icon-maximize f16"></i></a>
                     @endif
+                    --->
                     <ul class="nav navbar-nav">
                         {{--User Account Menu--}}
                         {!! admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_USER_PANEL']) !!}
@@ -58,4 +63,4 @@
     </div>
 </nav>
 @endif
-{!! admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_AFTER']) !!}
+{!! admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_AFTER']) !!}