diff --git a/beike/Admin/Http/Controllers/BrandController.php b/beike/Admin/Http/Controllers/BrandController.php
index bd67f9db..9cf3aaf0 100644
--- a/beike/Admin/Http/Controllers/BrandController.php
+++ b/beike/Admin/Http/Controllers/BrandController.php
@@ -23,6 +23,10 @@ class BrandController extends Controller
'brands' => $brands,
];
+ if ($request->expectsJson()) {
+ return json_success('成功', $data);
+ }
+
return view('admin::pages.brands.index', $data);
}
diff --git a/beike/Models/Brand.php b/beike/Models/Brand.php
index 5ff054fa..84559d4f 100644
--- a/beike/Models/Brand.php
+++ b/beike/Models/Brand.php
@@ -18,7 +18,7 @@ class Brand extends Base
{
use HasFactory;
- protected $fillable = ['name', 'country_id', 'code', 'sort_order', 'status'];
+ protected $fillable = ['name', 'country_id', 'first', 'logo', 'code', 'sort_order', 'status'];
public function products() :HasMany
{
diff --git a/public/build/beike/admin/js/app.js b/public/build/beike/admin/js/app.js
index 4b41e279..6036edd2 100644
--- a/public/build/beike/admin/js/app.js
+++ b/public/build/beike/admin/js/app.js
@@ -2066,6 +2066,7 @@ __webpack_require__.r(__webpack_exports__);
window.$http = _js_http__WEBPACK_IMPORTED_MODULE_0__["default"];
var base = document.querySelector('base').href;
+var asset = document.querySelector('meta[name="asset"]').content;
$(document).on('click', '.open-file-manager', function (event) {
var $this = $(this);
layer.open({
@@ -2088,6 +2089,18 @@ $(document).on('click', '.open-file-manager', function (event) {
}
});
});
+
+if (typeof Vue != 'undefined') {
+ Vue.prototype.thumbnail = function thumbnail(image, width, height) {
+ // 判断 image 是否以 http 开头
+ if (image.indexOf('http') === 0) {
+ return image;
+ }
+
+ return asset + image;
+ };
+}
+
$(document).ready(function ($) {
$.ajaxSetup({
headers: {
diff --git a/resources/beike/admin/js/app.js b/resources/beike/admin/js/app.js
index 4396bf00..0a39e8d6 100644
--- a/resources/beike/admin/js/app.js
+++ b/resources/beike/admin/js/app.js
@@ -1,6 +1,7 @@
import http from "../../../js/http";
window.$http = http;
const base = document.querySelector('base').href;
+const asset = document.querySelector('meta[name="asset"]').content;
$(document).on('click', '.open-file-manager', function(event) {
const $this = $(this);
@@ -25,6 +26,16 @@ $(document).on('click', '.open-file-manager', function(event) {
});
});
+if (typeof Vue != 'undefined') {
+ Vue.prototype.thumbnail = function thumbnail(image, width, height) {
+ // 判断 image 是否以 http 开头
+ if (image.indexOf('http') === 0) {
+ return image;
+ }
+
+ return asset + image;
+ };
+}
$(document).ready(function ($) {
$.ajaxSetup({
diff --git a/resources/beike/admin/views/layouts/master.blade.php b/resources/beike/admin/views/layouts/master.blade.php
index e364e03b..22f4ad47 100644
--- a/resources/beike/admin/views/layouts/master.blade.php
+++ b/resources/beike/admin/views/layouts/master.blade.php
@@ -5,6 +5,7 @@