From ee452721af07ff6ab7aef3674a4c6d2807ad8582 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 24 May 2023 15:01:52 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BC=98=E5=8C=96count=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/dao/service/StoreServiceDao.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/app/dao/service/StoreServiceDao.php b/crmeb/app/dao/service/StoreServiceDao.php index 044c5f245..52284fd2e 100644 --- a/crmeb/app/dao/service/StoreServiceDao.php +++ b/crmeb/app/dao/service/StoreServiceDao.php @@ -96,7 +96,7 @@ class StoreServiceDao extends BaseDao * @email 442384644@qq.com * @date 2023/05/10 */ - public function count($where = [], $search = true) + public function count(array $where = [], $search = true) { return $this->search($where, false)->when(isset($where['noId']), function ($query) use ($where) { $query->whereNotIn('uid', $where['noId']); From dc98818d6b2b1a8afd87ae5a7b090358a3054b12 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 24 May 2023 15:17:42 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/public/install/crmeb.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index d9189c716..40f03bcea 100755 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -33764,7 +33764,7 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (435, 'icp_url', 'text', 'input', 26, '', 1, '', 0, 0, '\"https:\\/\\/beian.miit.gov.cn\"', 'ICP备案链接', 'H5和PC底部显示的ICP备案号点击跳转的链接', 9, 1), (436, 'network_security_url', 'text', 'input', 26, '', 1, '', 0, 0, '\"https:\\/\\/www.beian.gov.cn\"', '网安备案链接', 'H5和PC底部显示的网安备案号点击跳转的链接', 7, 1), (437, 'agent_apply_open', 'radio', 'input', 72, '1=>开启\n0=>关闭', 1, '', 0, 0, '1', '代理商申请开关', '控制移动端我的推广页面的代理商申请按钮是否显示', 0, 1), -(438, 'order_shipping_open', 'radio', 'input', 7, '1=>开启\n0=>关闭', 1, '', 0, 0, '1', '小程序发货信息管理服务', '小程序有订单发货管理时,请打开此开关,否则会导致订单资金冻结', 0, 1); +(438, 'order_shipping_open', 'radio', 'input', 7, '1=>开启\n0=>关闭', 1, '', 0, 0, '0', '小程序发货信息管理服务', '小程序有订单发货管理时,请打开此开关,否则会导致订单资金冻结', 0, 1); -- -------------------------------------------------------- From 543cce1f4b92994d9add1c5295b78c52c8ce1ba0 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 24 May 2023 16:11:16 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E4=BC=98=E5=8C=96thinkphp=E7=9A=84filein?= =?UTF-8?q?fo=E6=89=A9=E5=B1=95=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/FinfoMimeTypeDetector.php | 55 ++++++++++++++++--- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/crmeb/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php b/crmeb/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php index ba91938f7..d892515d1 100644 --- a/crmeb/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php +++ b/crmeb/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php @@ -45,7 +45,7 @@ class FinfoMimeTypeDetector implements MimeTypeDetector ?int $bufferSampleSize = null, array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES ) { - $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); +// $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); $this->bufferSampleSize = $bufferSampleSize; $this->inconclusiveMimetypes = $inconclusiveMimetypes; @@ -53,17 +53,53 @@ class FinfoMimeTypeDetector implements MimeTypeDetector public function detectMimeType(string $path, $contents): ?string { - $mimeType = is_string($contents) - ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) - : null; - - if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { - return $mimeType; +// $mimeType = is_string($contents) +// ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) +// : null; +// +// if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { +// return $mimeType; +// } + if (is_string($contents)) { + return $this->extensionMimeType($path); + } else { + $mimeType = null; } return $this->detectMimeTypeFromPath($path); } + public function extensionMimeType(string $path) + { + $extension = pathinfo($path, PATHINFO_EXTENSION); + switch ($extension) { + case 'jpg': + case 'jpeg': + return 'image/jpeg'; + case 'png': + return 'image/png'; + case 'gif': + return 'image/gif'; + case 'bmp': + return 'image/bmp'; + case 'txt': + return 'text/plain'; + case 'pdf': + return 'application/pdf'; + case 'doc': + case 'docx': + return 'application/msword'; + case 'xls': + case 'xlsx': + return 'application/vnd.ms-excel'; + case 'ppt': + case 'pptx': + return 'application/vnd.ms-powerpoint'; + default: + return 'application/octet-stream'; + } + } + public function detectMimeTypeFromPath(string $path): ?string { $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); @@ -73,12 +109,13 @@ class FinfoMimeTypeDetector implements MimeTypeDetector public function detectMimeTypeFromFile(string $path): ?string { - return @$this->finfo->file($path) ?: null; +// return @$this->finfo->file($path) ?: null; + return $this->extensionMimeType($path); } public function detectMimeTypeFromBuffer(string $contents): ?string { - return @$this->finfo->buffer($this->takeSample($contents)) ?: null; +// return @$this->finfo->buffer($this->takeSample($contents)) ?: null; } private function takeSample(string $contents): string From 5442c0e2cb24a1f72d169d6ef501f627db388bfa Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 24 May 2023 16:11:31 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=8F=91=E8=B4=A7=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/setting/SystemConfig.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php b/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php index d4e1c27a9..a87cd7f0a 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php @@ -332,9 +332,9 @@ class SystemConfig extends AuthController if ($post['reward_integral'] < 0 || $post['reward_money'] < 0) return app('json')->fail(400558); } - if (isset($post['order_shipping_open']) && $post['order_shipping_open'] == 1 && isset($post['order_shipping_url'])) { - MiniOrderService::setMesJumpPathAndCheck($post['order_shipping_url']); - } +// if (isset($post['order_shipping_open']) && $post['order_shipping_open'] == 1 && isset($post['order_shipping_url'])) { +// MiniOrderService::setMesJumpPathAndCheck($post['order_shipping_url']); +// } foreach ($post as $k => $v) { $config_one = $this->services->getOne(['menu_name' => $k]); if ($config_one) { From 7e41b7510301b9c4096e214aae5566368c0f48ce Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Thu, 25 May 2023 09:17:46 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/system/SystemMenusServices.php | 9 +-- .../systemMenus/components/menusFrom.vue | 12 ++-- .../src/pages/setting/systemMenus/index.vue | 8 +-- .../systemMenus/components/menusFrom.vue | 71 +++++++++++++------ .../src/pages/system/systemMenus/index.vue | 6 +- 5 files changed, 64 insertions(+), 42 deletions(-) diff --git a/crmeb/app/services/system/SystemMenusServices.php b/crmeb/app/services/system/SystemMenusServices.php index fea86739b..62ae5f5ba 100644 --- a/crmeb/app/services/system/SystemMenusServices.php +++ b/crmeb/app/services/system/SystemMenusServices.php @@ -76,7 +76,7 @@ class SystemMenusServices extends BaseServices $systemRoleServices = app()->make(SystemRoleServices::class); $rules = $systemRoleServices->getRoleArray(['status' => 1, 'id' => $rouleId], 'rules'); $rulesStr = Arr::unique($rules); - $menusList = $this->dao->getMenusRoule(['route' => $level ? $rulesStr : '']); + $menusList = $this->dao->getMenusRoule(['route' => $level ? $rulesStr : '', 'is_show_path' => 1]); $unique = $this->dao->getMenusUnique(['unique' => $level ? $rulesStr : '']); return [Arr::getMenuIviewList($this->getMenusData($menusList)), $unique]; } @@ -123,9 +123,6 @@ class SystemMenusServices extends BaseServices protected function getFormCascaderMenus(int $value = 0, $auth_type = 0) { $where = ['is_del' => 0]; - if ($auth_type == 3) { - $where = ['is_del' => 0, 'auth_type' => 3]; - } $menuList = $this->dao->getMenusRoule($where, ['id as value', 'pid', 'menu_name as label']); $menuList = $this->getMenusData($menuList); if ($value) { @@ -152,7 +149,7 @@ class SystemMenusServices extends BaseServices $field[] = Form::input('unique_auth', '权限标识', $formData['unique_auth'] ?? '')->placeholder('不填写则后台自动生成'); $field[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::number('sort', '排序', (int)($formData['sort'] ?? 0))->precision(0); - $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 1, 'label' => '菜单'], ['value' => 3, 'label' => '按钮']]); + $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 1, 'label' => '菜单'], ['value' => 3, 'label' => '按钮'], ['value' => 2, 'label' => '接口']]); $field[] = Form::radio('is_show', '权限状态', $formData['is_show'] ?? 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]); $field[] = Form::radio('is_show_path', '是否显示', $formData['is_show_path'] ?? 0)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]); [$menuList, $data] = $this->getFormCascaderMenus((int)($formData['pid'] ?? 0), 3); @@ -249,7 +246,7 @@ class SystemMenusServices extends BaseServices public function getMenus($roles): array { $field = ['menu_name', 'pid', 'id']; - $where = ['is_del' => 0, 'auth_type' => 3]; + $where = ['is_del' => 0, 'is_show_path' => 1]; if (!$roles) { $menus = $this->dao->getMenusRoule($where, $field); } else { diff --git a/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue b/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue index e70528d3f..2ddba3c54 100644 --- a/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue +++ b/template/admin/src/pages/setting/systemMenus/components/menusFrom.vue @@ -2,7 +2,7 @@