Procházet zdrojové kódy

Merge branch 'v5.0.0dev' into v5.1.0dev

evoxwht před 2 roky
rodič
revize
0995e8a9ae

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1000 - 1000
crmeb/app/adminapi/controller/UpgradeController.php


+ 3 - 3
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) {

+ 1 - 0
crmeb/app/adminapi/controller/v1/setting/SystemMenus.php

@@ -180,6 +180,7 @@ class SystemMenus extends AuthController
                 'pid' => $menu['path'],
                 'auth_type' => 2,
                 'is_show' => 1,
+                'is_show_path' => 1,
             ];
         }
 

+ 0 - 3
crmeb/app/adminapi/controller/v1/setting/SystemRole.php

@@ -78,9 +78,6 @@ class SystemRole extends AuthController
         if (!is_array($data['rules']) || !count($data['rules']))
             return app('json')->fail(400221);
 
-        $res = app()->make(SystemMenusServices::class)->getColumn([['pid', 'in', $data['rules']]], 'id');
-        $data['rules'] = array_merge($data['rules'], $res);
-
         $data['rules'] = implode(',', $data['rules']);
         if ($id) {
             if (!$this->services->update($id, $data)) return app('json')->fail(100007);

+ 2 - 1
crmeb/app/services/other/QrcodeServices.php

@@ -141,7 +141,7 @@ class QrcodeServices extends BaseServices
         /** @var SystemAttachmentServices $systemAttchment */
         $systemAttchment = app()->make(SystemAttachmentServices::class);
         try {
-            $imageInfo = $systemAttchment->getInfo(['name'=>$name]);
+            $imageInfo = $systemAttchment->getInfo(['name' => $name]);
             $siteUrl = sys_config('site_url');
             if (!$imageInfo) {
                 $codeUrl = PosterServices::setHttpType($siteUrl . $link, request()->isSsl() ? 0 : 1);//二维码链接
@@ -165,6 +165,7 @@ class QrcodeServices extends BaseServices
                 return '';
         }
     }
+
     /**
      * 获取二维码完整路径,不存在则自动生成
      * @param string $name

+ 3 - 6
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 {

+ 1 - 1
crmeb/crmeb/services/pay/storage/V3WechatPay.php

@@ -58,7 +58,7 @@ class V3WechatPay extends BasePay implements PayInterface
                 'appid' => sys_config('routine_appId'),
             ],
             'web' => [
-                'appid' => sys_config('wechat_open_app_id', $wechatAppid),
+                'appid' => $wechatAppid,
             ],
             'v3_payment' => [
                 'mchid' => sys_config('pay_weixin_mchid'),

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 955 - 955
crmeb/public/install/crmeb.sql


+ 46 - 9
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

+ 4 - 0
template/admin/src/layout/navBars/breadcrumb/breadcrumb.vue

@@ -2,6 +2,7 @@
   <div class="layout-navbars-breadcrumb">
     <!-- {{[...breadCrumbList,...crumbPast]}} -->
     <i
+      v-if="collapseShow"
       class="layout-navbars-breadcrumb-icon"
       :class="getThemeConfig.isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
       @click="onThemeConfigChange"
@@ -96,6 +97,9 @@ export default {
         return true;
       }
     },
+    collapseShow() {
+      return  ['defaults','columns'].includes(this.$store.state.themeConfig.themeConfig.layout);
+    },
   },
   mounted() {
     this.initRouteSplit(this.$route.path);

+ 6 - 6
template/admin/src/pages/setting/systemMenus/components/menusFrom.vue

@@ -2,7 +2,7 @@
   <div>
     <Modal
       v-model="modals"
-      width="700"
+      width="500"
       scrollable
       closable
       :title="titleFrom"
@@ -132,11 +132,11 @@ export default {
       searchRule: '',
       iconVal: '',
       grid: {
-        xl: 23,
-        lg: 12,
-        md: 12,
-        sm: 24,
-        xs: 24,
+        xl: 22,
+        lg: 22,
+        md: 22,
+        sm: 22,
+        xs: 22,
       },
       modals: false,
       modal12: false,

+ 5 - 5
template/admin/src/pages/setting/systemMenus/index.vue

@@ -42,10 +42,11 @@
         row-id="id"
       >
         <vxe-table-column field="menu_name" tree-node title="按钮名称" min-width="100"></vxe-table-column>
-        <vxe-table-column field="menu_path" title="路径" min-width="240" tooltip="true">
+        <vxe-table-column field="menu_path" title="类型" min-width="240" tooltip="true">
           <template v-slot="{ row }">
-            <span v-if="row.auth_type == 1">页面:{{ row.menu_path }}</span>
-            <span v-if="row.auth_type == 2">按钮:[{{ row.methods }}]{{ row.api_url }}</span>
+            <span v-if="row.auth_type == 1">菜单:{{ row.menu_path }}</span>
+            <span v-if="row.auth_type == 3">按钮</span>
+            <span v-if="row.auth_type == 2">数据权限</span>
           </template>
         </vxe-table-column>
         <vxe-table-column field="sort" title="排序" width="150"></vxe-table-column>
@@ -58,7 +59,6 @@
               :false-value="0"
               @on-change="onchangeIsShow(row)"
               size="large"
-              v-if="row.auth_type == 1"
             >
               <span slot="open">显示</span>
               <span slot="close">隐藏</span>
@@ -177,7 +177,7 @@ export default {
       roleData: {
         is_show: 1,
         keyword: '',
-        auth_type: 3,
+        // auth_type: 3,
       },
       defaultProps: {
         children: 'children',

+ 48 - 23
template/admin/src/pages/system/systemMenus/components/menusFrom.vue

@@ -2,21 +2,33 @@
   <div>
     <Modal
       v-model="modals"
-      width="700"
+      width="500"
       scrollable
       closable
       :title="titleFrom"
       :mask-closable="false"
       :z-index="1"
       @on-cancel="handleReset"
-      @on-visible-change="visible"
     >
       <Form ref="formValidate" :model="formValidate" :label-width="110" @submit.native.prevent>
         <Row type="flex" :gutter="24">
           <Col v-bind="grid">
-            <FormItem label="按钮名称:" prop="menu_name">
+            <FormItem label="类型:">
+              <RadioGroup v-model="formValidate.auth_type" @on-change="changeAuthType">
+                <Radio :label="item.value" v-for="(item, i) in optionsRadio" :key="i">
+                  <Icon type="social-apple"></Icon>
+                  <span>{{ item.label }}</span>
+                </Radio>
+              </RadioGroup>
+            </FormItem>
+          </Col>
+          <Col v-bind="grid">
+            <FormItem :label="authType == 2 ? '接口名称:' : authType == 1 ? '菜单名称:' : '按钮名称:'" prop="menu_name">
               <div class="add">
-                <Input v-model="formValidate.menu_name" placeholder="请输入按钮名称">
+                <Input
+                  v-model="formValidate.menu_name"
+                  :placeholder="authType == 2 ? '请输入接口名称' : authType == 1 ? '请输入菜单名称' : '请输入按钮名称'"
+                >
                 </Input>
               </div>
             </FormItem>
@@ -26,21 +38,30 @@
               <Cascader :data="menuList" change-on-select v-model="formValidate.path" filterable></Cascader>
             </FormItem>
           </Col>
-          <Col v-bind="grid">
-            <FormItem label="路由地址:" prop="menu_path">
-              <Input v-model="formValidate.menu_path" placeholder="请输入路由地址" @on-change="changeUnique">
+          <Col v-bind="grid" v-if="authType != 2">
+            <FormItem label="页面地址:" prop="menu_path">
+              <Input v-model="formValidate.menu_path" placeholder="请输入页面地址" @on-change="changeUnique">
                 <template #prepend>
                   <span>{{ $routeProStr }}</span>
                 </template>
               </Input>
             </FormItem>
           </Col>
+          <Col v-bind="grid" v-if="authType == 2">
+            <FormItem label="接口地址:" prop="api_url">
+              <Input v-model="formValidate.api_url" placeholder="请输入接口地址" @on-change="changeUnique">
+                <template #prepend>
+                  <span>adminapi/</span>
+                </template>
+              </Input>
+            </FormItem>
+          </Col>
           <Col v-bind="grid">
             <FormItem label="权限标识:" prop="unique_auth">
               <Input v-model="formValidate.unique_auth" placeholder="请输入权限标识"></Input>
             </FormItem>
           </Col>
-          <Col v-bind="grid">
+          <Col v-bind="grid" v-if="authType != 2">
             <FormItem label="图标:">
               <Input
                 v-model="formValidate.icon"
@@ -50,20 +71,14 @@
               ></Input>
             </FormItem>
           </Col>
-
           <Col v-bind="grid">
-            <FormItem label="排序:">
-              <Input type="number" v-model="formValidate.sort" placeholder="请输入排序" number></Input>
+            <FormItem label="备注:">
+              <Input v-model="formValidate.mark" placeholder="请输入备注" number></Input>
             </FormItem>
           </Col>
           <Col v-bind="grid">
-            <FormItem label="类型:">
-              <RadioGroup v-model="formValidate.auth_type">
-                <Radio :label="item.value" v-for="(item, i) in optionsRadio" :key="i">
-                  <Icon type="social-apple"></Icon>
-                  <span>{{ item.label }}</span>
-                </Radio>
-              </RadioGroup>
+            <FormItem label="排序:">
+              <Input type="number" v-model="formValidate.sort" placeholder="请输入排序" number></Input>
             </FormItem>
           </Col>
           <Col v-bind="grid">
@@ -157,11 +172,11 @@ export default {
       searchRule: '',
       iconVal: '',
       grid: {
-        xl: 12,
-        lg: 12,
-        md: 12,
-        sm: 24,
-        xs: 24,
+        xl: 22,
+        lg: 22,
+        md: 22,
+        sm: 22,
+        xs: 22,
       },
       modals: false,
       modal12: false,
@@ -172,12 +187,19 @@ export default {
       search: icon,
       ruleModal: false,
       ruleList: [],
+      authType: 1
     };
   },
   watch: {
     'formValidate.header': function (n) {
       this.formValidate.is_header = n ? 1 : 0;
     },
+    'formValidate.auth_type': function (n) {
+      if (n === undefined) {
+        n = 1;
+      }
+      this.authType = n;
+    },
     'formValidate.data': function (n) {},
   },
   computed: {
@@ -275,6 +297,9 @@ export default {
       if (value.slice(0, 1) === '/') value = value.replace('/', '');
       this.formValidate.unique_auth = value.replaceAll('/', '-');
     },
+    changeAuthType(val) {
+      this.authType = val;
+    },
     selectRule(data) {
       this.$emit('selectRule', data);
       this.$nextTick((e) => {

+ 5 - 5
template/admin/src/pages/system/systemMenus/index.vue

@@ -45,9 +45,9 @@
         <vxe-table-column field="unique_auth" title="前端权限" min-width="200"></vxe-table-column>
         <vxe-table-column field="menu_path" title="路由" min-width="240" tooltip="true">
           <template v-slot="{ row }">
-            <span v-if="row.auth_type == 1">页面:{{ row.menu_path }}</span>
-            <span v-if="row.auth_type == 2">接口:[{{ row.methods }}]{{ row.api_url }}</span>
+            <span v-if="row.auth_type == 1">菜单:{{ row.menu_path }}</span>
             <span v-if="row.auth_type == 3">按钮</span>
+            <span v-if="row.auth_type == 2">接口:[{{ row.methods }}]{{ row.api_url }}</span>
           </template>
         </vxe-table-column>
         <vxe-table-column field="flag" title="规则状态" min-width="120">
@@ -69,9 +69,9 @@
         <vxe-table-column field="date" title="操作" align="right" width="250" fixed="right">
           <template v-slot="{ row }">
             <span>
-              <a @click="addRoute(row)" v-if="row.auth_type === 1 || row.auth_type === 3">添加权限</a>
+              <a @click="addRoute(row)" v-if="row.auth_type === 1 || row.auth_type === 3">选择权限</a>
               <Divider type="vertical" v-if="row.auth_type === 1 || row.auth_type === 3"/>
-              <a @click="addE(row, '添加子菜单')" v-if="row.auth_type === 1">添加子菜单</a>
+              <a @click="addE(row, '添加子菜单')" v-if="row.auth_type === 1">添加下级</a>
               <!-- <a @click="addE(row, '添加规则')" v-else>添加规则</a> -->
             </span>
             <Divider type="vertical" v-if="row.auth_type === 1" />
@@ -101,7 +101,7 @@
     >
       <div class="search-rule">
         <Alert
-          >基础接口,可多选,并且添加后不会再展示出现;删除权限后才会出现;公共接口,可多选,并且添加后会继续展示;</Alert
+          >1.接口可多选,可重复添加;<br>2.添加路由按照路由规则进行添加,即可在开发工具->接口管理里面点击同步;<br>3.同步完成即可在此选择对应的接口;</Alert
         >
         <Input
           class="mr10"

+ 2 - 2
template/admin/src/store/module/themeConfig.js

@@ -44,7 +44,7 @@ const themeConfigModule = {
       // 是否开启菜单手风琴效果
       isUniqueOpened: false,
       // 是否开启固定 Header
-      isFixedHeader: false,
+      isFixedHeader: true,
 
       /**
        * 界面显示
@@ -62,7 +62,7 @@ const themeConfigModule = {
       // 是否开启 TagsView 缓存
       isCacheTagsView: false,
       // 是否开启 Footer 底部版权信息
-      isFooter: false,
+      isFooter: true,
       // 是否开启灰色模式
       isGrayscale: false,
       // 是否开启色弱模式

+ 27 - 18
template/uni-app/App.vue

@@ -97,24 +97,33 @@
 				silenceBindingSpread(this.globalData)
 			}
 			// #ifdef MP
-			if (queryData.query.scene) {
-				switch (queryData.scene) {
-					//扫描小程序码
-					case 1047:
-						this.globalData.code = queryData.query.scene;
-						break;
-						//长按图片识别小程序码
-					case 1048:
-						this.globalData.code = queryData.query.scene;
-						break;
-						//手机相册选取小程序码
-					case 1049:
-						this.globalData.code = queryData.query.scene;
-						break;
-						//直接进入小程序
-					case 1001:
-						this.globalData.spid = queryData.query.scene;
-						break;
+			if (queryData.query.scene) {
+				let param = this.$util.getUrlParams(decodeURIComponent(queryData.query.scene))
+				console.log(queryData.query.scene)
+				console.log(param)
+				if(param.pid){
+					this.$Cache.set('spread', param.pid);
+					this.globalData.spid = param.pid;
+					this.globalData.pid = param.pid;
+				}else{
+					switch (queryData.scene) {
+						//扫描小程序码
+						case 1047:
+							this.globalData.code = queryData.query.scene;
+							break;
+							//长按图片识别小程序码
+						case 1048:
+							this.globalData.code = queryData.query.scene;
+							break;
+							//手机相册选取小程序码
+						case 1049:
+							this.globalData.code = queryData.query.scene;
+							break;
+							//直接进入小程序
+						case 1001:
+							this.globalData.spid = queryData.query.scene;
+							break;
+					}
 				}
 				silenceBindingSpread(this.globalData)
 			}