Skip to content

Commit

Permalink
Merge pull request #141 from maliang/master
Browse files Browse the repository at this point in the history
修复网站logo非env设定bug
  • Loading branch information
slowlyo authored Jul 23, 2024
2 parents 335feb0 + 7819940 commit 286b333
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.github export-ignore
/.git export-ignore
/.idea export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
4 changes: 3 additions & 1 deletion src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ public static function view($apiPrefix = '')
$view = file_get_contents(base_path('vendor/slowlyo/owl-admin/admin-views/dist/index.html'));
}

$script = '<script>window.$adminApiPrefix = "/' . $apiPrefix . '"</script>';
$logoPath = self::config('admin.logo');

$script = '<script>document.querySelector(\'link[rel*="icon"]\').href="' . $logoPath . '";window.$adminApiPrefix = "/' . $apiPrefix . '"</script>';

return preg_replace('/<script>window.*?<\/script>/is', $script, $view);
}
Expand Down

0 comments on commit 286b333

Please sign in to comment.