From e61aaa76770f861766a4bd85f26888dfdd648448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Tue, 21 Mar 2023 15:39:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E6=9B=B4=E6=96=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/AdminApiExceptionHandle.php | 2 +- crmeb/app/adminapi/controller/Common.php | 10 +++++----- .../controller/v1/setting/SystemNotification.php | 10 ++-------- .../app/adminapi/controller/v1/setting/SystemRole.php | 8 ++++---- crmeb/app/api/ApiExceptionHandle.php | 2 +- crmeb/app/api/controller/pc/PublicController.php | 1 + .../api/controller/v1/order/StoreOrderController.php | 4 +--- .../api/controller/v1/user/UserRechargeController.php | 2 +- crmeb/app/kefuapi/KefuApiExceptionHandle.php | 2 +- crmeb/app/outapi/OutApiExceptionHandle.php | 2 +- .../app/services/activity/live/LiveAnchorServices.php | 4 ++-- crmeb/app/services/agent/AgentLevelServices.php | 4 ++-- .../app/services/article/ArticleCategoryServices.php | 2 +- .../services/kefu/service/StoreServiceServices.php | 2 +- crmeb/app/services/order/DeliveryServiceServices.php | 2 +- .../app/services/order/StoreOrderWriteOffServices.php | 8 +++++++- .../product/product/StoreCategoryServices.php | 4 ++-- .../product/product/StoreProductReplyServices.php | 4 ++-- .../services/system/config/SystemConfigServices.php | 4 ++-- .../system/config/SystemGroupDataServices.php | 4 ++-- .../system/store/SystemStoreStaffServices.php | 2 +- crmeb/app/services/user/UserLevelServices.php | 4 ++-- template/admin/src/main.js | 6 +++--- template/admin/vue.config.js | 11 ----------- 24 files changed, 46 insertions(+), 58 deletions(-) diff --git a/crmeb/app/adminapi/AdminApiExceptionHandle.php b/crmeb/app/adminapi/AdminApiExceptionHandle.php index 91d75b43..075813bf 100644 --- a/crmeb/app/adminapi/AdminApiExceptionHandle.php +++ b/crmeb/app/adminapi/AdminApiExceptionHandle.php @@ -84,7 +84,7 @@ class AdminApiExceptionHandle extends Handle 'trace' => $e->getTrace(), 'previous' => $e->getPrevious(), ] : []; - $message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了'; + $message = $e->getMessage(); // 添加自定义异常处理机制 if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) { return app('json')->make($e->getCode() ?: 400, $message, $massageData); diff --git a/crmeb/app/adminapi/controller/Common.php b/crmeb/app/adminapi/controller/Common.php index 6c04e314..eacdd418 100644 --- a/crmeb/app/adminapi/controller/Common.php +++ b/crmeb/app/adminapi/controller/Common.php @@ -60,7 +60,7 @@ class Common extends AuthController $res = $res ? json_decode($res, true) : []; //兼容test. - if ($res['data']['status'] !== 1) { + if (!isset($res['data']['status']) || $res['data']['status'] !== 1) { $host = str_replace('test.', '', $host); $res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [ 'domain_name' => $host, @@ -71,7 +71,7 @@ class Common extends AuthController } //如果是主域名兼容www. - if ($res['data']['status'] !== 1) { + if (!isset($res['data']['status']) || $res['data']['status'] !== 1) { $host = str_replace('www.', '', $host); $res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [ 'domain_name' => $host, @@ -82,9 +82,9 @@ class Common extends AuthController } //升级状态 - /** @var UpgradeServices $upgradeServices */ - $upgradeServices = app()->make(UpgradeServices::class); - $upgradeStatus = $upgradeServices->getUpgradeStatus(); +// /** @var UpgradeServices $upgradeServices */ +// $upgradeServices = app()->make(UpgradeServices::class); +// $upgradeStatus = $upgradeServices->getUpgradeStatus(); $status = $res['data']['status'] ?? -9; switch ((int)$status) { diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php index 1f9dfa2d..4b9d8571 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php @@ -91,10 +91,7 @@ class SystemNotification extends AuthController if ($data['mark'] == 'verify_code') $data['type'] = 'is_sms'; if (!$data['id']) return app('json')->fail(100100); if ($this->services->saveData($data)) { - CacheService::delete('NOTICE_SMS_' . $data['mark']); - CacheService::delete('wechat_' . $data['mark']); - CacheService::delete('routine_' . $data['mark']); - CacheService::delete('TEMP_IDS_LIST'); + CacheService::clear(); return app('json')->success(100001); } else { return app('json')->fail(100007); @@ -117,10 +114,7 @@ class SystemNotification extends AuthController if ($type == '' || $status == '' || $id == 0) return app('json')->fail(100100); $this->services->update($id, [$type => $status]); $res = $this->services->getOneNotce(['id' => $id]); - CacheService::delete('NOTICE_SMS_' . $res->mark); - CacheService::delete('wechat_' . $res->mark); - CacheService::delete('routine_' . $res->mark); - CacheService::delete('TEMP_IDS_LIST'); + CacheService::clear(); return app('json')->success(100014); } } diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemRole.php b/crmeb/app/adminapi/controller/v1/setting/SystemRole.php index 00af6a6a..3869f730 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemRole.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemRole.php @@ -80,12 +80,12 @@ class SystemRole extends AuthController $data['rules'] = implode(',', $data['rules']); if ($id) { if (!$this->services->update($id, $data)) return app('json')->fail(100007); - CacheService::clear(); + $this->services->cacheDriver()->clear(); return app('json')->success(100001); } else { $data['level'] = $this->adminInfo['level'] + 1; if (!$this->services->save($data)) return app('json')->fail(400223); - CacheService::clear(); + $this->services->cacheDriver()->clear(); return app('json')->success(400222); } } @@ -123,7 +123,7 @@ class SystemRole extends AuthController if (!$this->services->delete($id)) return app('json')->fail(100008); else { - CacheService::clear(); + $this->services->cacheDriver()->clear(); return app('json')->success(100002); } } @@ -145,7 +145,7 @@ class SystemRole extends AuthController } $role->status = $status; if ($role->save()) { - CacheService::clear(); + $this->services->cacheDriver()->clear(); return app('json')->success(100001); } else { return app('json')->fail(100007); diff --git a/crmeb/app/api/ApiExceptionHandle.php b/crmeb/app/api/ApiExceptionHandle.php index 2326d29a..094ea176 100644 --- a/crmeb/app/api/ApiExceptionHandle.php +++ b/crmeb/app/api/ApiExceptionHandle.php @@ -85,7 +85,7 @@ class ApiExceptionHandle extends Handle 'trace' => $e->getTrace(), 'previous' => $e->getPrevious(), ] : []; - $message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了'; + $message = $e->getMessage(); // 添加自定义异常处理机制 if ($e instanceof ApiStatusException) { return app('json')->status($e->getApiStatus(), $message, $e->getApiData()); diff --git a/crmeb/app/api/controller/pc/PublicController.php b/crmeb/app/api/controller/pc/PublicController.php index a7405a5e..a2724047 100644 --- a/crmeb/app/api/controller/pc/PublicController.php +++ b/crmeb/app/api/controller/pc/PublicController.php @@ -50,6 +50,7 @@ class PublicController $data['site_name'] = sys_config('site_name'); $data['site_keywords'] = sys_config('site_keywords'); $data['site_description'] = sys_config('site_description'); + $data['network_security'] = sys_config('network_security'); $logoUrl = sys_config('pc_logo'); if (strstr($logoUrl, 'http') === false && $logoUrl) { $logoUrl = sys_config('site_url') . $logoUrl; diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index f632e69c..3c1087e5 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -168,7 +168,7 @@ class StoreOrderController $userInfo = $request->user()->toArray(); if ($checkOrder = $this->services->getOne(['order_id|unique' => $key, 'uid' => $userInfo['uid'], 'is_del' => 0])) return app('json')->status('extend_order', 410209, ['orderId' => $checkOrder['order_id'], 'key' => $key]); - [$addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckillId, $bargainId, $shipping_type, $real_name, $phone, $storeId, $news, $invoice_id, $quitUrl, $advanceId, $virtual_type, $customForm] = $request->postMore([ + [$addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckillId, $bargainId, $shipping_type, $real_name, $phone, $storeId, $news, $invoice_id, $advanceId, $customForm] = $request->postMore([ [['addressId', 'd'], 0], [['couponId', 'd'], 0], ['payType', ''], @@ -184,9 +184,7 @@ class StoreOrderController [['store_id', 'd'], 0], ['new', 0], [['invoice_id', 'd'], 0], - ['quitUrl', ''], [['advanceId', 'd'], 0], - ['virtual_type', 0], ['custom_form', []], ], true); $payType = strtolower($payType); diff --git a/crmeb/app/api/controller/v1/user/UserRechargeController.php b/crmeb/app/api/controller/v1/user/UserRechargeController.php index 57302764..3c4be960 100644 --- a/crmeb/app/api/controller/v1/user/UserRechargeController.php +++ b/crmeb/app/api/controller/v1/user/UserRechargeController.php @@ -53,7 +53,7 @@ class UserRechargeController $uid = (int)$request->uid(); $re = $this->services->recharge($uid, $price, $recharId, $type, $from, true); if ($re) { - $payType = $re['pay_type']; + $payType = $re['pay_type'] ?? ''; unset($re['pay_type']); return app('json')->status($payType, 410125, $re); } diff --git a/crmeb/app/kefuapi/KefuApiExceptionHandle.php b/crmeb/app/kefuapi/KefuApiExceptionHandle.php index 0d130193..e2957c43 100644 --- a/crmeb/app/kefuapi/KefuApiExceptionHandle.php +++ b/crmeb/app/kefuapi/KefuApiExceptionHandle.php @@ -84,7 +84,7 @@ class KefuApiExceptionHandle extends Handle 'trace' => $e->getTrace(), 'previous' => $e->getPrevious(), ] : []; - $message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了'; + $message = $e->getMessage(); // 添加自定义异常处理机制 if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) { return app('json')->make($e->getCode() ?: 400, $message, $massageData); diff --git a/crmeb/app/outapi/OutApiExceptionHandle.php b/crmeb/app/outapi/OutApiExceptionHandle.php index 6549daf9..34a78ebb 100644 --- a/crmeb/app/outapi/OutApiExceptionHandle.php +++ b/crmeb/app/outapi/OutApiExceptionHandle.php @@ -84,7 +84,7 @@ class OutApiExceptionHandle extends Handle 'trace' => $e->getTrace(), 'previous' => $e->getPrevious(), ] : []; - $message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了'; + $message = $e->getMessage(); // 添加自定义异常处理机制 if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) { return app('json')->make($e->getCode() ?: 400, $message, $massageData); diff --git a/crmeb/app/services/activity/live/LiveAnchorServices.php b/crmeb/app/services/activity/live/LiveAnchorServices.php index 3f067c33..b360ab7c 100644 --- a/crmeb/app/services/activity/live/LiveAnchorServices.php +++ b/crmeb/app/services/activity/live/LiveAnchorServices.php @@ -75,14 +75,14 @@ class LiveAnchorServices extends BaseServices $field[] = Form::input('name', '主播名称', '')->maxlength(20)->required('请填写名称'); $field[] = Form::input('wechat', '主播微信号', '')->maxlength(32)->required('请填写微信号'); $field[] = Form::input('phone', '主播手机号', '')->maxlength(20)->required('请填写手机号'); - $field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl('admin/widget.images/index', array('fodder' => 'cover_img')), '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像')); + $field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'cover_img')), '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像')); } else { $title = '修改主播'; $field[] = Form::hidden('id', $anchor->getData('id')); $field[] = Form::input('name', '主播名称', $anchor->getData('name'))->maxlength(20)->required('请填写名称'); $field[] = Form::input('wechat', '主播微信号', $anchor->getData('wechat'))->maxlength(32)->required('请填写微信号'); $field[] = Form::input('phone', '主播手机号', $anchor->getData('phone'))->maxlength(20)->required('请填写手机号'); - $field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl('admin/widget.images/index', array('fodder' => 'cover_img')), $anchor->getData('cover_img'))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像')); + $field[] = Form::frameImage('cover_img', '主播图像', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'cover_img')), $anchor->getData('cover_img'))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendValidate(Validate::str()->required('请选择图像')); } return create_form($title, $field, $this->url('/live/anchor/save'), 'POST'); } diff --git a/crmeb/app/services/agent/AgentLevelServices.php b/crmeb/app/services/agent/AgentLevelServices.php index fe63abc8..7588f763 100644 --- a/crmeb/app/services/agent/AgentLevelServices.php +++ b/crmeb/app/services/agent/AgentLevelServices.php @@ -262,7 +262,7 @@ class AgentLevelServices extends BaseServices { $field[] = Form::input('name', '等级名称')->maxlength(8)->col(24); $field[] = Form::number('grade', '等级', 0)->min(0)->precision(0); - $field[] = Form::frameImage('image', '背景图', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameImage('image', '背景图', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::number('one_brokerage', '一级上浮', 0)->appendRule('suffix', [ 'type' => 'div', 'class' => 'tips-info', @@ -292,7 +292,7 @@ class AgentLevelServices extends BaseServices $field[] = Form::hidden('id', $id); $field[] = Form::input('name', '等级名称', $levelInfo['name'])->maxlength(8)->col(24); $field[] = Form::number('grade', '等级', $levelInfo['grade'])->min(0)->precision(0); - $field[] = Form::frameImage('image', '背景图', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $levelInfo['image'])->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameImage('image', '背景图', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')), $levelInfo['image'])->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::number('one_brokerage', '一级上浮', $levelInfo['one_brokerage'])->appendRule('suffix', [ 'type' => 'div', 'class' => 'tips-info', diff --git a/crmeb/app/services/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php index c275d459..6b11513f 100644 --- a/crmeb/app/services/article/ArticleCategoryServices.php +++ b/crmeb/app/services/article/ArticleCategoryServices.php @@ -84,7 +84,7 @@ class ArticleCategoryServices extends BaseServices $f[] = Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->menus($pid))->filterable(1); $f[] = Form::input('title', '分类名称', $info['title'] ?? '')->maxlength(20)->required(); $f[] = Form::input('intr', '分类简介', $info['intr'] ?? '')->type('textarea')->required(); - $f[] = Form::frameImage('image', '分类图片', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $info['image'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $f[] = Form::frameImage('image', '分类图片', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')), $info['image'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); $f[] = Form::number('sort', '排序', (int)($info['sort'] ?? 0))->precision(0); $f[] = Form::radio('status', '状态', $info['status'] ?? 1)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]); return create_form('添加分类', $f, Url::buildUrl($url), $method); diff --git a/crmeb/app/services/kefu/service/StoreServiceServices.php b/crmeb/app/services/kefu/service/StoreServiceServices.php index b0903521..1fff5a72 100644 --- a/crmeb/app/services/kefu/service/StoreServiceServices.php +++ b/crmeb/app/services/kefu/service/StoreServiceServices.php @@ -91,7 +91,7 @@ class StoreServiceServices extends BaseServices public function createServiceForm(array $formData = []) { if ($formData) { - $field[] = $this->builder->frameImage('avatar', '客服头像', $this->url('admin/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = $this->builder->frameImage('avatar', '客服头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); } else { $field[] = $this->builder->frameImage('image', '选择用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); $field[] = $this->builder->hidden('uid', 0); diff --git a/crmeb/app/services/order/DeliveryServiceServices.php b/crmeb/app/services/order/DeliveryServiceServices.php index 1ad12c8a..a04fe051 100644 --- a/crmeb/app/services/order/DeliveryServiceServices.php +++ b/crmeb/app/services/order/DeliveryServiceServices.php @@ -80,7 +80,7 @@ class DeliveryServiceServices extends BaseServices public function createServiceForm(array $formData = []) { if ($formData) { - $field[] = $this->builder->frameImage('avatar', '配送员头像', $this->url('admin/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = $this->builder->frameImage('avatar', '配送员头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); } else { $field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); $field[] = $this->builder->hidden('uid', 0); diff --git a/crmeb/app/services/order/StoreOrderWriteOffServices.php b/crmeb/app/services/order/StoreOrderWriteOffServices.php index 788bedcc..aeb21b05 100644 --- a/crmeb/app/services/order/StoreOrderWriteOffServices.php +++ b/crmeb/app/services/order/StoreOrderWriteOffServices.php @@ -49,7 +49,13 @@ class StoreOrderWriteOffServices extends BaseServices */ public function writeOffOrder(string $code, int $confirm, int $uid = 0) { - $orderInfo = $this->dao->getOne(['verify_code' => $code, 'paid' => 1, 'refund_status' => 0, 'is_del' => 0]); + $orderInfo = $this->dao->getOne([ + ['verify_code', '=', $code], + ['paid', '=', 1], + ['refund_status', '=', 0], + ['is_del', '=', 0], + ['pid', '>=', 0] + ]); if (!$orderInfo) { throw new ApiException(410173); } diff --git a/crmeb/app/services/product/product/StoreCategoryServices.php b/crmeb/app/services/product/product/StoreCategoryServices.php index a63a57e7..97ab79f0 100644 --- a/crmeb/app/services/product/product/StoreCategoryServices.php +++ b/crmeb/app/services/product/product/StoreCategoryServices.php @@ -157,8 +157,8 @@ class StoreCategoryServices extends BaseServices $f[] = Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->menus())->filterable(1); } $f[] = Form::input('cate_name', '分类名称', $info['cate_name'] ?? '')->maxlength(8)->required(); - $f[] = Form::frameImage('pic', '分类图标(180*180)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'pic')), $info['pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); - $f[] = Form::frameImage('big_pic', '分类大图(468*340)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'big_pic')), $info['big_pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $f[] = Form::frameImage('pic', '分类图标(180*180)', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'pic')), $info['pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $f[] = Form::frameImage('big_pic', '分类大图(468*340)', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'big_pic')), $info['big_pic'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); $f[] = Form::number('sort', '排序', (int)($info['sort'] ?? 0))->min(0)->precision(0); $f[] = Form::radio('is_show', '状态', $info['is_show'] ?? 1)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]]); return $f; diff --git a/crmeb/app/services/product/product/StoreProductReplyServices.php b/crmeb/app/services/product/product/StoreProductReplyServices.php index 4eec9248..73fc4725 100644 --- a/crmeb/app/services/product/product/StoreProductReplyServices.php +++ b/crmeb/app/services/product/product/StoreProductReplyServices.php @@ -67,12 +67,12 @@ class StoreProductReplyServices extends BaseServices } else { $field[] = Form::hidden('product_id', $product_id); } - $field[] = Form::frameImage('avatar', '用户头像', Url::buildUrl('admin/widget.images/index', array('fodder' => 'avatar')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameImage('avatar', '用户头像', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'avatar')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::input('nickname', '用户名称')->col(24); $field[] = Form::input('comment', '评价文字')->type('textarea'); $field[] = Form::rate('product_score', '商品分数', 0)->allowHalf(false); $field[] = Form::rate('service_score', '服务分数', 0)->allowHalf(false); - $field[] = Form::frameImages('pics', '评价图片', Url::buildUrl('admin/widget.images/index', array('fodder' => 'pics', 'type' => 'many', 'maxLength' => 8)))->maxLength(8)->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->props(['closeBtn' => false, 'okBtn' => false]); + $field[] = Form::frameImages('pics', '评价图片', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'pics', 'type' => 'many', 'maxLength' => 8)))->maxLength(8)->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->props(['closeBtn' => false, 'okBtn' => false]); $field[] = Form::dateTime('add_time', '评论时间', '')->placeholder('请选择评论时间(不选择默认当前添加时间)')->style(['width' => '300px']); return create_form('添加虚拟评论', $field, Url::buildUrl('/product/reply/save_fictitious_reply'), 'POST'); } diff --git a/crmeb/app/services/system/config/SystemConfigServices.php b/crmeb/app/services/system/config/SystemConfigServices.php index a476fbbb..ddffe616 100644 --- a/crmeb/app/services/system/config/SystemConfigServices.php +++ b/crmeb/app/services/system/config/SystemConfigServices.php @@ -442,7 +442,7 @@ class SystemConfigServices extends BaseServices case 1: $data['value'] = json_decode($data['value'], true) ?: ''; if ($data['value'] != '') $data['value'] = set_file_url($data['value']); - $formbuider[] = $this->builder->frameImage($data['menu_name'], $data['info'], $this->url('admin/widget.images/index', ['fodder' => $data['menu_name']], true), $data['value']) + $formbuider[] = $this->builder->frameImage($data['menu_name'], $data['info'], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $data['menu_name']], true), $data['value']) ->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true])->appendRule('suffix', [ 'type' => 'div', 'class' => 'tips-info', @@ -453,7 +453,7 @@ class SystemConfigServices extends BaseServices $data['value'] = json_decode($data['value'], true) ?: []; if ($data['value']) $data['value'] = set_file_url($data['value']); - $formbuider[] = $this->builder->frameImages($data['menu_name'], $data['info'], $this->url('admin/widget.images/index', ['fodder' => $data['menu_name'], 'type' => 'many', 'maxLength' => 5], true), $data['value']) + $formbuider[] = $this->builder->frameImages($data['menu_name'], $data['info'], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $data['menu_name'], 'type' => 'many', 'maxLength' => 5], true), $data['value']) ->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true]) ->appendRule('suffix', [ 'type' => 'div', diff --git a/crmeb/app/services/system/config/SystemGroupDataServices.php b/crmeb/app/services/system/config/SystemGroupDataServices.php index 17a0d42d..567adb97 100644 --- a/crmeb/app/services/system/config/SystemGroupDataServices.php +++ b/crmeb/app/services/system/config/SystemGroupDataServices.php @@ -204,7 +204,7 @@ class SystemGroupDataServices extends BaseServices } else { $image = ''; } - $f[] = Form::frameImage($value["title"], $value["name"], $this->url('admin/widget.images/index', ['fodder' => $value["title"], 'big' => 1], true), $image)->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $f[] = Form::frameImage($value["title"], $value["name"], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $value["title"], 'big' => 1], true), $image)->icon('ios-image')->width('950px')->height('505px')->modal(['footer-hide' => true]); break; case 'uploads': if ($fvalue) { @@ -213,7 +213,7 @@ class SystemGroupDataServices extends BaseServices } else { $images = []; } - $f[] = Form::frameImages($value["title"], $value["name"], $this->url('admin/widget.images/index', ['fodder' => $value["title"], 'big' => 1, 'type' => 'many', 'maxLength' => 5], true), $images)->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true])->spin(0); + $f[] = Form::frameImages($value["title"], $value["name"], $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => $value["title"], 'big' => 1, 'type' => 'many', 'maxLength' => 5], true), $images)->maxLength(5)->icon('ios-images')->width('950px')->height('505px')->modal(['footer-hide' => true])->spin(0); break; default: $f[] = Form::input($value["title"], $value["name"], $fvalue); diff --git a/crmeb/app/services/system/store/SystemStoreStaffServices.php b/crmeb/app/services/system/store/SystemStoreStaffServices.php index 00b3da23..12df25b4 100644 --- a/crmeb/app/services/system/store/SystemStoreStaffServices.php +++ b/crmeb/app/services/system/store/SystemStoreStaffServices.php @@ -101,7 +101,7 @@ class SystemStoreStaffServices extends BaseServices public function createStoreStaffForm(array $formData = []) { if ($formData) { - $field[] = $this->builder->frameImage('image', '更换头像', $this->url('admin/widget.images/index', array('fodder' => 'image'),true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = $this->builder->frameImage('image', '更换头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image'),true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); } else { $field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.User/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); } diff --git a/crmeb/app/services/user/UserLevelServices.php b/crmeb/app/services/user/UserLevelServices.php index b022eed5..8a781697 100644 --- a/crmeb/app/services/user/UserLevelServices.php +++ b/crmeb/app/services/user/UserLevelServices.php @@ -221,8 +221,8 @@ class UserLevelServices extends BaseServices $field[] = Form::number('grade', '等级', isset($vipInfo) ? $vipInfo->grade : 0)->min(0)->precision(0)->col(8)->required(); $field[] = Form::number('discount', '享受折扣', isset($vipInfo) ? $vipInfo->discount : 100)->min(0)->max(100)->col(8)->placeholder('输入折扣数100,代表原价,90代表9折')->required(); $field[] = Form::number('exp_num', '解锁需经验值达到', isset($vipInfo) ? $vipInfo->exp_num : 0)->min(0)->precision(0)->col(8)->required(); - $field[] = Form::frameImage('icon', '图标', Url::buildUrl('admin/widget.images/index', array('fodder' => 'icon')), isset($vipInfo) ? $vipInfo->icon : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); - $field[] = Form::frameImage('image', '用户等级背景', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), isset($vipInfo) ? $vipInfo->image : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameImage('icon', '图标', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'icon')), isset($vipInfo) ? $vipInfo->icon : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameImage('image', '用户等级背景', Url::buildUrl(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image')), isset($vipInfo) ? $vipInfo->image : '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::radio('is_show', '是否显示', isset($vipInfo) ? $vipInfo->is_show : 0)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]])->col(24); return create_form($msg, $field, Url::buildUrl('/user/user_level'), 'POST'); } diff --git a/template/admin/src/main.js b/template/admin/src/main.js index a4011a51..e67a52dd 100644 --- a/template/admin/src/main.js +++ b/template/admin/src/main.js @@ -235,9 +235,9 @@ new Vue({ // this.getMenus().then(menus => { // 处理手动清除db 跳转403问题 if (!menus.length) { - if (path !== '/admin/login') { - this.$router.replace('/admin/login'); - } + // if (path !== '/admin/login') { + // this.$router.replace('/admin/login'); + // } return; } // 在 404 时,是没有 headerName 的 diff --git a/template/admin/vue.config.js b/template/admin/vue.config.js index 1de6eeb4..e7bba642 100644 --- a/template/admin/vue.config.js +++ b/template/admin/vue.config.js @@ -2,8 +2,6 @@ const path = require('path'); const Setting = require('./src/setting.env'); // 引入打包分析文件 const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -// 引入Gzip压缩文件 -const CompressionPlugin = require('compression-webpack-plugin'); // 引入js打包工具 const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); @@ -43,15 +41,6 @@ module.exports = { configureWebpack: (config) => { const pluginsPro = [new BundleAnalyzerPlugin()]; - pluginsPro.push( - new CompressionPlugin({ - algorithm: 'gzip', - test: /\.js$|\.html$|\.css$/, // 匹配文件名 - minRatio: 0.8, // 压缩率小于1才会压缩 - threshold: 10240, // 对超过10k的数据压缩 - deleteOriginalAssets: false, // 是否删除未压缩的源文件,谨慎设置,如果希望提供非gzip的资源,可不设置或者设置为false(比如删除打包后的gz后还可以加载到原始资源文件) - }), - ); pluginsPro.push( // js文件压缩 new UglifyJsPlugin({