Просмотр исходного кода

Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

吴昊天 2 лет назад
Родитель
Сommit
0dcff8298d

+ 3 - 2
crmeb/config/console.php

@@ -14,13 +14,14 @@
 // +----------------------------------------------------------------------
 return [
     // 执行用户(Windows下无效)
-    'user'     => null,
+    'user' => null,
     // 指令定义
     'commands' => [
         'workerman' => \crmeb\command\Workerman::class,
         'timer' => \crmeb\command\Timer::class,
         'make:business' => \crmeb\command\Business::class,
         'make:dao' => \crmeb\command\Dao::class,
-        'make:service'=>\crmeb\command\Service::class,
+        'make:service' => \crmeb\command\Service::class,
+        'util' => \crmeb\command\Util::class
     ],
 ];

+ 78 - 0
crmeb/crmeb/command/Util.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace crmeb\command;
+
+
+use crmeb\exceptions\AdminException;
+use think\console\Command;
+use think\console\Input;
+use think\console\input\Argument;
+use think\console\input\Option;
+use think\console\Output;
+use think\facade\Config;
+use think\facade\Db;
+
+class Util extends Command
+{
+    protected function configure()
+    {
+        $this->setName('util')
+            ->addArgument('type', Argument::REQUIRED, '类型replace')
+            ->addOption('h', null, Option::VALUE_REQUIRED, '替换成当前域名')
+            ->addOption('u', null, Option::VALUE_REQUIRED, '替换的域名')
+            ->setDescription('工具类');
+    }
+
+    protected function execute(Input $input, Output $output)
+    {
+        $type = $input->getArgument('type');
+
+        switch ($type) {
+            case 'replace':
+                $host = $input->getOption('h');
+                $url = $input->getOption('u');
+                if (!$host) {
+                    return $output->error('缺少替换域名');
+                }
+                if (!$url) {
+                    return $output->error('缺少替换的域名');
+                }
+                $this->replaceSiteUrl($host, $url);
+                break;
+        }
+
+        $output->info('执行成功');
+    }
+
+    protected function replaceSiteUrl(string $url, string $siteUrl)
+    {
+        $siteUrlJosn = str_replace('http://', 'http:\\\/\\\/', $siteUrl);
+        $valueJosn = str_replace('http://', 'http:\\\/\\\/', $url);
+        $prefix = Config::get('database.connections.' . Config::get('database.default') . '.prefix');
+        $sql = [
+            "UPDATE `{$prefix}system_attachment` SET `att_dir` = replace(att_dir ,'{$siteUrl}','{$url}'),`satt_dir` = replace(satt_dir ,'{$siteUrl}','{$url}')",
+            "UPDATE `{$prefix}store_product` SET `image` = replace(image ,'{$siteUrl}','{$url}'),`slider_image` = replace(slider_image ,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}store_product_attr_value` SET `image` = replace(image ,'{$siteUrl}','{$url}')",
+            "UPDATE `{$prefix}store_seckill` SET `image` = replace(image ,'{$siteUrl}','{$url}'),`images` = replace(images,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}store_combination` SET `image` = replace(image ,'{$siteUrl}','{$url}'),`images` = replace(images,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}store_bargain` SET `image` = replace(image ,'{$siteUrl}','{$url}'),`images` = replace(images,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}system_config` SET `value` = replace(value ,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}article_category` SET `image` = replace(`image` ,'{$siteUrl}','{$url}')",
+            "UPDATE `{$prefix}article` SET `image_input` = replace(`image_input` ,'{$siteUrl}','{$url}')",
+            "UPDATE `{$prefix}article_content` SET `content` = replace(`content` ,'{$siteUrl}','{$url}')",
+            "UPDATE `{$prefix}store_category` SET `pic` = replace(`pic` ,'{$siteUrl}','{$url}')",
+            "UPDATE `{$prefix}system_group_data` SET `value` = replace(value ,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}eb_diy` SET `value` = replace(value ,'{$siteUrlJosn}','{$valueJosn}')",
+            "UPDATE `{$prefix}store_product_description` SET `description`= replace(description,'{$siteUrl}','{$url}')"
+        ];
+        return Db::transaction(function () use ($sql) {
+            try {
+                foreach ($sql as $item) {
+                    Db::execute($item);
+                }
+            } catch (\Throwable $e) {
+                throw new AdminException(400612, ['msg' => $e->getMessage()]);
+            }
+        });
+    }
+}

+ 1 - 0
template/admin/src/components/main/components/header-bar/header-bar.vue

@@ -19,6 +19,7 @@
 <style scoped lang="less">
 .ivu-icon-ios-refresh {
   font-size: 23px;
+  width: 20px;
 }
 .i-layout-header-trigger {
   position: absolute;

+ 6 - 3
template/admin/src/components/main/components/header-notice/index.vue

@@ -3,7 +3,7 @@
     <Dropdown @on-click="jumpUrl" :transfer="true">
       <div>
         <Badge dot :count="needList.length ? needList.length : 0">
-          <Icon type="ios-notifications-outline" size="24"></Icon>
+          <Icon type="ios-notifications-outline" size="23"></Icon>
         </Badge>
       </div>
       <DropdownMenu slot="list" v-show="needList.length">
@@ -17,17 +17,18 @@
   </div>
 </template>
 <style scoped>
-.ivu-dropdown-item{
+.ivu-dropdown-item {
   display: flex;
   align-items: center;
 }
-.ivu-dropdown-item .iconImg{
+.ivu-dropdown-item .iconImg {
   margin-right: 10px;
 }
 </style>
 <style lang="less">
 .header-notice {
   margin-right: 30px;
+  cursor: pointer;
 }
 .header-notice .ivu-dropdown-item {
   font-size: 14px !important;
@@ -57,6 +58,8 @@
 }
 .header-notice .ivu-badge-dot {
   z-index: 0 !important;
+  top: 4px;
+  right: -4px;
 }
 </style>
 <script>

+ 10 - 8
template/admin/src/components/main/components/reload/reload.vue

@@ -1,6 +1,8 @@
 <template>
   <div class="refresh-btn-con" @click="handleReload">
+    <Tooltip content="刷新" placement="bottom">
       <Icon class="icon" type="ios-refresh" color="rgba(255,255,255,.8)" />
+    </Tooltip>
   </div>
 </template>
 
@@ -24,11 +26,11 @@ export default {
   font-size: 28px;
   color: #f2f2f2;
 }
-.icon:hover{
-  animation: rotate 6s linear infinite; 
-}
-@keyframes rotate {
-    0%{-webkit-transform:rotate(0deg);}
-    100%{-webkit-transform:rotate(360deg);}
-}
-</style>
+// .icon:hover{
+//   animation: rotate 6s linear infinite;
+// }
+// @keyframes rotate {
+//     0%{-webkit-transform:rotate(0deg);}
+//     100%{-webkit-transform:rotate(360deg);}
+// }
+</style>

+ 4 - 4
template/admin/src/pages/user/list/handle/userEdit.vue

@@ -181,10 +181,10 @@ export default {
         levelInfo: [],
       },
       ruleValidate: {
-        real_name: [{ required: true, message: '请输入真实姓名', trigger: 'blur' }],
-        phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' }],
-        pwd: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
-        true_pwd: [{ required: true, message: '请输入确认密码', trigger: 'blur' }],
+        real_name: [{ required: true, message: ' ', trigger: 'blur' }],
+        phone: [{ required: true, message: ' ', trigger: 'blur' }],
+        pwd: [{ required: true, message: ' ', trigger: 'blur' }],
+        true_pwd: [{ required: true, message: ' ', trigger: 'blur' }],
       },
       dataLabel: [],
     };