Explorar o código

wesmiler 报恩寺项目提交

wesmiler %!s(int64=4) %!d(string=hai) anos
pai
achega
c719dafa65
Modificáronse 100 ficheiros con 8756 adicións e 0 borrados
  1. 41 0
      app/Console/Kernel.php
  2. 37 0
      app/Exceptions/Handler.php
  3. 238 0
      app/Exports/Export.php
  4. 191 0
      app/Helpers/Jwt.php
  5. 1571 0
      app/Helpers/common.php
  6. 22 0
      app/Helpers/constants.php
  7. 12 0
      app/Helpers/function.php
  8. 36 0
      app/Http/Controllers/ActionLogController.php
  9. 37 0
      app/Http/Controllers/AdController.php
  10. 50 0
      app/Http/Controllers/AdSortController.php
  11. 165 0
      app/Http/Controllers/Backend.php
  12. 99 0
      app/Http/Controllers/BaseController.php
  13. 36 0
      app/Http/Controllers/CityController.php
  14. 36 0
      app/Http/Controllers/ConfigController.php
  15. 36 0
      app/Http/Controllers/ConfigGroupController.php
  16. 22 0
      app/Http/Controllers/Controller.php
  17. 52 0
      app/Http/Controllers/Demo3Controller.php
  18. 36 0
      app/Http/Controllers/DeptController.php
  19. 36 0
      app/Http/Controllers/DictController.php
  20. 36 0
      app/Http/Controllers/DictTypeController.php
  21. 50 0
      app/Http/Controllers/GenerateController.php
  22. 92 0
      app/Http/Controllers/IndexController.php
  23. 37 0
      app/Http/Controllers/ItemCateController.php
  24. 49 0
      app/Http/Controllers/ItemController.php
  25. 37 0
      app/Http/Controllers/LayoutController.php
  26. 37 0
      app/Http/Controllers/LayoutDescController.php
  27. 91 0
      app/Http/Controllers/LevelController.php
  28. 36 0
      app/Http/Controllers/LinkController.php
  29. 73 0
      app/Http/Controllers/LoginController.php
  30. 36 0
      app/Http/Controllers/LoginLogController.php
  31. 36 0
      app/Http/Controllers/MemberController.php
  32. 49 0
      app/Http/Controllers/MemberLevelController.php
  33. 36 0
      app/Http/Controllers/MenuController.php
  34. 49 0
      app/Http/Controllers/NoticeController.php
  35. 49 0
      app/Http/Controllers/PositionController.php
  36. 72 0
      app/Http/Controllers/RoleController.php
  37. 83 0
      app/Http/Controllers/UploadController.php
  38. 49 0
      app/Http/Controllers/UserController.php
  39. 69 0
      app/Http/Kernel.php
  40. 24 0
      app/Http/Middleware/ActionLog.php
  41. 21 0
      app/Http/Middleware/Authenticate.php
  42. 57 0
      app/Http/Middleware/EnableCrossRequestMiddleware.php
  43. 17 0
      app/Http/Middleware/EncryptCookies.php
  44. 17 0
      app/Http/Middleware/PreventRequestsDuringMaintenance.php
  45. 32 0
      app/Http/Middleware/RedirectIfAuthenticated.php
  46. 18 0
      app/Http/Middleware/TrimStrings.php
  47. 20 0
      app/Http/Middleware/TrustHosts.php
  48. 23 0
      app/Http/Middleware/TrustProxies.php
  49. 47 0
      app/Http/Middleware/UserLogin.php
  50. 17 0
      app/Http/Middleware/VerifyCsrfToken.php
  51. 144 0
      app/Models/ActionLogModel.php
  52. 61 0
      app/Models/AdModel.php
  53. 40 0
      app/Models/AdSortModel.php
  54. 1253 0
      app/Models/BaseModel.php
  55. 291 0
      app/Models/CacheModel.php
  56. 25 0
      app/Models/CityModel.php
  57. 25 0
      app/Models/ConfigGroupModel.php
  58. 25 0
      app/Models/ConfigModel.php
  59. 46 0
      app/Models/Demo3Model.php
  60. 25 0
      app/Models/DeptModel.php
  61. 25 0
      app/Models/DictModel.php
  62. 25 0
      app/Models/DictTypeModel.php
  63. 72 0
      app/Models/ItemCateModel.php
  64. 45 0
      app/Models/ItemModel.php
  65. 49 0
      app/Models/LayoutDescModel.php
  66. 54 0
      app/Models/LayoutModel.php
  67. 25 0
      app/Models/LevelModel.php
  68. 51 0
      app/Models/LinkModel.php
  69. 25 0
      app/Models/MemberLevelModel.php
  70. 57 0
      app/Models/MemberModel.php
  71. 59 0
      app/Models/MenuModel.php
  72. 25 0
      app/Models/NoticeModel.php
  73. 25 0
      app/Models/PositionModel.php
  74. 25 0
      app/Models/RoleMenuModel.php
  75. 25 0
      app/Models/RoleModel.php
  76. 52 0
      app/Models/User.php
  77. 69 0
      app/Models/UserModel.php
  78. 26 0
      app/Models/UserRoleModel.php
  79. 52 0
      app/Providers/AppServiceProvider.php
  80. 30 0
      app/Providers/AuthServiceProvider.php
  81. 21 0
      app/Providers/BroadcastServiceProvider.php
  82. 32 0
      app/Providers/EventServiceProvider.php
  83. 63 0
      app/Providers/RouteServiceProvider.php
  84. 36 0
      app/Services/ActionLogService.php
  85. 63 0
      app/Services/AdService.php
  86. 48 0
      app/Services/AdSortService.php
  87. 230 0
      app/Services/BaseService.php
  88. 71 0
      app/Services/CityService.php
  89. 35 0
      app/Services/ConfigGroupService.php
  90. 61 0
      app/Services/ConfigService.php
  91. 128 0
      app/Services/Demo3Service.php
  92. 58 0
      app/Services/DeptService.php
  93. 65 0
      app/Services/DictService.php
  94. 35 0
      app/Services/DictTypeService.php
  95. 646 0
      app/Services/GenerateService.php
  96. 89 0
      app/Services/ItemCateService.php
  97. 96 0
      app/Services/ItemService.php
  98. 57 0
      app/Services/LayoutDescService.php
  99. 59 0
      app/Services/LayoutService.php
  100. 0 0
      app/Services/LevelService.php

+ 41 - 0
app/Console/Kernel.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Console;
+
+use Illuminate\Console\Scheduling\Schedule;
+use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
+
+class Kernel extends ConsoleKernel
+{
+    /**
+     * The Artisan commands provided by your application.
+     *
+     * @var array
+     */
+    protected $commands = [
+        //
+    ];
+
+    /**
+     * Define the application's command schedule.
+     *
+     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
+     * @return void
+     */
+    protected function schedule(Schedule $schedule)
+    {
+        // $schedule->command('inspire')->hourly();
+    }
+
+    /**
+     * Register the commands for the application.
+     *
+     * @return void
+     */
+    protected function commands()
+    {
+        $this->load(__DIR__.'/Commands');
+
+        require base_path('routes/console.php');
+    }
+}

+ 37 - 0
app/Exceptions/Handler.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Exceptions;
+
+use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
+
+class Handler extends ExceptionHandler
+{
+    /**
+     * A list of the exception types that are not reported.
+     *
+     * @var array
+     */
+    protected $dontReport = [
+        //
+    ];
+
+    /**
+     * A list of the inputs that are never flashed for validation exceptions.
+     *
+     * @var array
+     */
+    protected $dontFlash = [
+        'password',
+        'password_confirmation',
+    ];
+
+    /**
+     * Register the exception handling callbacks for the application.
+     *
+     * @return void
+     */
+    public function register()
+    {
+        //
+    }
+}

+ 238 - 0
app/Exports/Export.php

@@ -0,0 +1,238 @@
+<?php
+
+namespace App\Exports;
+
+use Illuminate\Support\Collection;
+use Maatwebsite\Excel\Concerns\FromCollection;
+use Maatwebsite\Excel\Concerns\WithEvents;
+use Maatwebsite\Excel\Concerns\WithHeadings;
+use Maatwebsite\Excel\Events\AfterSheet;
+use PhpOffice\PhpSpreadsheet\Style\Border;
+
+/**
+ * 导出Excel类
+ * @author 牧羊人
+ * @since 2021/4/10
+ * Class Export
+ * @package App\Exports
+ */
+class Export implements FromCollection, WithHeadings, WithEvents
+{
+    protected $data;
+    protected $headings;
+    protected $columnWidth = [];//设置列宽       key:列  value:宽
+    protected $rowHeight = [];  //设置行高       key:行  value:高
+    protected $mergeCells = []; //合并单元格    value:A1:K8
+    protected $font = [];       //设置字体       key:A1:K8  value:Arial
+    protected $fontSize = [];       //设置字体大小       key:A1:K8  value:11
+    protected $bold = [];       //设置粗体       key:A1:K8  value:true
+    protected $background = []; //设置背景颜色    key:A1:K8  value:#F0F0F0F
+    protected $vertical = [];   //设置定位       key:A1:K8  value:center
+    protected $sheetName; //sheet title
+    protected $borders = []; //设置边框颜色  key:A1:K8  value:#000000
+    //设置页面属性时如果无效   更改excel格式尝试即可
+    //构造函数传值
+    public function __construct($data, $headings, $sheetName)
+    {
+        $this->data = $data;
+        $this->headings = $headings;
+        $this->sheetName = $sheetName;
+        $this->createData();
+    }
+
+    public function headings(): array
+    {
+        return $this->headings;
+    }
+
+    //数组转集合
+    public function collection()
+    {
+        return new Collection($this->data);
+    }
+
+    //业务代码
+    public function createData()
+    {
+        $this->data = collect($this->data)->toArray();
+    }
+
+    public function registerEvents(): array
+    {
+        return [
+            AfterSheet::class => function (AfterSheet $event) {
+                //设置区域单元格垂直居中
+                $event->sheet->getDelegate()->getStyle('A1:Z1265')->getAlignment()->setVertical('center');
+                //设置区域单元格水平居中
+                $event->sheet->getDelegate()->getStyle('A1:Z1265')->getAlignment()->setHorizontal('center');
+                //设置列宽
+                foreach ($this->columnWidth as $column => $width) {
+                    $event->sheet->getDelegate()
+                        ->getColumnDimension($column)
+                        ->setWidth($width);
+                }
+                //设置行高,$i为数据行数
+                foreach ($this->rowHeight as $row => $height) {
+                    $event->sheet->getDelegate()
+                        ->getRowDimension($row)
+                        ->setRowHeight($height);
+                }
+
+                //设置区域单元格垂直居中
+                foreach ($this->vertical as $region => $position) {
+                    $event->sheet->getDelegate()
+                        ->getStyle($region)
+                        ->getAlignment()
+                        ->setVertical($position);
+                }
+
+                //设置区域单元格字体
+                foreach ($this->font as $region => $value) {
+                    $event->sheet->getDelegate()
+                        ->getStyle($region)
+                        ->getFont()->setName($value);
+                }
+                //设置区域单元格字体大小
+                foreach ($this->fontSize as $region => $value) {
+                    $event->sheet->getDelegate()
+                        ->getStyle($region)
+                        ->getFont()
+                        ->setSize($value);
+                }
+
+                //设置区域单元格字体粗体
+                foreach ($this->bold as $region => $bool) {
+                    $event->sheet->getDelegate()
+                        ->getStyle($region)
+                        ->getFont()
+                        ->setBold($bool);
+                }
+
+
+                //设置区域单元格背景颜色
+                foreach ($this->background as $region => $item) {
+                    $event->sheet->getDelegate()->getStyle($region)->applyFromArray([
+                        'fill' => [
+                            'fillType' => 'linear', //线性填充,类似渐变
+                            'startColor' => [
+                                'rgb' => $item //初始颜色
+                            ],
+                            //结束颜色,如果需要单一背景色,请和初始颜色保持一致
+                            'endColor' => [
+                                'argb' => $item
+                            ]
+                        ]
+                    ]);
+                }
+                //设置边框颜色
+                foreach ($this->borders as $region => $item) {
+                    $event->sheet->getDelegate()->getStyle($region)->applyFromArray([
+                        'borders' => [
+                            'allBorders' => [
+                                'borderStyle' => Border::BORDER_THIN,
+                                'color' => ['argb' => $item],
+                            ],
+                        ],
+                    ]);
+                }
+                //合并单元格
+                $event->sheet->getDelegate()->setMergeCells($this->mergeCells);
+                if (!empty($this->sheetName)) {
+                    $event->sheet->getDelegate()->setTitle($this->sheetName);
+                }
+            }
+        ];
+    }
+
+    /**
+     * @return array
+     * [
+     *    'B' => 40,
+     *    'C' => 60
+     * ]
+     */
+    public function setColumnWidth(array $columnwidth)
+    {
+        $this->columnWidth = array_change_key_case($columnwidth, CASE_UPPER);
+    }
+
+    /**
+     * @return array
+     * [
+     *    1 => 40,
+     *    2 => 60
+     * ]
+     */
+    public function setRowHeight(array $rowHeight)
+    {
+        $this->rowHeight = $rowHeight;
+    }
+
+    /**
+     * @return array
+     * [
+     *    A1:K7 => '宋体'
+     * ]
+     */
+    public function setFont(array $font)
+    {
+        $this->font = array_change_key_case($font, CASE_UPPER);
+    }
+
+    /**
+     * @return array
+     * @2020/3/22 10:33
+     * [
+     *    A1:K7 => true
+     * ]
+     */
+    public function setBold(array $bold)
+    {
+        $this->bold = array_change_key_case($bold, CASE_UPPER);
+    }
+
+    /**
+     * @return array
+     * @2020/3/22 10:33
+     * [
+     *    A1:K7 => F0FF0F
+     * ]
+     */
+    public function setBackground(array $background)
+    {
+        $this->background = array_change_key_case($background, CASE_UPPER);
+    }
+
+    /**
+     * @return array
+     * [
+     *    A1:K7
+     * ]
+     */
+    public function setMergeCells(array $mergeCells)
+    {
+        $this->mergeCells = array_change_key_case($mergeCells, CASE_UPPER);
+    }
+
+    /**
+     * @return array
+     * [
+     *    A1:K7 => 14
+     * ]
+     */
+    public function setFontSize(array $fontSize)
+    {
+        $this->fontSize = array_change_key_case($fontSize, CASE_UPPER);
+    }
+
+    /**
+     * @return array
+     * [
+     *    A1:K7 => #000000
+     * ]
+     */
+    public function setBorders(array $borders)
+    {
+        $this->borders = array_change_key_case($borders, CASE_UPPER);
+    }
+}

+ 191 - 0
app/Helpers/Jwt.php

@@ -0,0 +1,191 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Helpers;
+
+/**
+ * JWT鉴权
+ * @author 牧羊人
+ * @since 2020/11/14
+ * Class Jwt
+ * @package App\Helpers
+ */
+class Jwt
+{
+    // 头部
+    private static $header = [
+        'alg' => 'HS256', //生成signature的算法
+        'typ' => 'JWT'    //JWT 令牌统一写为JWT
+    ];
+
+    // 使用HMAC生成信息摘要时所使用的密钥
+    private static $key = '34c68cdccb5b6feb4f7f0a5ede9f5932';
+
+    /**
+     * alg属性表示签名的算法(algorithm),默认是 HMAC SHA256(写成 HS256);typ属性表示这个令牌(token)的类型(type),JWT 令牌统一写为JWT
+     * @return string
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    public function getHeader()
+    {
+        return self::base64UrlEncode(json_encode(self::$header, JSON_UNESCAPED_UNICODE));
+    }
+
+    /**
+     * Payload 部分也是一个 JSON 对象,用来存放实际需要传递的数据
+     * JWT 规定了7个官方字段,供选用,这里可以存放私有信息,比如uid
+     * @param $uid
+     * @return string
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    public function getPayload($uid)
+    {
+        $payload = [
+            'iss' => 'jwt_yh', //签发人
+            'exp' => time() + 60 * 60 * 24 * 7, //过期时间
+            'sub' => 'YH', //主题
+            'aud' => 'every', //受众
+            'nbf' => time(), //生效时间,该时间之前不接收处理该Token
+            'iat' => time(), //签发时间
+            'jti' => 10001, //编号(JWT ID用于标识该JWT)
+            'uid' => $uid, //私有信息,uid
+        ];
+        return self::base64UrlEncode(json_encode($payload, JSON_UNESCAPED_UNICODE));
+    }
+
+    /**
+     * 获取Token
+     * @param array $payload jwt载荷
+     * 格式如下非必须:
+     * [
+     *  'iss'=>'jwt_admin',  //该JWT的签发者
+     *  'iat'=>time(),  //签发时间
+     *  'exp'=>time()+7200,  //过期时间
+     *  'nbf'=>time()+60,  //该时间之前不接收处理该Token
+     *  'sub'=>'www.admin.com',  //面向的用户
+     *  'jti'=>md5(uniqid('JWT').time())  //该Token唯一标识
+     * ]
+     * @return bool|string 返回结果
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    public function getToken($uid)
+    {
+        // 获取JWT头
+        $header = self::getHeader();
+        // 获取JWT有效载荷
+        $payload = self::getPayload($uid);
+        // JWT头拼接JWT有效载荷
+        $raw = $header . '.' . $payload;
+        // Token字符串
+        $token = $raw . '.' . self::signature($raw, self::$key, self::$header['alg']);
+        // 返回Token
+        return $token;
+    }
+
+    /**
+     * 验证token是否有效,默认验证exp,nbf,iat时间
+     * @param string $token token字符串
+     * @return bool|mixed 返回结果
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    public function verifyToken(string $token)
+    {
+        if (!$token) {
+            return false;
+        }
+        $tokens = explode('.', $token);
+        if (count($tokens) != 3) {
+            return false;
+        }
+
+        list($base64header, $base64payload, $sign) = $tokens;
+
+        // 获取jwt算法
+        $base64decodeheader = json_decode(self::base64UrlDecode($base64header), JSON_OBJECT_AS_ARRAY);
+        if (empty($base64decodeheader['alg'])) {
+            return false;
+        }
+
+        //签名验证
+        if (self::signature($base64header . '.' . $base64payload, self::$key, $base64decodeheader['alg']) !== $sign) {
+            return false;
+        }
+
+        $payload = json_decode(self::base64UrlDecode($base64payload), JSON_OBJECT_AS_ARRAY);
+
+        //签发时间大于当前服务器时间验证失败
+        if (isset($payload['iat']) && $payload['iat'] > time()) {
+            return false;
+        }
+
+        //过期时间小宇当前服务器时间验证失败
+        if (isset($payload['exp']) && $payload['exp'] < time()) {
+            return false;
+        }
+
+        //该nbf时间之前不接收处理该Token
+        if (isset($payload['nbf']) && $payload['nbf'] > time()) {
+            return false;
+        }
+
+        return $payload['uid'];
+    }
+
+    /**
+     * base64UrlEncode编码实现
+     * @param string $str 需要编码的字符串
+     * @return mixed 返回结果
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    private static function base64UrlEncode(string $str)
+    {
+        return str_replace('=', '', strtr(base64_encode($str), '+/', '-_'));
+    }
+
+    /**
+     * base64UrlDecode解码实现
+     * @param string $str 需要解码的字符串
+     * @return bool|string 返回结果
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    private static function base64UrlDecode(string $str)
+    {
+        $remainder = strlen($str) % 4;
+        if ($remainder) {
+            $addlen = 4 - $remainder;
+            $str .= str_repeat('=', $addlen);
+        }
+        return base64_decode(strtr($str, '-_', '+/'));
+    }
+
+    /**
+     * HMACSHA256签名实现
+     * @param string $str 待签名字符串
+     * @param string $key 加密密钥
+     * @param string $alg 算法方式
+     * @return mixed 返回结果
+     * @author 牧羊人
+     * @since 2020/11/14
+     */
+    private static function signature(string $str, string $key, string $alg)
+    {
+        $alg_config = array(
+            'HS256' => 'sha256'
+        );
+        return self::base64UrlEncode(hash_hmac($alg_config[$alg], $str, $key, true));
+    }
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1571 - 0
app/Helpers/common.php


+ 22 - 0
app/Helpers/constants.php

@@ -0,0 +1,22 @@
+<?php
+/// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+// 自定义系统常量公共类
+
+define('MESSAGE_OK', '操作成功');
+define('MESSAGE_FAILED', '操作失败');
+define('MESSAGE_SYSTEM_ERROR', '系统繁忙,请稍后再试');
+define('MESSAGE_PARAMETER_MISSING', '参数丢失');
+define('MESSAGE_PARAMETER_ERROR', '参数错误');
+define('MESSAGE_PERMISSON_DENIED', '没有权限');
+define('MESSAGE_INTERNAL_ERROR', '服务器繁忙,请稍后再试');
+
+define('MESSAGE_NEEDLOGIN', '请登录');

+ 12 - 0
app/Helpers/function.php

@@ -0,0 +1,12 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+// 为方便系统核心模块升级,二次开发中需要用到的公共函数请写在此文件中,不允许修改系统核心公共函数common.php文件

+ 36 - 0
app/Http/Controllers/ActionLogController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\ActionLogService;
+
+/**
+ * 行为日志-控制器
+ * @author 牧羊人
+ * @since 2020/11/12
+ * Class ActionLogController
+ * @package App\Http\Controllers
+ */
+class ActionLogController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/12
+     * ActionLogController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new ActionLogService();
+    }
+}

+ 37 - 0
app/Http/Controllers/AdController.php

@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+
+use App\Services\AdService;
+
+/**
+ * 广告管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class AdController
+ * @package App\Http\Controllers
+ */
+class AdController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * AdController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new AdService();
+    }
+}

+ 50 - 0
app/Http/Controllers/AdSortController.php

@@ -0,0 +1,50 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+
+use App\Services\AdSortService;
+
+/**
+ * 广告位管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class AdSortController
+ * @package App\Http\Controllers
+ */
+class AdSortController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * AdSortController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new AdSortService();
+    }
+
+    /**
+     * 获取广告位列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getAdSortList()
+    {
+        $result = $this->service->getAdSortList();
+        return $result;
+    }
+
+}

+ 165 - 0
app/Http/Controllers/Backend.php

@@ -0,0 +1,165 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Helpers\Jwt;
+use App\Models\UserModel;
+use Illuminate\Support\Facades\Session;
+
+/**
+ * 后台控制器基类
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class Backend
+ * @package App\Http\Controllers
+ */
+class Backend extends BaseController
+{
+    // 模型
+    protected $model;
+    // 服务
+    protected $service;
+    // 校验
+    protected $validate;
+    // 登录ID
+    protected $userId;
+    // 登录信息
+    protected $userInfo;
+
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/10
+     * Backend constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        // 初始化配置
+        $this->initConfig();
+
+        // 登录检测中间件
+        $this->middleware('user.login');
+
+        // 初始化登录信息
+        $this->middleware(function ($request, $next) {
+            // 请求头信息
+            $token = $request->headers->get('Authorization');
+            $token = str_replace("Bearer ", null, $token);
+            // JWT解密token
+            $jwt = new Jwt();
+            $userId = $jwt->verifyToken($token);
+
+            // 登录验证
+            $this->initLogin($userId);
+
+            return $next($request);
+        });
+    }
+
+    /**
+     * 初始化配置
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    public function initConfig()
+    {
+        // 请求参数
+        $this->param = \request()->input();
+
+        // 分页基础默认值
+        defined('PERPAGE') or define('PERPAGE', isset($this->param['limit']) ? $this->param['limit'] : 20);
+        defined('PAGE') or define('PAGE', isset($this->param['page']) ? $this->param['page'] : 1);
+    }
+
+    /**
+     * 登录验证
+     * @param $userId 用户ID
+     * @return
+     * @author 牧羊人
+     * @since 2020/8/31
+     */
+    public function initLogin($userId)
+    {
+        // 登录用户ID
+        $this->userId = $userId;
+
+        // 登录用户信息
+        if ($userId) {
+            $adminModel = new UserModel();
+            $userInfo = $adminModel->getInfo($this->userId);
+            $this->userInfo = $userInfo;
+        }
+
+    }
+
+    /**
+     * 获取数据列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function index()
+    {
+        $result = $this->service->getList();
+        return $result;
+    }
+
+    /**
+     * 获取数据详情
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function info()
+    {
+        $result = $this->service->info();
+        return $result;
+    }
+
+    /**
+     * 添加或编辑
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        $result = $this->service->edit();
+        return $result;
+    }
+
+    /**
+     * 删除数据
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function delete()
+    {
+        $result = $this->service->delete();
+        return $result;
+    }
+
+    /**
+     * 设置状态
+     * @return mixed
+     * @since 2020/11/21
+     * @author 牧羊人
+     */
+    public function status()
+    {
+        $result = $this->service->status();
+        return $result;
+    }
+
+}

+ 99 - 0
app/Http/Controllers/BaseController.php

@@ -0,0 +1,99 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 控制器基类
+ */
+class BaseController extends \Illuminate\Routing\Controller
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/10
+     * BaseController constructor.
+     */
+    public function __construct()
+    {
+        // 初始化网络请求配置
+        $this->initRequestConfig();
+
+        // 初始化系统常量
+        $this->initSystemConst();
+    }
+
+    /**
+     * 初始化请求配置
+     * @since 2020/11/10
+     * @author 牧羊人
+     */
+    private function initRequestConfig()
+    {
+        // 定义是否GET请求
+        defined('IS_GET') or define('IS_GET', \request()->isMethod('GET'));
+
+        // 定义是否POST请求
+        defined('IS_POST') or define('IS_POST', \request()->isMethod('POST'));
+
+        // 定义是否AJAX请求
+        defined('IS_AJAX') or define('IS_AJAX', \request()->ajax());
+
+        // 定义是否PAJAX请求
+        defined('IS_PJAX') or define('IS_PJAX', \request()->pjax());
+
+        // 定义是否PUT请求
+        defined('IS_PUT') or define('IS_PUT', \request()->isMethod('PUT'));
+
+        // 定义是否DELETE请求
+        defined('IS_DELETE') or define('IS_DELETE', \request()->isMethod('DELETE'));
+
+        // 请求方式
+        defined('REQUEST_METHOD') or define('REQUEST_METHOD', \request()->method());
+    }
+
+    /**
+     * 初始化系统常量
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    private function initSystemConst()
+    {
+        // 项目根目录
+        defined('ROOT_PATH') or define('ROOT_PATH', base_path());
+
+        // 文件上传目录
+        defined('ATTACHMENT_PATH') or define('ATTACHMENT_PATH', base_path('public/uploads'));
+
+        // 图片上传目录
+        defined('IMG_PATH') or define('IMG_PATH', base_path('public/uploads/images'));
+
+        // 临时存放目录
+        defined('UPLOAD_TEMP_PATH') or define('UPLOAD_TEMP_PATH', ATTACHMENT_PATH . "/temp");
+
+        // 定义普通图片域名
+        defined('IMG_URL') or define('IMG_URL', env('IMG_URL'));
+
+        // 数据表前缀
+        defined('DB_PREFIX') or define('DB_PREFIX', DB::connection()->getTablePrefix());
+
+        // 系统全称
+        define('SITE_NAME', env('SITE_NAME'));
+        // 系统简称
+        define('NICK_NAME', env('NICK_NAME'));
+        // 系统版本号
+        define('VERSION', env('VERSION'));
+    }
+
+}

+ 36 - 0
app/Http/Controllers/CityController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\CityService;
+
+/**
+ * 城市管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class CityController
+ * @package App\Http\Controllers
+ */
+class CityController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * CityController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new CityService();
+    }
+}

+ 36 - 0
app/Http/Controllers/ConfigController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\ConfigService;
+
+/**
+ * 配置管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ConfigController
+ * @package App\Http\Controllers
+ */
+class ConfigController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ConfigController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new ConfigService();
+    }
+}

+ 36 - 0
app/Http/Controllers/ConfigGroupController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\ConfigGroupService;
+
+/**
+ * 配置分组-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ConfigGroupController
+ * @package App\Http\Controllers
+ */
+class ConfigGroupController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ConfigGroupController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new ConfigGroupService();
+    }
+}

+ 22 - 0
app/Http/Controllers/Controller.php

@@ -0,0 +1,22 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+use Illuminate\Foundation\Bus\DispatchesJobs;
+use Illuminate\Foundation\Validation\ValidatesRequests;
+use Illuminate\Routing\Controller as BaseController;
+
+class Controller extends BaseController
+{
+    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+}

+ 52 - 0
app/Http/Controllers/Demo3Controller.php

@@ -0,0 +1,52 @@
+<?php 
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2020 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+
+use App\Services\Demo3Service;
+
+/**
+ * 演示管理-控制器
+ * @author 牧羊人
+ * @since: 2021/04/10
+ * Class Demo3Controller
+ * @package App\Http\Controllers
+ */
+class Demo3Controller extends Backend
+{
+    /**
+     * 构造函数
+     * @param Request $request
+     * @since 2021/04/10
+     * LevelController constructor.
+     * @author 牧羊人
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new Demo3Service();
+    }
+
+	                    	            
+	/**
+	 * 设置是否VIP
+	 * @return mixed
+	 * @since 2021/04/10
+	 * @author 牧羊人
+	 */
+	public function setIsVip()
+	{
+        $result = $this->service->setIsVip();
+        return $result;
+	}
+    	                        
+}

+ 36 - 0
app/Http/Controllers/DeptController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\DeptService;
+
+/**
+ * 部门管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DeptController
+ * @package App\Http\Controllers
+ */
+class DeptController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * DeptController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new DeptService();
+    }
+}

+ 36 - 0
app/Http/Controllers/DictController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\DictService;
+
+/**
+ * 字典管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DictController
+ * @package App\Http\Controllers
+ */
+class DictController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * DictController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new DictService();
+    }
+}

+ 36 - 0
app/Http/Controllers/DictTypeController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\DictTypeService;
+
+/**
+ * 字典类型-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DictTypeController
+ * @package App\Http\Controllers
+ */
+class DictTypeController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * DictTypeController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new DictTypeService();
+    }
+}

+ 50 - 0
app/Http/Controllers/GenerateController.php

@@ -0,0 +1,50 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+
+use App\Services\GenerateService;
+
+/**
+ * 代码生成器-控制器
+ * @author 牧羊人
+ * @since 2020/11/12
+ * Class GenerateController
+ * @package App\Http\Middleware
+ */
+class GenerateController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/12
+     * GenerateController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new GenerateService();
+    }
+
+    /**
+     * 一键生成模块
+     * @return mixed
+     * @since 2020/11/12
+     * @author 牧羊人
+     */
+    public function generate()
+    {
+        $result = $this->service->generate();
+        return $result;
+    }
+
+}

+ 92 - 0
app/Http/Controllers/IndexController.php

@@ -0,0 +1,92 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Models\UserModel;
+use App\Models\AdminRomModel;
+use App\Services\AdminService;
+use App\Services\MenuService;
+use App\Services\UserService;
+
+/**
+ * 系统主页控制器
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class IndexController
+ * @package App\Http\Controllers
+ */
+class IndexController extends Backend
+{
+
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/10
+     * IndexController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * 后台主页
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    public function getMenuList()
+    {
+        $menuService = new MenuService();
+        $menuList = $menuService->getPermissionList($this->userId);
+        return $menuList;
+    }
+
+    /**
+     * 获取个人信息
+     * @return array
+     * @since 2020/11/10
+     * @author 牧羊人
+     */
+    public function getUserInfo()
+    {
+        $userService = new UserService();
+        $result = $userService->getUserInfo($this->userId);
+        return $result;
+    }
+
+    /**
+     * 更新个人资料
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function updateUserInfo()
+    {
+        $userService = new UserService();
+        $result = $userService->updateUserInfo($this->userId);
+        return $result;
+    }
+
+    /**
+     * 更新密码
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function updatePwd()
+    {
+        $userService = new UserService();
+        $result = $userService->updatePwd($this->userId);
+        return $result;
+    }
+
+}

+ 37 - 0
app/Http/Controllers/ItemCateController.php

@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+
+use App\Services\ItemCateService;
+
+/**
+ * 栏目管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ItemCateController
+ * @package App\Http\Controllers
+ */
+class ItemCateController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ItemCateController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new ItemCateService();
+    }
+}

+ 49 - 0
app/Http/Controllers/ItemController.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\ItemService;
+
+/**
+ * 站点管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ItemController
+ * @package App\Http\Controllers
+ */
+class ItemController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ItemController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new ItemService();
+    }
+
+    /**
+     * 获取站点列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getItemList()
+    {
+        $result = $this->service->getItemList();
+        return $result;
+    }
+
+}

+ 37 - 0
app/Http/Controllers/LayoutController.php

@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\LayoutService;
+
+/**
+ * 布局管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LayoutController
+ * @package App\Http\Controllers
+ */
+class LayoutController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * LayoutController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new LayoutService();
+    }
+
+}

+ 37 - 0
app/Http/Controllers/LayoutDescController.php

@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+
+use App\Services\LayoutDescService;
+
+/**
+ * 布局描述-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LayoutDescController
+ * @package App\Http\Controllers
+ */
+class LayoutDescController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * LayoutDescController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new LayoutDescService();
+    }
+}

+ 91 - 0
app/Http/Controllers/LevelController.php

@@ -0,0 +1,91 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Exports\Export;
+use App\Models\LevelModel;
+use App\Services\LevelService;
+use Maatwebsite\Excel\Facades\Excel;
+
+/**
+ * 职级管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LevelController
+ * @package App\Http\Controllers
+ */
+class LevelController extends Backend
+{
+
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * LevelController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->model = new LevelModel();
+        $this->service = new LevelService();
+    }
+
+    /**
+     * 获取职级列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getLevelList()
+    {
+        $result = $this->service->getLevelList();
+        return $result;
+    }
+
+    /**
+     * 导出Excel
+     * @author 牧羊人
+     * @since 2021/4/10
+     */
+    public function exportExcel()
+    {
+        // 参数
+        $param = request()->all();
+        // 文件名称
+        $fileName = date('YmdHis') . '.xlsx';
+        // 表格头
+        $header = ['职级ID', '职级名称', '职级状态', '排序'];
+        // 获取数据源
+        $result = $this->model->where("mark", "=", 1)->get()->toArray();
+        $list = [];
+        if (!empty($result)) {
+            foreach ($result as $key => $val) {
+                $data = [];
+                $data['id'] = $val['id'];
+                $data['name'] = $val['name'];
+                $data['status'] = $val['status'] == 1 ? "在用" : "停用";
+                $data['sort'] = $val['sort'];
+                $list[] = $data;
+            }
+        }
+        // 保存文件
+        if (!Excel::store(new Export($list, $header, "职级列表"), "" . $fileName)) {
+            return message(MESSAGE_FAILED, false);
+        }
+        // 移动文件
+        copy(storage_path("app") . "/" . $fileName, UPLOAD_TEMP_PATH . "/" . $fileName);
+        // 下载地址
+        $fileUrl = get_image_url(str_replace(ATTACHMENT_PATH, "", UPLOAD_TEMP_PATH) . "/" . $fileName);
+        return message(MESSAGE_OK, true, $fileUrl);
+    }
+
+}

+ 36 - 0
app/Http/Controllers/LinkController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\LinkService;
+
+/**
+ * 友链管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LinkController
+ * @package App\Http\Controllers
+ */
+class LinkController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * LinkController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new LinkService();
+    }
+}

+ 73 - 0
app/Http/Controllers/LoginController.php

@@ -0,0 +1,73 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Models\ActionLogModel;
+use App\Services\LoginService;
+
+/**
+ * 登录控制器
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class LoginController
+ * @package App\Http\Controllers
+ */
+class LoginController extends Backend
+{
+
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/10
+     * LoginController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new LoginService();
+    }
+
+    /**
+     * 获取验证码
+     * @return mixed
+     * @since 2020/11/10
+     * @author 牧羊人
+     */
+    public function captcha()
+    {
+        $result = $this->service->captcha();
+        return $result;
+    }
+
+    /**
+     * 系统登录
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    public function login()
+    {
+        $result = $this->service->login();
+        return $result;
+    }
+
+    /**
+     * 退出系统
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    public function logout()
+    {
+        $result = $this->service->logout();
+        return $result;
+    }
+
+}

+ 36 - 0
app/Http/Controllers/LoginLogController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\LoginLogService;
+
+/**
+ * 登录日志-控制器
+ * @author 牧羊人
+ * @since 2020/11/12
+ * Class LoginLogController
+ * @package App\Http\Controllers
+ */
+class LoginLogController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/12
+     * LoginLogController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new LoginLogService();
+    }
+}

+ 36 - 0
app/Http/Controllers/MemberController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\MemberService;
+
+/**
+ * 会员管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class MemberController
+ * @package App\Http\Controllers
+ */
+class MemberController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * MemberController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new MemberService();
+    }
+}

+ 49 - 0
app/Http/Controllers/MemberLevelController.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\MemberLevelService;
+
+/**
+ * 会员等级-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class MemberLevelController
+ * @package App\Http\Controllers
+ */
+class MemberLevelController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * MemberLevelController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new MemberLevelService();
+    }
+
+    /**
+     * 获取会员等级列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getMemberLevelList()
+    {
+        $result = $this->service->getMemberLevelList();
+        return $result;
+    }
+
+}

+ 36 - 0
app/Http/Controllers/MenuController.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\MenuService;
+
+/**
+ * 菜单管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class MenuController
+ * @package App\Http\Controllers
+ */
+class MenuController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * MenuController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new MenuService();
+    }
+}

+ 49 - 0
app/Http/Controllers/NoticeController.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\NoticeService;
+
+/**
+ * 通知公告-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class NoticeController
+ * @package App\Http\Controllers
+ */
+class NoticeController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * NoticeController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new NoticeService();
+    }
+
+    /**
+     * 设置置顶
+     * @return mixed
+     * @since 2020/11/21
+     * @author 牧羊人
+     */
+    public function setIsTop()
+    {
+        $result = $this->service->setIsTop();
+        return $result;
+    }
+
+}

+ 49 - 0
app/Http/Controllers/PositionController.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\PositionService;
+
+/**
+ * 岗位管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class PositionController
+ * @package App\Http\Controllers
+ */
+class PositionController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * PositionController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new PositionService();
+    }
+
+    /**
+     * 获取岗位列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getPositionList()
+    {
+        $result = $this->service->getPositionList();
+        return $result;
+    }
+
+}

+ 72 - 0
app/Http/Controllers/RoleController.php

@@ -0,0 +1,72 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\RoleService;
+
+/**
+ * 角色管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class RoleController
+ * @package App\Http\Controllers
+ */
+class RoleController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * RoleController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new RoleService();
+    }
+
+    /**
+     * 获取角色列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getRoleList()
+    {
+        $result = $this->service->getRoleList();
+        return $result;
+    }
+
+    /**
+     * 获取角色权限列表
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getPermissionList()
+    {
+        $result = $this->service->getPermissionList();
+        return $result;
+    }
+
+    /**
+     * 保存权限
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function savePermission()
+    {
+        $result = $this->service->savePermission();
+        return $result;
+    }
+
+}

+ 83 - 0
app/Http/Controllers/UploadController.php

@@ -0,0 +1,83 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+
+/**
+ * 上传文件-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class UploadController
+ * @package App\Http\Controllers
+ */
+class UploadController extends Backend
+{
+
+    /**
+     * 上传图片
+     * @param Request $request 网络请求
+     * @return array
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function uploadImage(Request $request)
+    {
+        // 上传单图统一调取方法
+        $result = upload_image($request, 'file');
+        if (!$result['success']) {
+            return message($result['message'], false);
+        }
+
+        // 文件路径
+        $file_path = $result['data']['img_path'];
+        if (!$file_path) {
+            return message("文件上传失败", false);
+        }
+
+        // 网络域名拼接
+        if (strpos($file_path, IMG_URL) === false) {
+            $file_path = IMG_URL . $file_path;
+        }
+
+        // 返回结果
+        return message(MESSAGE_OK, true, $file_path);
+    }
+
+    /**
+     * 上传文件(单个上传)
+     * @param Request $request
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function uploadFile(Request $request)
+    {
+        $result = upload_file($request);
+        if (!$result['success']) {
+            $this->jsonReturn(MESSAGE_FAILED, false, $result['message']);
+        }
+        // 文件路径
+        $file_path = $result['data']['file_path'];
+        if (!$file_path) {
+            $this->jsonReturn(message("文件上传失败"));
+        }
+
+        // 网络域名拼接
+        if (strpos($file_path, IMG_URL) === false) {
+            $file_path = IMG_URL . $file_path;
+        }
+
+        // 返回结果
+        $this->jsonReturn(MESSAGE_OK, true, $file_path);
+    }
+
+}

+ 49 - 0
app/Http/Controllers/UserController.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\UserService;
+
+/**
+ * 用户管理-控制器
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class UserController
+ * @package App\Http\Controllers
+ */
+class UserController extends Backend
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * UserController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new UserService();
+    }
+
+    /**
+     * 重置密码
+     * @return mixed
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function resetPwd()
+    {
+        $result = $this->service->resetPwd();
+        return $result;
+    }
+
+}

+ 69 - 0
app/Http/Kernel.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace App\Http;
+
+use App\Http\Middleware\EnableCrossRequestMiddleware;
+use Illuminate\Foundation\Http\Kernel as HttpKernel;
+
+class Kernel extends HttpKernel
+{
+    /**
+     * The application's global HTTP middleware stack.
+     *
+     * These middleware are run during every request to your application.
+     *
+     * @var array
+     */
+    protected $middleware = [
+        // \App\Http\Middleware\TrustHosts::class,
+        \App\Http\Middleware\TrustProxies::class,
+        \Fruitcake\Cors\HandleCors::class,
+        \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
+        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
+        \App\Http\Middleware\TrimStrings::class,
+        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
+        \App\Http\Middleware\EnableCrossRequestMiddleware::class,
+    ];
+
+    /**
+     * The application's route middleware groups.
+     *
+     * @var array
+     */
+    protected $middlewareGroups = [
+        'web' => [
+            \App\Http\Middleware\EncryptCookies::class,
+            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
+            \Illuminate\Session\Middleware\StartSession::class,
+            // \Illuminate\Session\Middleware\AuthenticateSession::class,
+            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+//            \App\Http\Middleware\VerifyCsrfToken::class,
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        ],
+
+        'api' => [
+            'throttle:api',
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        ],
+    ];
+
+    /**
+     * The application's route middleware.
+     *
+     * These middleware may be assigned to groups or used individually.
+     *
+     * @var array
+     */
+    protected $routeMiddleware = [
+        'auth' => \App\Http\Middleware\Authenticate::class,
+        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
+        'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
+        'can' => \Illuminate\Auth\Middleware\Authorize::class,
+        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
+        'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
+        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
+        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
+        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
+        'user.login' => \App\Http\Middleware\UserLogin::class,
+    ];
+}

+ 24 - 0
app/Http/Middleware/ActionLog.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Models\ActionLogModel;
+use Closure;
+
+class ActionLog
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param \Illuminate\Http\Request $request
+     * @param \Closure $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        if ($request->isMethod('post')) {
+            ActionLogModel::record();
+        }
+        return $next($request);
+    }
+}

+ 21 - 0
app/Http/Middleware/Authenticate.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Auth\Middleware\Authenticate as Middleware;
+
+class Authenticate extends Middleware
+{
+    /**
+     * Get the path the user should be redirected to when they are not authenticated.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return string|null
+     */
+    protected function redirectTo($request)
+    {
+        if (! $request->expectsJson()) {
+            return route('login');
+        }
+    }
+}

+ 57 - 0
app/Http/Middleware/EnableCrossRequestMiddleware.php

@@ -0,0 +1,57 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Middleware;
+
+use Closure;
+use Illuminate\Http\Request;
+
+/**
+ * 跨域解决方案
+ * @author 牧羊人
+ * @since 2021/1/10
+ * Class EnableCrossRequestMiddleware
+ * @package App\Http\Middleware
+ */
+class EnableCrossRequestMiddleware
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param \Illuminate\Http\Request $request
+     * @param \Closure $next
+     * @return mixed
+     */
+    public function handle(Request $request, Closure $next)
+    {
+        $response = $next($request);
+        $origin = $request->server('HTTP_ORIGIN') ? $request->server('HTTP_ORIGIN') : '';
+        $allow_origin = [
+            'http://localhost:8080',
+            'http://manage.evl.pro.rxthink.cn',
+        ];
+        if (in_array($origin, $allow_origin)) {
+            //允许所有资源跨域
+            $response->header('Access-Control-Allow-Origin', $origin);
+            // 允许通过的响应报头
+            $response->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Cookie, X-CSRF-TOKEN, Accept, Authorization, X-XSRF-TOKEN');
+            // 允许axios获取响应头中的Authorization
+            $response->header('Access-Control-Expose-Headers', 'Authorization, authenticated');
+            // 允许的请求方法
+            $response->header('Access-Control-Allow-Methods', 'GET, POST, PATCH, PUT, OPTIONS, DELETE');
+            //允许的请求方法
+            $response->header('Allow', 'GET, POST, PATCH, PUT, OPTIONS, delete');
+            // 运行客户端携带证书式访问
+            $response->header('Access-Control-Allow-Credentials', 'true');
+        }
+        return $response;
+    }
+}

+ 17 - 0
app/Http/Middleware/EncryptCookies.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
+
+class EncryptCookies extends Middleware
+{
+    /**
+     * The names of the cookies that should not be encrypted.
+     *
+     * @var array
+     */
+    protected $except = [
+        //
+    ];
+}

+ 17 - 0
app/Http/Middleware/PreventRequestsDuringMaintenance.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
+
+class PreventRequestsDuringMaintenance extends Middleware
+{
+    /**
+     * The URIs that should be reachable while maintenance mode is enabled.
+     *
+     * @var array
+     */
+    protected $except = [
+        //
+    ];
+}

+ 32 - 0
app/Http/Middleware/RedirectIfAuthenticated.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Providers\RouteServiceProvider;
+use Closure;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
+
+class RedirectIfAuthenticated
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @param  string|null  ...$guards
+     * @return mixed
+     */
+    public function handle(Request $request, Closure $next, ...$guards)
+    {
+        $guards = empty($guards) ? [null] : $guards;
+
+        foreach ($guards as $guard) {
+            if (Auth::guard($guard)->check()) {
+                return redirect(RouteServiceProvider::HOME);
+            }
+        }
+
+        return $next($request);
+    }
+}

+ 18 - 0
app/Http/Middleware/TrimStrings.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
+
+class TrimStrings extends Middleware
+{
+    /**
+     * The names of the attributes that should not be trimmed.
+     *
+     * @var array
+     */
+    protected $except = [
+        'password',
+        'password_confirmation',
+    ];
+}

+ 20 - 0
app/Http/Middleware/TrustHosts.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Http\Middleware\TrustHosts as Middleware;
+
+class TrustHosts extends Middleware
+{
+    /**
+     * Get the host patterns that should be trusted.
+     *
+     * @return array
+     */
+    public function hosts()
+    {
+        return [
+            $this->allSubdomainsOfApplicationUrl(),
+        ];
+    }
+}

+ 23 - 0
app/Http/Middleware/TrustProxies.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Fideloper\Proxy\TrustProxies as Middleware;
+use Illuminate\Http\Request;
+
+class TrustProxies extends Middleware
+{
+    /**
+     * The trusted proxies for this application.
+     *
+     * @var array|string|null
+     */
+    protected $proxies;
+
+    /**
+     * The headers that should be used to detect proxies.
+     *
+     * @var int
+     */
+    protected $headers = Request::HEADER_X_FORWARDED_ALL;
+}

+ 47 - 0
app/Http/Middleware/UserLogin.php

@@ -0,0 +1,47 @@
+<?php
+
+
+namespace App\Http\Middleware;
+
+use App\Helpers\Jwt;
+use Closure;
+use Illuminate\Auth\Middleware\Authenticate as Middleware;
+
+class UserLogin extends Middleware
+{
+    /**
+     * 执行句柄
+     * @param \Illuminate\Http\Request $request
+     * @param Closure $next
+     * @param mixed ...$guards
+     * @return mixed
+     * @throws \Illuminate\Auth\AuthenticationException
+     * @since 2020/8/31
+     * @author 牧羊人
+     */
+    public function handle($request, Closure $next, ...$guards)
+    {
+        $response = $next($request);
+
+        $action = app('request')->route()->getAction();
+        $controller = class_basename($action['controller']);
+        list($controller, $action) = explode('@', $controller);
+        $noLoginActs = ['LoginController'];
+        $token = $request->headers->get('Authorization');
+        if (strpos($token, 'Bearer ') !== false) {
+            $token = str_replace("Bearer ", null, $token);
+            // JWT解密token
+            $jwt = new Jwt();
+            $userId = $jwt->verifyToken($token);
+        } else {
+            $userId = 0;
+        }
+        if (!$userId && !in_array($controller, $noLoginActs)) {
+            // 判断用户未登录就跳转至登录页面
+            // 在这里可以定制你想要的返回格式, 亦或者是 JSON 编码格式
+            return response()->json(message("请登录", false, null, 401));
+        }
+        //如果已登录则执行正常的请求
+        return $response;
+    }
+}

+ 17 - 0
app/Http/Middleware/VerifyCsrfToken.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
+
+class VerifyCsrfToken extends Middleware
+{
+    /**
+     * The URIs that should be excluded from CSRF verification.
+     *
+     * @var array
+     */
+    protected $except = [
+        //
+    ];
+}

+ 144 - 0
app/Models/ActionLogModel.php

@@ -0,0 +1,144 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 行为日志-模型
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class ActionLogModel
+ * @package App\Models
+ */
+class ActionLogModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = null;
+    // 自定义日志标题
+    protected static $title = '';
+    // 自定义日志内容
+    protected static $content = '';
+
+    public function __construct()
+    {
+        // 设置表名
+        $this->table = 'action_log_' . date('Y') . '_' . date('m');
+        // 初始化行为日志表
+        $this->initTable();
+    }
+
+    /**
+     * 初始化行为日志表
+     * @return string|null
+     * @since 2020/11/10
+     * @author 牧羊人
+     */
+    private function initTable()
+    {
+        $tbl = DB_PREFIX . $this->table;
+        if (!$this->tableExists($tbl)) {
+            $sql = "CREATE TABLE `{$tbl}` (
+                  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '唯一性标识',
+                  `username` varchar(60) CHARACTER SET utf8mb4 NOT NULL COMMENT '操作人用户名',
+                  `method` varchar(20) CHARACTER SET utf8mb4 NOT NULL COMMENT '请求类型',
+                  `module` varchar(30) NOT NULL COMMENT '模型',
+                  `action` varchar(255) NOT NULL COMMENT '操作方法',
+                  `url` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '操作页面',
+                  `param` text CHARACTER SET utf8mb4 NOT NULL COMMENT '请求参数(JSON格式)',
+                  `title` varchar(100) NOT NULL COMMENT '日志标题',
+                  `type` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '操作类型:1登录系统 2注销系统',
+                  `content` varchar(1000) NOT NULL DEFAULT '' COMMENT '内容',
+                  `ip` varchar(18) CHARACTER SET utf8mb4 NOT NULL COMMENT 'IP地址',
+                  `user_agent` varchar(360) CHARACTER SET utf8mb4 NOT NULL COMMENT 'User-Agent',
+                  `create_user` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加人',
+                  `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
+                  `update_user` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新人',
+                  `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
+                  `mark` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '有效标识:1正常 0删除',
+                  PRIMARY KEY (`id`) USING BTREE
+                ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='系统行为日志表';";
+            DB::select($sql);
+        }
+        return $tbl;
+    }
+
+    /**
+     * 设置标题
+     * @param $title 标题
+     * @since 2020/11/10
+     * @author 牧羊人
+     */
+    public static function setTitle($title)
+    {
+        self::$title = $title;
+    }
+
+    /**
+     * 设置内容
+     * @param $content 内容
+     * @since 2020/11/10
+     * @author 牧羊人
+     */
+    public static function setContent($content)
+    {
+        self::$content = $content;
+    }
+
+    /**
+     * 创建行为日志
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    public static function record()
+    {
+        if (!self::$title) {
+            // 操作控制器名
+            $menuModel = new MenuModel();
+            $info = $menuModel->getOne([
+                ['url', '=', request()->url()],
+            ]);
+            if ($info) {
+                if ($info['type'] == 1) {
+                    $menuInfo = $menuModel->getInfo($info['pid']);
+                    self::$title = $menuInfo['title'];
+                } else {
+                    self::$title = $info['title'];
+                }
+            }
+        }
+
+        // 登录用户ID
+        $userId = session('userId');
+        $userModel = new UserModel();
+        $userInfo = $userModel->getInfo($userId);
+
+        // 日志数据
+        $data = [
+            'username' => isset($userInfo['username']) ? $userInfo['username'] : '未知',
+            'module' => 'admin',
+            'action' => request()->path(),
+            'method' => request()->method(),
+            'url' => request()->url(true), // 获取完成URL
+            'param' => request()->all() ? json_encode(request()->all()) : '',
+            'title' => self::$title ? self::$title : '操作日志',
+            'type' => self::$title == '登录系统' ? 1 : (self::$title == '注销系统' ? 2 : 0),
+            'content' => self::$content,
+            'ip' => request()->ip(),
+            'user_agent' => request()->server('HTTP_USER_AGENT'),
+            'create_user' => empty(session('userId')) ? 0 : session('userId'),
+            'create_time' => time(),
+        ];
+        // 日志入库
+        self::insert($data);
+    }
+}

+ 61 - 0
app/Models/AdModel.php

@@ -0,0 +1,61 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 广告管理-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class AdModel
+ * @package App\Models
+ */
+class AdModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'ad';
+
+    /**
+     * 获取广告信息
+     * @param int $id
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 广告封面
+            if ($info['cover']) {
+                $info['cover'] = get_image_url($info['cover']);
+            }
+            // 开始时间
+            if ($info['start_time']) {
+                $info['start_time'] = datetime($info['start_time']);
+            }
+            // 结束时间
+            if ($info['end_time']) {
+                $info['end_time'] = datetime($info['end_time']);
+            }
+            // 广告位
+            if ($info['ad_sort_id']) {
+                $adSortModel = new AdSortModel();
+                $adSortInfo = $adSortModel->getInfo($info['ad_sort_id']);
+                if ($adSortInfo) {
+                    $info['ad_sort_name'] = $adSortInfo['description'] . ">>" . $adSortInfo['loc_id'];
+                }
+            }
+        }
+        return $info;
+    }
+
+}

+ 40 - 0
app/Models/AdSortModel.php

@@ -0,0 +1,40 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 广告位管理-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class AdSortModel
+ * @package App\Models
+ */
+class AdSortModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'ad_sort';
+
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 获取栏目名称
+            if ($info['cate_id']) {
+                $itemCateModel = new ItemCateModel();
+                $itemCateName = $itemCateModel->getCateName($info['cate_id'], ">>");
+                $info['item_cate_name'] = $itemCateName;
+            }
+        }
+        return $info;
+    }
+
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1253 - 0
app/Models/BaseModel.php


+ 291 - 0
app/Models/CacheModel.php

@@ -0,0 +1,291 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\Cache;
+
+/**
+ * 缓存模型
+ * @author zongjl
+ * @date 2019/5/23
+ * Class CacheModel
+ * @package App\Models
+ */
+class CacheModel extends Model
+{
+    // 是否启用缓存
+    protected $is_cache = true;
+
+    /**
+     * 重置缓存
+     * @param int $id 记录ID
+     * @param array $data 数据源
+     * @param bool $is_edit 是否编辑
+     * @return bool 返回结果
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function cacheReset($id, $data = [], $is_edit = false)
+    {
+        if (!$data) {
+            $this->resetCacheFunc('info', $id);
+        }
+        $info = [];
+        if ($is_edit) {
+            $info = $this->getCacheFunc("info", $id);
+        }
+        if (is_array($data)) {
+            $info = array_merge($info, $data);
+        } else {
+            $info = $data;
+        }
+        $cache_key = $this->getCacheKey('info', $id);
+        $result = $this->setCache($cache_key, $info);
+        return $result;
+    }
+
+    /**
+     * 删除缓存
+     * @param int $id 删除缓存ID
+     * @return bool 返回true或false
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function cacheDelete($id)
+    {
+        $cache_key = $this->getCacheKey("info", $id);
+        $result = $this->deleteCache($cache_key);
+        return $result;
+    }
+
+    /**
+     * 设置单条数据缓存
+     * @param int $id 记录ID
+     * @return array 返回结果
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function cacheInfo($id)
+    {
+        if (!$id) {
+            return false;
+        }
+        $data = $this->find((int)$id);
+        return $data ? $data->toArray() : [];
+    }
+
+    /**
+     * 获取缓存KEY
+     * @return string 缓存KEY
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function getCacheKey()
+    {
+        $arg_list = func_get_args();
+        if ($this->table) {
+            array_unshift($arg_list, $this->table);
+        }
+        foreach ($arg_list as $key => $val) {
+            if (is_array($val)) {
+                unset($arg_list[$key]);
+            }
+        }
+        $cache_key = implode("_", $arg_list);
+        return $cache_key;
+    }
+
+    /**
+     * 设置缓存
+     * @param string $cache_key 缓存KEY
+     * @param array $data 缓存数据
+     * @param int $ttl 过期时间
+     * @return bool 返回结果
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function setCache($cache_key, $data, $ttl = 0)
+    {
+        if (isset($GLOBALS['trans']) && $GLOBALS['trans'] === true) {
+            $GLOBALS['trans_keys'][] = $cache_key;
+        }
+
+        // 不设置缓存,直接返回
+        if (!$this->is_cache) {
+            return true;
+        }
+        if (!$data) {
+            return Cache::put($cache_key, null, $ttl);
+        }
+        $isGzcompress = gzcompress(json_encode($data));
+        if ($isGzcompress) {
+            $result = Cache::put($cache_key, $isGzcompress);
+        }
+        return $result;
+    }
+
+    /**
+     * 获取缓存
+     * @param string $cache_key 缓存KEY
+     * @return mixed 返回缓存数据
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function getCache($cache_key)
+    {
+        $data = Cache::get($cache_key);
+        if ($data) {
+            $data = json_decode(gzuncompress($data), true);
+        }
+        return $data;
+    }
+
+    /**
+     * 删除缓存
+     * @param string $cache_key 缓存KEY
+     * @return bool 返回结果true或false
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function deleteCache($cache_key)
+    {
+        // 判断缓存键值是否存在,存在则删除
+        if (Cache::has($cache_key)) {
+            return Cache::forget($cache_key);
+        }
+        return false;
+    }
+
+    /**
+     * 设置缓存函数
+     * @param string $funcName 方法名
+     * @param string $id 缓存数据ID
+     * @return bool 返回结果true或false
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function resetCacheFunc($funcName, $id = '')
+    {
+        // 获取缓存KEY
+        $cache_key = $this->getCacheKey($funcName, $id);
+        // 删除缓存
+        $result = $this->deleteCache($cache_key);
+
+        // 设置缓存
+        $arg_list = func_get_args();
+        if ($this->table) {
+            array_shift($arg_list);
+        }
+        $act = "cache" . ucfirst($funcName);
+        $data = call_user_func_array(array($this, $act), $arg_list);
+        return $this->setCache($cache_key, $data);
+    }
+
+    /**
+     * 获取缓存函数
+     * @param string $funcName 方法名
+     * @param string $id 缓存数据ID
+     * @return mixed 返回结果
+     * @author zongjl
+     * @date 2019/5/23
+     */
+    public function getCacheFunc($funcName, $id = '')
+    {
+        $cache_key = $this->getCacheKey($funcName, $id);
+        $data = $this->getCache($cache_key);
+        if (!$data) {
+            $arg_list = func_get_args();
+            if ($this->table) {
+                array_shift($arg_list);
+            }
+            $act = "cache" . ucfirst($funcName);
+            $data = call_user_func_array(array($this, $act), $arg_list);
+            $this->setCache($cache_key, $data);
+        }
+        return $data;
+    }
+
+    /**
+     * 获取整表缓存
+     * @param array $map 查询条件
+     * @param bool $is_pri 是否只缓存主键true或false
+     * @param bool $pri_key 是否以主键作为键值true或false
+     * @return mixed 返回结果
+     * @author zongjl
+     * @date 2019/6/5
+     */
+    public function getAll($map = [], $is_pri = false, $pri_key = false)
+    {
+        $list = $this->getCacheFunc('all', $map, $is_pri, $pri_key);
+        return $list;
+    }
+
+    /**
+     * 设置整表缓存
+     * @param array $map 查询条件
+     * @param bool $is_pri 是否只缓存主键true或false
+     * @param bool $pri_key 是否以主键作为键值true或false
+     * @return mixed 返回结果
+     * @author zongjl
+     * @date 2019/6/5
+     */
+    public function cacheAll($map = [], $is_pri = false, $pri_key = false)
+    {
+        // 必备查询条件
+        $map[] = ['mark', '=', 1];
+
+        // 格式化查询条件
+        if (method_exists($this, 'formatQuery')) {
+            $query = $this->formatQuery($this, $map);
+        }
+
+        // 是否缓存主键
+        if ($is_pri) {
+            if (is_array($is_pri)) {
+                // 字段数组
+                $query->select($is_pri);
+            } elseif (is_string($is_pri)) {
+                // 字段字符串
+                $fields = explode(',', $is_pri);
+                $query->select($fields);
+            } else {
+                // 默认主键ID
+                $query->select('id');
+            }
+        }
+
+        // 查询数据并转数组
+        $list = $query->get()->toArray();
+
+        // 设置主键ID为数组键值
+        if ($pri_key) {
+            $list = array_column($list, null, 'id');
+        }
+
+        return $list;
+    }
+
+    /**
+     * 重置全表缓存
+     * @param array $map 查询条件
+     * @param bool $is_pri 是否只缓存主键true或false
+     * @param bool $pri_key 是否以主键作为键值true或false
+     * @return bool 返回结果true(重置成功)或false(重置失败)
+     * @author zongjl
+     * @date 2019/6/5
+     */
+    public function cacheResetAll($map = [], $is_pri = false, $pri_key = false)
+    {
+        return $this->resetCacheFunc('all', $map, $is_pri, $pri_key);
+    }
+}

+ 25 - 0
app/Models/CityModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 城市-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class CityModel
+ * @package App\Models
+ */
+class CityModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'city';
+}

+ 25 - 0
app/Models/ConfigGroupModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 配置分组-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ConfigGroupModel
+ * @package App\Models
+ */
+class ConfigGroupModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'config_group';
+}

+ 25 - 0
app/Models/ConfigModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 配置管理-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ConfigModel
+ * @package App\Models
+ */
+class ConfigModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'config';
+}

+ 46 - 0
app/Models/Demo3Model.php

@@ -0,0 +1,46 @@
+<?php 
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2020 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 演示-模型
+ * @author 牧羊人
+ * @since 2021/04/10
+ * Class Demo3Model
+ * @package App\Models
+ */
+class Demo3Model extends BaseModel
+{
+    // 设置数据表
+    protected $table = "demo3";
+
+    /**
+     * 获取记录信息
+     * @param int $id 记录ID
+     * @return array|string
+     * @author 牧羊人
+     * @since: 2021/04/10
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+                                        
+            // 头像
+            if ($info['avatar']) {
+                $info['avatar'] = get_image_url($info['avatar']);
+            }
+                                                                                                                            
+        }
+        return $info;
+    }
+}

+ 25 - 0
app/Models/DeptModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 部门管理-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DeptModel
+ * @package App\Models
+ */
+class DeptModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'dept';
+}

+ 25 - 0
app/Models/DictModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 字典-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DictModel
+ * @package App\Models
+ */
+class DictModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'dict';
+}

+ 25 - 0
app/Models/DictTypeModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 字典类型-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DictTypeModel
+ * @package App\Models
+ */
+class DictTypeModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'dict_type';
+}

+ 72 - 0
app/Models/ItemCateModel.php

@@ -0,0 +1,72 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 栏目模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ItemCateModel
+ * @package App\Models
+ */
+class ItemCateModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'item_cate';
+
+    /**
+     * 获取记录信息
+     * @param int $id
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 封面
+            if ($info['cover']) {
+                $info['cover'] = get_image_url($info['cover']);
+            }
+        }
+        return $info;
+    }
+
+    /**
+     * 获取栏目名称
+     * @param $cateId 栏目ID
+     * @param string $delimiter 分隔符
+     * @return string|null
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getCateName($cateId, $delimiter = "")
+    {
+        do {
+            $info = $this->getInfo($cateId);
+            $names[] = $info['name'];
+            $cateId = $info['pid'];
+        } while ($cateId > 0);
+        if (!empty($names)) {
+            $names = array_reverse($names);
+            if (count($names) >= 2) {
+                if (strpos($names[1], $names[0]) === 0) {
+                    unset($names[0]);
+                }
+            }
+            return implode($delimiter, $names);
+        }
+        return null;
+    }
+
+}

+ 45 - 0
app/Models/ItemModel.php

@@ -0,0 +1,45 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 站点-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ItemModel
+ * @package App\Models
+ */
+class ItemModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'item';
+
+    /**
+     * 获取数据信息
+     * @param int $id 记录ID
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 站点图片
+            if ($info['image']) {
+                $info['image'] = get_image_url($info['image']);
+            }
+        }
+        return $info;
+    }
+
+}

+ 49 - 0
app/Models/LayoutDescModel.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 布局描述-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LayoutDescModel
+ * @package App\Models
+ */
+class LayoutDescModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'layout_desc';
+
+    /**
+     * 获取数据信息
+     * @param int $id
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 站点名称
+            if ($info['item_id']) {
+                $itemModel = new ItemModel();
+                $itemInfo = $itemModel->getInfo($info['item_id']);
+                if ($itemInfo) {
+                    $info['item_name'] = $itemInfo['name'];
+                }
+            }
+        }
+        return $info;
+    }
+
+}

+ 54 - 0
app/Models/LayoutModel.php

@@ -0,0 +1,54 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 布局管理-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LayoutModel
+ * @package App\Models
+ */
+class LayoutModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'layout';
+
+    /**
+     * 获取数据信息
+     * @param int $id 记录ID
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 布局图片
+            if ($info['image']) {
+                $info['image'] = get_image_url($info['image']);
+            }
+
+            // 站点名称
+            if ($info['item_id']) {
+                $itemModel = new ItemModel();
+                $itemInfo = $itemModel->getInfo($info['item_id']);
+                if ($itemInfo) {
+                    $info['item_name'] = $itemInfo['name'];
+                }
+            }
+        }
+        return $info;
+    }
+
+}

+ 25 - 0
app/Models/LevelModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 职级-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LevelModel
+ * @package App\Models
+ */
+class LevelModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'level';
+}

+ 51 - 0
app/Models/LinkModel.php

@@ -0,0 +1,51 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 友链管理-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LinkModel
+ * @package App\Models
+ */
+class LinkModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'link';
+
+    /**
+     * 获取记录信息
+     * @param int $id 记录ID
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 友链图片
+            if ($info['image']) {
+                $info['image'] = get_image_url($info['image']);
+            }
+            // 获取栏目名称
+            if ($info['cate_id']) {
+                $itemCateModel = new ItemCateModel();
+                $itemCateName = $itemCateModel->getCateName($info['cate_id'], ">>");
+                $info['item_cate_name'] = $itemCateName;
+            }
+        }
+        return $info;
+    }
+
+}

+ 25 - 0
app/Models/MemberLevelModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 会员等级-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class MemberLevelModel
+ * @package App\Models
+ */
+class MemberLevelModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'member_level';
+}

+ 57 - 0
app/Models/MemberModel.php

@@ -0,0 +1,57 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 会员-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class MemberModel
+ * @package App\Models
+ */
+class MemberModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'member';
+
+    /**
+     * 获取会员信息
+     * @param int $id 会员ID
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 头像
+            if ($info['avatar']) {
+                $info['avatar'] = get_image_url($info['avatar']);
+            }
+            // 出生日期
+            if ($info['birthday']) {
+                $info['birthday'] = datetime($info['birthday']);
+            }
+            // 城市
+            if ($info['province_id'] && $info['city_id'] && $info['district_id']) {
+                $city = [];
+                $city[] = $info['province_id'];
+                $city[] = $info['city_id'];
+                $city[] = $info['district_id'];
+                $info['city'] = $city;
+            }
+        }
+        return $info;
+    }
+
+}

+ 59 - 0
app/Models/MenuModel.php

@@ -0,0 +1,59 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+
+use Ramsey\Uuid\Type\Integer;
+
+/**
+ * 菜单管理-模型
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class MenuModel
+ * @package App\Models
+ */
+class MenuModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'menu';
+
+
+    /**
+     * 获取子级菜单列表
+     * @param $pid 父级ID
+     * @return mixed
+     * @author 牧羊人
+     * @since 2020/11/11
+     */
+    public function getChilds($pid)
+    {
+        // 查询条件
+        $map = [];
+        // 父级ID
+        $map[] = ['pid', '=', $pid];
+        // 菜单状态
+        $map[] = ['status', '=', 1];
+        // 只取菜单
+        $map[] = ['type', '=', 0];
+        // 有效标识
+        $map[] = ['mark', '=', 1];
+
+        $list = $this->where($map)->orderBy("sort", "asc")->get()->toArray();
+        if (!empty($list)) {
+            foreach ($list as &$val) {
+                $val['children'] = $this->getChilds($val['id']);
+            }
+        }
+        return $list;
+    }
+
+}

+ 25 - 0
app/Models/NoticeModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 通知公告-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class NoticeModel
+ * @package App\Models
+ */
+class NoticeModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'notice';
+}

+ 25 - 0
app/Models/PositionModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 岗位-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class PositionModel
+ * @package App\Models
+ */
+class PositionModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'position';
+}

+ 25 - 0
app/Models/RoleMenuModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 角色菜单-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class RoleMenuModel
+ * @package App\Models
+ */
+class RoleMenuModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'role_menu';
+}

+ 25 - 0
app/Models/RoleModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 角色-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class RoleModel
+ * @package App\Models
+ */
+class RoleModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'role';
+}

+ 52 - 0
app/Models/User.php

@@ -0,0 +1,52 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+use Illuminate\Contracts\Auth\MustVerifyEmail;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Notifications\Notifiable;
+
+class User extends Authenticatable
+{
+    use HasFactory, Notifiable;
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array
+     */
+    protected $fillable = [
+        'name',
+        'email',
+        'password',
+    ];
+
+    /**
+     * The attributes that should be hidden for arrays.
+     *
+     * @var array
+     */
+    protected $hidden = [
+        'password',
+        'remember_token',
+    ];
+
+    /**
+     * The attributes that should be cast to native types.
+     *
+     * @var array
+     */
+    protected $casts = [
+        'email_verified_at' => 'datetime',
+    ];
+}

+ 69 - 0
app/Models/UserModel.php

@@ -0,0 +1,69 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+use App\Services\UserRoleService;
+
+/**
+ * 人员管理-模型
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class AdminModel
+ * @package App\Models
+ */
+class UserModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'user';
+
+    /**
+     * 获取数据信息
+     * @param int $id 用户ID
+     * @return array|string
+     * @author 牧羊人
+     * @since 2020/11/10
+     */
+    public function getInfo($id)
+    {
+        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
+        if ($info) {
+            // 头像
+            if ($info['avatar']) {
+                $info['avatar'] = get_image_url($info['avatar']);
+            }
+
+            // 性别
+            if ($info['gender']) {
+                $info['gender_name'] = config('admin.gender_list')[$info['gender']];
+            }
+
+            // 岗位
+            if ($info['position_id']) {
+                $positionModel = new PositionModel();
+                $positionInfo = $positionModel->getInfo($info['position_id']);
+                $info['position_name'] = $positionInfo['name'];
+            }
+
+            // 职级
+            if ($info['level_id']) {
+                $levelMod = new LevelModel();
+                $levelInfo = $levelMod->getInfo($info['level_id']);
+                $info['level_name'] = $levelInfo['name'];
+            }
+            // 获取用户角色列表
+            $userRoleService = new UserRoleService();
+            $roleList = $userRoleService->getUserRoleList($id);
+            $info['roles'] = $roleList;
+        }
+        return $info;
+    }
+}

+ 26 - 0
app/Models/UserRoleModel.php

@@ -0,0 +1,26 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 用户角色-模型
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class UserRoleModel
+ * @package App\Models
+ */
+class UserRoleModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'user_role';
+
+}

+ 52 - 0
app/Providers/AppServiceProvider.php

@@ -0,0 +1,52 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Providers;
+
+use Illuminate\Support\ServiceProvider;
+
+class AppServiceProvider extends ServiceProvider
+{
+    /**
+     * Register any application services.
+     *
+     * @return void
+     */
+    public function register()
+    {
+        //
+        \DB::listen(function ($query) {
+            $bindings = $query->bindings;
+            $sql = $query->sql;
+            foreach ($bindings as $replace) {
+                $value = is_numeric($replace) ? $replace : "'" . $replace . "'";
+                $sql = preg_replace('/\?/', $value, $sql, 1);
+            }
+//            $time = $query->time;
+//            if ($time > 10) {  //when time > 10 print
+//                \Log::debug(var_export(compact(['sql', 'bindings', 'time']), true));
+//            }
+//            \Log::debug(var_export(compact(['sql', 'bindings', 'time']), true));
+//            print_r($sql);
+//            echo $sql;
+        });
+    }
+
+    /**
+     * Bootstrap any application services.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        //
+    }
+}

+ 30 - 0
app/Providers/AuthServiceProvider.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Providers;
+
+use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
+use Illuminate\Support\Facades\Gate;
+
+class AuthServiceProvider extends ServiceProvider
+{
+    /**
+     * The policy mappings for the application.
+     *
+     * @var array
+     */
+    protected $policies = [
+        // 'App\Models\Model' => 'App\Policies\ModelPolicy',
+    ];
+
+    /**
+     * Register any authentication / authorization services.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        $this->registerPolicies();
+
+        //
+    }
+}

+ 21 - 0
app/Providers/BroadcastServiceProvider.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Providers;
+
+use Illuminate\Support\Facades\Broadcast;
+use Illuminate\Support\ServiceProvider;
+
+class BroadcastServiceProvider extends ServiceProvider
+{
+    /**
+     * Bootstrap any application services.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        Broadcast::routes();
+
+        require base_path('routes/channels.php');
+    }
+}

+ 32 - 0
app/Providers/EventServiceProvider.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Providers;
+
+use Illuminate\Auth\Events\Registered;
+use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
+use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
+use Illuminate\Support\Facades\Event;
+
+class EventServiceProvider extends ServiceProvider
+{
+    /**
+     * The event listener mappings for the application.
+     *
+     * @var array
+     */
+    protected $listen = [
+        Registered::class => [
+            SendEmailVerificationNotification::class,
+        ],
+    ];
+
+    /**
+     * Register any events for your application.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        //
+    }
+}

+ 63 - 0
app/Providers/RouteServiceProvider.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace App\Providers;
+
+use Illuminate\Cache\RateLimiting\Limit;
+use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\RateLimiter;
+use Illuminate\Support\Facades\Route;
+
+class RouteServiceProvider extends ServiceProvider
+{
+    /**
+     * The path to the "home" route for your application.
+     *
+     * This is used by Laravel authentication to redirect users after login.
+     *
+     * @var string
+     */
+    public const HOME = '/home';
+
+    /**
+     * The controller namespace for the application.
+     *
+     * When present, controller route declarations will automatically be prefixed with this namespace.
+     *
+     * @var string|null
+     */
+    // protected $namespace = 'App\\Http\\Controllers';
+
+    /**
+     * Define your route model bindings, pattern filters, etc.
+     *
+     * @return void
+     */
+    public function boot()
+    {
+        $this->configureRateLimiting();
+
+        $this->routes(function () {
+            Route::prefix('api')
+                ->middleware('api')
+                ->namespace($this->namespace)
+                ->group(base_path('routes/api.php'));
+
+            Route::middleware('web')
+                ->namespace($this->namespace)
+                ->group(base_path('routes/web.php'));
+        });
+    }
+
+    /**
+     * Configure the rate limiters for the application.
+     *
+     * @return void
+     */
+    protected function configureRateLimiting()
+    {
+        RateLimiter::for('api', function (Request $request) {
+            return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
+        });
+    }
+}

+ 36 - 0
app/Services/ActionLogService.php

@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+
+use App\Models\ActionLogModel;
+
+/**
+ * 行为日志-服务类
+ * @author 牧羊人
+ * @since 2020/11/12
+ * Class ActionLogService
+ * @package App\Services
+ */
+class ActionLogService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/12
+     * ActionLogService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new ActionLogModel();
+    }
+}

+ 63 - 0
app/Services/AdService.php

@@ -0,0 +1,63 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\AdModel;
+
+/**
+ * 广告管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class AdService
+ * @package App\Services
+ */
+class AdService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * AdService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new AdModel();
+    }
+
+    /**
+     * 添加或编辑
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        $data = request()->all();
+        // 图片处理
+        $cover = trim($data['cover']);
+        if (strpos($cover, "temp")) {
+            $data['cover'] = save_image($cover, 'ad');
+        } else {
+            $data['cover'] = str_replace(IMG_URL, "", $data['cover']);
+        }
+        // 开始时间
+        if ($data['start_time']) {
+            $data['start_time'] = strtotime($data['start_time']);
+        }
+        // 结束时间
+        if ($data['end_time']) {
+            $data['end_time'] = strtotime($data['end_time']);
+        }
+        return parent::edit($data); // TODO: Change the autogenerated stub
+    }
+
+}

+ 48 - 0
app/Services/AdSortService.php

@@ -0,0 +1,48 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\AdSortModel;
+
+/**
+ * 广告位管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class AdSortService
+ * @package App\Services
+ */
+class AdSortService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * AdSortService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new AdSortModel();
+    }
+
+    /**
+     * 获取广告位列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getAdSortList()
+    {
+        $list = $this->model->where("mark", '=', 1)->get()->toArray();
+        return message("操作成功", true, $list);
+    }
+
+}

+ 230 - 0
app/Services/BaseService.php

@@ -0,0 +1,230 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+/**
+ * 服务基类
+ * @author 牧羊人
+ * @since 2020/11/10
+ * Class BaseService
+ * @package App\Services
+ */
+class BaseService
+{
+    // 模型
+    protected $model;
+    // 验证类
+    protected $validate;
+
+    /**
+     * 获取数据列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        // 初始化变量
+        $map = [];
+        $sort = [['id', 'desc']];
+        $is_sql = 0;
+
+        // 获取参数
+        $argList = func_get_args();
+        if (!empty($argList)) {
+            // 查询条件
+            $map = (isset($argList[0]) && !empty($argList[0])) ? $argList[0] : [];
+            // 排序
+            $sort = (isset($argList[1]) && !empty($argList[1])) ? $argList[1] : [['id', 'desc']];
+            // 是否打印SQL
+            $is_sql = isset($argList[2]) ? isset($argList[2]) : 0;
+        }
+
+        // 打印SQL
+        if ($is_sql) {
+            $this->model->getLastSql(1);
+        }
+
+        // 常规查询条件
+        $param = request()->input();
+        if ($param) {
+            // 筛选名称
+            if (isset($param['name']) && $param['name']) {
+                $map[] = ['name', 'like', "%{$param['name']}%"];
+            }
+
+            // 筛选标题
+            if (isset($param['title']) && $param['title']) {
+                $map[] = ['title', 'like', "%{$param['title']}%"];
+            }
+
+            // 筛选类型
+            if (isset($param['type']) && $param['type']) {
+                $map[] = ['type', '=', $param['type']];
+            }
+
+            // 筛选状态
+            if (isset($param['status']) && $param['status']) {
+                $map[] = ['status', '=', $param['status']];
+            }
+
+            // 手机号码
+            if (isset($param['mobile']) && $param['mobile']) {
+                $map[] = ['mobile', '=', $param['mobile']];
+            }
+        }
+
+        // 设置查询条件
+        if (is_array($map)) {
+            $map[] = ['mark', '=', 1];
+        } elseif ($map) {
+            $map .= " AND mark=1 ";
+        } else {
+            $map .= " mark=1 ";
+        }
+
+        // 排序(支持多重排序)
+        $query = $this->model->where($map)->when($sort, function ($query, $sort) {
+            foreach ($sort as $v) {
+                $query->orderBy($v[0], $v[1]);
+            }
+        });
+        // 分页条件
+        $offset = (PAGE - 1) * PERPAGE;
+        $result = $query->offset($offset)->limit(PERPAGE)->select('id')->get();
+        $result = $result ? $result->toArray() : [];
+        $list = [];
+        if (is_array($result)) {
+            foreach ($result as $val) {
+                $info = $this->model->getInfo($val['id']);
+                $list[] = $info;
+            }
+        }
+
+        //获取数据总数
+        $count = $this->model->where($map)->count();
+
+        //返回结果
+        $message = array(
+            "msg" => '操作成功',
+            "code" => 0,
+            "data" => $list,
+            "count" => $count,
+        );
+        return $message;
+    }
+
+    /**
+     * 获取记录详情
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function info()
+    {
+        // 记录ID
+        $id = request()->input("id", 0);
+        $info = [];
+        if ($id) {
+            $info = $this->model->getInfo($id);
+        }
+        return message(MESSAGE_OK, true, $info);
+    }
+
+    /**
+     * 添加或编辑记录
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        // 获取参数
+        $argList = func_get_args();
+        // 查询条件
+        $data = isset($argList[0]) ? $argList[0] : [];
+        // 是否打印SQL
+        $is_sql = isset($argList[1]) ? $argList[1] : false;
+        if (!$data) {
+            $data = request()->all();
+        }
+        $error = '';
+        $rowId = $this->model->edit($data, $error, $is_sql);
+        if ($rowId) {
+            return message();
+        }
+        return message($error, false);
+    }
+
+    /**
+     * 删除记录
+     * @return array
+     * @since 2020/11/12
+     * @author 牧羊人
+     */
+    public function delete()
+    {
+        // 参数
+        $param = request()->all();
+        // 记录ID
+        $ids = getter($param, "id");
+        if (empty($ids)) {
+            return message("记录ID不能为空", false);
+        }
+        if (is_array($ids)) {
+            // 批量删除
+            $result = $this->model->deleteAll($ids);
+            if (!$result) {
+                return message("删除失败", false);
+            }
+            return message("删除成功");
+        } else {
+            // 单个删除
+            $info = $this->model->getInfo($ids);
+            if ($info) {
+                $result = $this->model->drop($ids);
+                if ($result !== false) {
+                    return message();
+                }
+            }
+            return message($this->model->getError(), false);
+        }
+    }
+
+    /**
+     * 设置记录状态
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function status()
+    {
+        $data = request()->all();
+        if (!$data['id']) {
+            return message('记录ID不能为空', false);
+        }
+        if (!$data['status']) {
+            return message('记录状态不能为空', false);
+        }
+        $error = '';
+        $item = [
+            'id' => $data['id'],
+            'status' => $data['status']
+        ];
+        $rowId = $this->model->edit($item, $error);
+        if (!$rowId) {
+            return message($error, false);
+        }
+        return message();
+    }
+
+}

+ 71 - 0
app/Services/CityService.php

@@ -0,0 +1,71 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\CityModel;
+
+/**
+ * 城市管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class CityService
+ * @package App\Services
+ */
+class CityService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * CityService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new CityModel();
+    }
+
+    /**
+     * 获取城市列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+
+        // 查询条件
+        $map = [];
+        // 上级ID
+        $pid = intval(getter($param, 'pid', 0));
+        if (!$pid) {
+            $map[] = ['pid', '=', 0];
+        } else {
+            $map[] = ['pid', '=', $pid];
+        }
+        // 城市名称
+        $name = getter($param, "name");
+        if ($name) {
+            $map[] = ['name', 'like', "%{$name}%"];
+        }
+        $list = $this->model->getList($map, [['sort', 'asc']]);
+        if (!empty($list)) {
+            foreach ($list as &$val) {
+                if ($val['level'] <= 2) {
+                    $val['hasChildren'] = true;
+                }
+            }
+        }
+        return message("操作成功", true, $list);
+    }
+
+}

+ 35 - 0
app/Services/ConfigGroupService.php

@@ -0,0 +1,35 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\ConfigGroupModel;
+
+/**
+ * 配置分组-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ConfigGroupService
+ * @package App\Services
+ */
+class ConfigGroupService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ConfigGroupService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new ConfigGroupModel();
+    }
+}

+ 61 - 0
app/Services/ConfigService.php

@@ -0,0 +1,61 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\ConfigModel;
+
+/**
+ * 配置管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ConfigService
+ * @package App\Services
+ */
+class ConfigService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ConfigService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new ConfigModel();
+    }
+
+    /**
+     * 获取配置列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+        // 查询条件
+        $map = [];
+        // 配置分组ID
+        $configgroupId = getter($param, "configgroupId", 0);
+        if ($configgroupId) {
+            $map[] = ['config_group_id', '=', $configgroupId];
+        }
+        // 配置标题
+        $title = getter($param, "title");
+        if ($title) {
+            $map[] = ['name', 'title', "%{$title}%"];
+        }
+        $list = $this->model->getList($map, [['sort', 'asc']]);
+        return message("操作成功", true, $list);
+    }
+
+}

+ 128 - 0
app/Services/Demo3Service.php

@@ -0,0 +1,128 @@
+<?php 
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2020 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+
+use App\Models\Demo3Model;
+
+/**
+ * 演示管理-服务类
+ * @author 牧羊人
+ * @since: 2021/04/10
+ * Class Demo3Service
+* @package App\Services
+ */
+class Demo3Service extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2021/04/10
+     * LevelService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new Demo3Model();
+    }
+
+	/**
+     * 获取数据列表
+     * @return array
+     * @since 2021/04/10
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+
+        // 查询条件
+        $map = [];
+	
+	    // 职级名称
+        $name = isset($param['name']) ? trim($param['name']) : '';
+        if ($name) {
+            $map[] = ['name', 'like', "%{$name}%"];
+        }
+		
+	    // 状态
+        $status = isset($param['status']) ? (int)$param['status'] : 0;
+        if ($status) {
+            $map[] = ['status', '=', $status];
+        }
+		
+	    // 类型
+        $type = isset($param['type']) ? (int)$param['type'] : 0;
+        if ($type) {
+            $map[] = ['type', '=', $type];
+        }
+		
+	    // 是否VIP
+        $is_vip = isset($param['is_vip']) ? (int)$param['is_vip'] : 0;
+        if ($is_vip) {
+            $map[] = ['is_vip', '=', $is_vip];
+        }
+	
+        return parent::getList($map); // TODO: Change the autogenerated stub
+    }
+
+	/**
+     * 添加或编辑
+     * @return array
+     * @since 2021/04/10
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        // 参数
+        $data = request()->all();
+	                                
+		// 头像处理
+        $avatar = trim($data['avatar']);
+        if (strpos($avatar, "temp")) {
+            $data['avatar'] = save_image($avatar, 'demo3');
+        } else {
+            $data['avatar'] = str_replace(IMG_URL, "", $data['avatar']);
+        }
+                                                                                                                        
+        return parent::edit($data); // TODO: Change the autogenerated stub
+    }
+
+                    	            
+	/**
+     * 设置是否VIP
+	 * @return array
+     * @since 2021/04/10
+	 * @author 牧羊人
+	 */
+    public function setIsVip()
+    {
+		// 参数
+        $data = request()->all();
+        if (!$data['id']) {
+            return message('记录ID不能为空', false);
+        }
+		if (!$data['is_vip']) {
+            return message('记录是否VIP不能为空', false);
+        }
+        $error = '';
+        $item = [
+            'id' => $data['id'],
+            'is_vip' => $data['is_vip']
+        ];
+        $rowId = $this->model->edit($item, $error);
+        if (!$rowId) {
+            return message($error, false);
+        }
+        return message();
+    }
+    	                        
+}

+ 58 - 0
app/Services/DeptService.php

@@ -0,0 +1,58 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\DeptModel;
+
+/**
+ * 部门管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DeptService
+ * @package App\Services
+ */
+class DeptService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * DeptService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new DeptModel();
+    }
+
+    /**
+     * 获取数据列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+
+        // 查询条件
+        $map = [];
+
+        // 部门名称
+        $name = getter($param, "name");
+        if ($name) {
+            $map[] = ['name', 'like', "%{$name}%"];
+        }
+        $list = $this->model->getList($map, [['sort', 'asc']]);
+        return message("操作成功", true, $list);
+    }
+
+}

+ 65 - 0
app/Services/DictService.php

@@ -0,0 +1,65 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\DictModel;
+
+/**
+ * 字典-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DictService
+ * @package App\Services
+ */
+class DictService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * DictService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new DictModel();
+    }
+
+    /**
+     * 获取字典列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+        // 查询条件
+        $map = [];
+        // 字典类型ID
+        $dicttypeId = getter($param, "dicttypeId", 0);
+        if ($dicttypeId) {
+            $map[] = ['dicttype_id', '=', $dicttypeId];
+        }
+        // 字典名称
+        $name = getter($param, "name");
+        if ($name) {
+            $map[] = ['name', 'like', "%{$name}%"];
+        }
+        // 字典编码
+        $code = getter($param, 'code');
+        if ($code) {
+            $map[] = ['code', '=', $code];
+        }
+        $list = $this->model->getList($map, [['sort', 'asc']]);
+        return message("操作成功", true, $list);
+    }
+}

+ 35 - 0
app/Services/DictTypeService.php

@@ -0,0 +1,35 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\DictTypeModel;
+
+/**
+ * 字典类型-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class DictTypeService
+ * @package App\Services
+ */
+class DictTypeService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * DictTypeService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new DictTypeModel();
+    }
+}

+ 646 - 0
app/Services/GenerateService.php

@@ -0,0 +1,646 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\MenuModel;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 代码生成器-服务类
+ * @author 牧羊人
+ * @since 2020/11/12
+ * Class GenerateService
+ * @package App\Services
+ */
+class GenerateService extends BaseService
+{
+
+    /**
+     * 获取数据表
+     * @return array
+     * @since 2020/11/12
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $list = DB::select('SHOW TABLE STATUS');
+        $list = json_decode(json_encode($list), true);
+        $list = array_map('array_change_key_case', $list);
+
+        return $message = array(
+            "msg" => '操作成功',
+            "code" => 0,
+            "data" => $list,
+            "count" => 100,
+        );
+    }
+
+    /**
+     * 一键生成模块文件
+     * @return array
+     * @since 2020/11/12
+     * @author 牧羊人
+     */
+    public function generate()
+    {
+        // 参数
+        $param = request()->all();
+        // 数据表名
+        $name = getter($param, "name");
+        if (!$name) {
+            return message("数据表名称不能为空", false);
+        }
+//        if ($name != DB_PREFIX . 'demo') {
+//            return message("演示环境禁止操作", false);
+//        }
+        // 数据表名称
+        $tableName = str_replace(DB_PREFIX, null, $name);
+        // 模型名称
+        $moduleName = str_replace(' ', null, ucwords(strtolower(str_replace('_', ' ', $tableName))));
+        // 控制器名称
+        $controllerName = ucfirst(strtolower(str_replace('_', '', $tableName)));
+
+        // 数据表描述
+        $comment = getter($param, "comment");
+        if (!$comment) {
+            return message("数据表名称不能为空", false);
+        }
+        // 去除表描述中的`表`
+        if (strpos($comment, "表") !== false) {
+            $comment = str_replace("表", null, $comment);
+            $menuName = $comment;
+        }
+        // 去除表描述中的`管理`
+        if (strpos($comment, "管理") !== false) {
+            $comment = str_replace("管理", null, $comment);
+        }
+        // 作者花名
+        $author = "牧羊人";
+
+        // 生成模型
+        $this->generateModel($author, $moduleName, $comment, $tableName);
+        // 生成服务类
+        $this->generateService($author, $moduleName, $comment, $tableName);
+        // 生成控制器
+        $this->generateController($author, $controllerName, $comment, $tableName);
+        // 生成列表文件
+        $this->generateVueIndex($comment, $moduleName, $tableName);
+        // 生成菜单
+        $this->generateMenu(strtolower(str_replace('_', '', $tableName)), $menuName);
+        return message("模块生成成功");
+    }
+
+    /**
+     * 生成模型
+     * @param $author 作者
+     * @param $moduleName 模块名
+     * @param $moduleTitle 模块标题
+     * @param $tableName 数据表名
+     * @author 牧羊人
+     * @since 2020/11/12
+     */
+    public function generateModel($author, $moduleName, $moduleTitle, $tableName)
+    {
+        // 判断是否有图片
+        $moduleImage = false;
+        // 获取数据列表
+        $columnList = $this->getColumnList(DB_PREFIX . "{$tableName}");
+        if ($columnList) {
+            foreach ($columnList as &$val) {
+                // 图片字段处理
+                if (strpos($val['columnName'], "cover") !== false ||
+                    strpos($val['columnName'], "avatar") !== false ||
+                    strpos($val['columnName'], "image") !== false ||
+                    strpos($val['columnName'], "logo") !== false ||
+                    strpos($val['columnName'], "pic") !== false) {
+                    $val['columnImage'] = true;
+                    $moduleImage = true;
+                }
+            }
+        }
+        // 参数
+        $param = [
+            'author' => $author,
+            'since' => date('Y/m/d', time()),
+            'moduleName' => $moduleName,
+            'moduleTitle' => $moduleTitle,
+            'tableName' => $tableName,
+            'columnList' => $columnList,
+            'moduleImage' => $moduleImage,
+        ];
+        // 存储目录
+        $FILE_PATH = app_path() . '/Models';
+        if (!is_dir($FILE_PATH)) {
+            // 创建目录并赋予权限
+            mkdir($FILE_PATH, 0777, true);
+        }
+        // 文件名
+        $filename = $FILE_PATH . "/{$moduleName}Model.php";
+        // 拆解参数
+        extract($param);
+        // 开启缓冲区
+        ob_start();
+        // 引入模板文件
+        require(resource_path() . '/views/templates/model.blade.php');
+        // 获取缓冲区内容
+        $out = ob_get_clean();
+        // 打开文件
+        $f = fopen($filename, 'w');
+        // 写入内容
+        fwrite($f, "<?php " . $out);
+        // 关闭
+        fclose($f);
+    }
+
+    /**
+     * 生成服务类
+     * @param $author 作者
+     * @param $moduleName 模块名
+     * @param $moduleTitle 模块标题
+     * @param $tableName 数据表
+     * @author 牧羊人
+     * @since 2020/11/12
+     */
+    public function generateService($author, $moduleName, $moduleTitle, $tableName)
+    {
+        // 判断是否有图片
+        $moduleImage = false;
+        // 查询条件
+        $queryList = [];
+        // 获取数据列表
+        $columnList = $this->getColumnList(DB_PREFIX . "{$tableName}");
+        if ($columnList) {
+            foreach ($columnList as &$val) {
+                // 图片字段处理
+                if (strpos($val['columnName'], "cover") !== false ||
+                    strpos($val['columnName'], "avatar") !== false ||
+                    strpos($val['columnName'], "image") !== false ||
+                    strpos($val['columnName'], "logo") !== false ||
+                    strpos($val['columnName'], "pic") !== false) {
+                    $val['columnImage'] = true;
+                    $moduleImage = true;
+                }
+                // 下拉筛选
+                if (isset($val['columnValue'])) {
+                    $queryList[] = $val;
+                }
+                // 名称
+                if ($val['columnName'] == "name") {
+                    $queryList[] = $val;
+                }
+                // 标题
+                if ($val['columnName'] == "title") {
+                    $queryList[] = $val;
+                }
+            }
+        }
+
+        // 参数
+        $param = [
+            'author' => $author,
+            'since' => date('Y/m/d', time()),
+            'moduleName' => $moduleName,
+            'moduleTitle' => $moduleTitle,
+            'columnList' => $columnList,
+            'moduleImage' => $moduleImage,
+            'queryList' => $queryList,
+        ];
+        // 存储目录
+        $FILE_PATH = app_path() . '/Services/';
+        if (!is_dir($FILE_PATH)) {
+            // 创建目录并赋予权限
+            mkdir($FILE_PATH, 0777, true);
+        }
+        // 文件名
+        $filename = $FILE_PATH . "/{$moduleName}Service.php";
+        // 拆解参数
+        extract($param);
+        // 开启缓冲区
+        ob_start();
+        // 引入模板文件
+        require(resource_path() . '/views/templates/service.blade.php');
+        // 获取缓冲区内容
+        $out = ob_get_clean();
+        // 打开文件
+        $f = fopen($filename, 'w');
+        // 写入内容
+        fwrite($f, "<?php " . $out);
+        // 关闭
+        fclose($f);
+    }
+
+    /**
+     * 生成控制器
+     * @param $author 作者
+     * @param $moduleName 模块名
+     * @param $moduleTitle 模块标题
+     * @param $tableName 数据表名
+     * @author 牧羊人
+     * @since 2020/11/12
+     */
+    public function generateController($author, $moduleName, $moduleTitle, $tableName)
+    {
+        // 获取数据列表
+        $columnList = $this->getColumnList(DB_PREFIX . "{$tableName}");
+        // 参数
+        $param = [
+            'author' => $author,
+            'since' => date('Y/m/d', time()),
+            'moduleName' => $moduleName,
+            'moduleTitle' => $moduleTitle,
+            'columnList' => $columnList,
+        ];
+        // 存储目录
+        $FILE_PATH = app_path() . '\Http\Controllers';
+        if (!is_dir($FILE_PATH)) {
+            // 创建目录并赋予权限
+            mkdir($FILE_PATH, 0777, true);
+        }
+        // 文件名
+        $filename = $FILE_PATH . "/{$param['moduleName']}Controller.php";
+        // 拆解参数
+        extract($param);
+        // 开启缓冲区
+        ob_start();
+        // 引入模板文件
+        require(resource_path() . '/views/templates/controller.blade.php');
+        // 获取缓冲区内容
+        $out = ob_get_clean();
+        // 打开文件
+        $f = fopen($filename, 'w');
+        // 写入内容
+        fwrite($f, "<?php " . $out);
+        // 关闭
+        fclose($f);
+    }
+
+    /**
+     * 生成列表文件
+     * @param $moduleTitle 模块标题
+     * @param $tableName 数据表名
+     * @author 牧羊人
+     * @since 2020/7/15
+     */
+    public function generateVueIndex($moduleTitle, $moduleName, $tableName)
+    {
+        // 获取数据列表
+        $columnList = $this->getColumnList(DB_PREFIX . "{$tableName}");
+        $queryList = [];
+        if ($columnList) {
+            foreach ($columnList as $val) {
+                // 下拉筛选
+                if (isset($val['columnValue'])) {
+                    $queryList[] = $val;
+                }
+                // 名称
+                if ($val['columnName'] == "name") {
+                    $queryList[] = $val;
+                }
+                // 标题
+                if ($val['columnName'] == "title") {
+                    $queryList[] = $val;
+                }
+            }
+        }
+        // 获取编辑表单数据源
+        // 剔除非表单呈现字段
+        $arrayList = [];
+        $tempList = [];
+        $rowList = [];
+        $columnSplit = false;
+        if ($columnList) {
+            foreach ($columnList as $val) {
+                // 记录ID
+                if ($val['columnName'] == "id") {
+                    continue;
+                }
+                // 创建人
+                if ($val['columnName'] == "create_user") {
+                    continue;
+                }
+                // 创建时间
+                if ($val['columnName'] == "create_time") {
+                    continue;
+                }
+                // 更新人
+                if ($val['columnName'] == "update_user") {
+                    continue;
+                }
+                // 更新时间
+                if ($val['columnName'] == "update_time") {
+                    continue;
+                }
+                // 有效标识
+                if ($val['columnName'] == "mark") {
+                    continue;
+                }
+                // 图片字段处理
+                if (strpos($val['columnName'], "cover") !== false ||
+                    strpos($val['columnName'], "avatar") !== false ||
+                    strpos($val['columnName'], "image") !== false ||
+                    strpos($val['columnName'], "logo") !== false ||
+                    strpos($val['columnName'], "pic") !== false) {
+                    $val['columnUpload'] = true;
+                    $tempList[] = $val;
+                    continue;
+                }
+                // 多行文本输入框
+                if (strpos($val['columnName'], "note") !== false ||
+                    strpos($val['columnName'], "content") !== false ||
+                    strpos($val['columnName'], "description") !== false ||
+                    strpos($val['columnName'], "intro") !== false) {
+                    $val['columnRow'] = true;
+                    $rowList[] = $val;
+                    continue;
+                }
+                // 由于目前时间字段采用int类型,所以这里根据字段描述模糊确定是否是时间选择
+                if (strpos($val['columnComment'], "时间") !== false) {
+                    $val['dataType'] = 'datetime';
+                } elseif (strpos($val['columnComment'], "日期") !== false) {
+                    $val['dataType'] = 'date';
+                }
+
+                // 图片字段处理
+                if (strpos($val['columnName'], "cover") !== false ||
+                    strpos($val['columnName'], "avatar") !== false ||
+                    strpos($val['columnName'], "image") !== false ||
+                    strpos($val['columnName'], "logo") !== false ||
+                    strpos($val['columnName'], "pic") !== false) {
+                    $val['columnImage'] = true;
+                }
+                $arrayList[] = $val;
+            }
+        }
+        if (count($arrayList) + count($tempList) + count($rowList) > 105) {
+            $dataList = [];
+            // 分两个一组
+            $dataList = array_chunk($arrayList, 2);
+            // 图片
+            if (count($tempList) > 0) {
+                array_unshift($dataList, $tempList);
+            }
+            // 多行文本
+            if (count($rowList) > 0) {
+                foreach ($rowList as $val) {
+                    $dataList[][] = $val;
+                }
+            }
+            $columnList = $dataList;
+            $columnSplit = true;
+        } else {
+            $dataList = $arrayList;
+//            // 图片
+//            if (count($tempList) > 0) {
+//                array_unshift($dataList, $tempList);
+//            }
+            // 多行文本
+            if (count($rowList) > 0) {
+                foreach ($rowList as $val) {
+                    $dataList[][] = $val;
+                }
+            }
+            $columnList = $dataList;
+            $columnSplit = false;
+        }
+
+        // 参数
+        $param = [
+            'moduleName' => $moduleName,
+            'moduleName2' => strtolower($moduleName),
+            'moduleTitle' => $moduleTitle,
+            'queryList' => $queryList,
+            'columnList' => $columnList,
+        ];
+        // 存储目录
+        if (strpos($tableName, "_") !== false) {
+            $tableName = str_replace('_', null, $tableName);
+        }
+        $FILE_PATH = ROOT_PATH . '/evui/src/views/system/' . strtolower($tableName);
+        if (!is_dir($FILE_PATH)) {
+            // 创建目录并赋予权限
+            mkdir($FILE_PATH, 0777, true);
+        }
+        // 文件名
+        $filename = $FILE_PATH . "/index.vue";
+        // 拆解参数
+        extract($param);
+        // 开启缓冲区
+        ob_start();
+        // 引入模板文件
+        require(resource_path() . '/views/templates/index.blade.php');
+        // 获取缓冲区内容
+        $out = ob_get_clean();
+        // 打开文件
+        $f = fopen($filename, 'w');
+        // 写入内容
+        fwrite($f, $out);
+        // 关闭
+        fclose($f);
+    }
+
+    /**
+     * 生成字段列表
+     * @param $tableName 数据表名
+     * @return array
+     * @author 牧羊人
+     * @since 2020/11/12
+     */
+    public function getColumnList($tableName)
+    {
+        // 获取表列字段信息
+        $columnList = DB::select("SELECT COLUMN_NAME,COLUMN_DEFAULT,DATA_TYPE,COLUMN_TYPE,COLUMN_COMMENT FROM information_schema.`COLUMNS` where TABLE_NAME like '{$tableName}'");
+        $columnList = json_decode(json_encode($columnList), true);
+        $fields = [];
+        if ($columnList) {
+            foreach ($columnList as $val) {
+                $column = [];
+                // 列名称
+                $column['columnName'] = $val['COLUMN_NAME'];
+                // 列默认值
+                $column['columnDefault'] = $val['COLUMN_DEFAULT'];
+                // 数据类型
+                $column['dataType'] = $val['DATA_TYPE'];
+                // 列描述
+                if (strpos($val['COLUMN_COMMENT'], ':') !== false) {
+                    $item = explode(":", $val['COLUMN_COMMENT']);
+                    $column['columnComment'] = $item[0];
+
+                    // 拆解字段描述
+                    $param = explode(" ", $item[1]);
+                    $columnValue = [];
+                    $columnValueList = [];
+                    foreach ($param as $vo) {
+                        // 键值
+                        $key = preg_replace('/[^0-9]/', '', $vo);
+                        // 键值内容
+                        $value = str_replace($key, null, $vo);
+                        $columnValue[] = "{$key}={$value}";
+                        $columnValueList[] = $value;
+                    }
+                    $column['columnValue'] = implode(',', $columnValue);
+                    if ($val['COLUMN_NAME'] == "status" || substr($val['COLUMN_NAME'], 0, 3) == "is_") {
+                        $column['columnSwitch'] = true;
+                        $column['columnSwitchValue'] = implode('|', $columnValueList);
+                        if ($val['COLUMN_NAME'] == "status") {
+                            $column['columnSwitchName'] = "status";
+                        } else {
+                            $column['columnSwitchName'] = 'set' . str_replace(' ', null, ucwords(strtolower(str_replace('_', ' ', $val['COLUMN_NAME']))));
+                        }
+                    } else {
+                        $column['columnSwitch'] = false;
+                    }
+                } else {
+                    $column['columnComment'] = $val['COLUMN_COMMENT'];
+                }
+                $fields[] = $column;
+            }
+        }
+        return $fields;
+    }
+
+    /**
+     * 生成模块菜单
+     * @param $moduleName 模块名称
+     * @param $moduleTitle 模块标题
+     * @author 牧羊人
+     * @since 2020/11/12
+     */
+    public function generateMenu($moduleName, $moduleTitle)
+    {
+        // 查询已存在的菜单
+        $menuModel = new MenuModel();
+        $info = $menuModel->getOne([
+            ['permission', '=', "sys:{$moduleName}:view"],
+        ]);
+        $data = [
+            'id' => isset($info['id']) ? intval($info['id']) : 0,
+            'title' => $moduleTitle,
+            'icon' => 'el-icon-house',
+            'path' => "/system/{$moduleName}",
+            'component' => "/system/{$moduleName}",
+            'pid' => 154,
+            'type' => 0,
+            'permission' => "sys:{$moduleName}:view",
+        ];
+        $result = $menuModel->edit($data);
+        if ($result) {
+            // 去除表描述中的`管理`
+            if (strpos($moduleTitle, "管理") !== false) {
+                $moduleTitle = str_replace("管理", null, $moduleTitle);
+            }
+            // 创建节点
+            $funcList = [1, 5, 10, 15, 25, 30];
+            foreach ($funcList as $val) {
+                $item = [];
+                if ($val == 1) {
+                    // 查询列表
+                    $menuModel = new MenuModel();
+                    $info = $menuModel->getOne([
+                        ['pid', '=', $result],
+                        ['title', '=', "查询" . $moduleTitle]
+                    ]);
+                    $item = [
+                        'id' => isset($info['id']) ? intval($info['id']) : 0,
+                        'title' => "查询" . $moduleTitle,
+                        'permission' => "sys:{$moduleName}:index",
+                        'pid' => $result,
+                        'type' => 1,
+                        'status' => 1,
+                        'sort' => $val,
+                    ];
+                } else if ($val == 5) {
+                    // 添加
+                    $menuModel = new MenuModel();
+                    $info = $menuModel->getOne([
+                        ['pid', '=', $result],
+                        ['title', '=', "添加" . $moduleTitle]
+                    ]);
+                    $item = [
+                        'id' => isset($info['id']) ? intval($info['id']) : 0,
+                        'title' => "添加" . $moduleTitle,
+                        'permission' => "sys:{$moduleName}:add",
+                        'pid' => $result,
+                        'type' => 1,
+                        'status' => 1,
+                        'sort' => $val,
+                    ];
+                } else if ($val == 10) {
+                    // 修改
+                    $menuModel = new MenuModel();
+                    $info = $menuModel->getOne([
+                        ['pid', '=', $result],
+                        ['title', '=', "修改" . $moduleTitle]
+                    ]);
+                    $item = [
+                        'id' => isset($info['id']) ? intval($info['id']) : 0,
+                        'title' => "修改" . $moduleTitle,
+                        'permission' => "sys:{$moduleName}:edit",
+                        'pid' => $result,
+                        'type' => 1,
+                        'status' => 1,
+                        'sort' => $val,
+                    ];
+                } else if ($val == 15) {
+                    // 删除
+                    $menuModel = new MenuModel();
+                    $info = $menuModel->getOne([
+                        ['pid', '=', $result],
+                        ['title', '=', "删除" . $moduleTitle]
+                    ]);
+                    $item = [
+                        'id' => isset($info['id']) ? intval($info['id']) : 0,
+                        'title' => "删除" . $moduleTitle,
+                        'permission' => "sys:{$moduleName}:delete",
+                        'pid' => $result,
+                        'type' => 1,
+                        'status' => 1,
+                        'sort' => $val,
+                    ];
+                } else if ($val == 20) {
+                    // 状态
+                    $menuModel = new MenuModel();
+                    $info = $menuModel->getOne([
+                        ['pid', '=', $result],
+                        ['title', '=', "设置状态"]
+                    ]);
+                    $item = [
+                        'id' => isset($info['id']) ? intval($info['id']) : 0,
+                        'title' => "设置状态",
+                        'permission' => "sys:{$moduleName}:status",
+                        'pid' => $result,
+                        'type' => 1,
+                        'status' => 1,
+                        'sort' => $val,
+                    ];
+                } else if ($val == 25) {
+                    // 批量删除
+                    $info = $menuModel->getOne([
+                        ['pid', '=', $result],
+                        ['title', '=', "批量删除"]
+                    ]);
+                    $item = [
+                        'id' => isset($info['id']) ? intval($info['id']) : 0,
+                        'title' => "批量删除",
+                        'permission' => "sys:{$moduleName}:dall",
+                        'pid' => $result,
+                        'type' => 1,
+                        'status' => 1,
+                        'sort' => $val,
+                    ];
+                }
+                $menuModel = new MenuModel();
+                $menuModel->edit($item);
+            }
+        }
+    }
+
+}

+ 89 - 0
app/Services/ItemCateService.php

@@ -0,0 +1,89 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\ItemCateModel;
+
+/**
+ * 栏目管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ItemCateService
+ * @package App\Services
+ */
+class ItemCateService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ItemCateService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new ItemCateModel();
+    }
+
+    /**
+     * 获取栏目列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+
+        // 查询条件
+        $map = [];
+        // 上级ID
+        $pid = intval(getter($param, 'pid', 0));
+        if (!$pid) {
+            $map[] = ['pid', '=', 0];
+        } else {
+            $map[] = ['pid', '=', $pid];
+        }
+        $list = $this->model->getList($map, [['sort', 'asc']]);
+        if (!empty($list)) {
+            foreach ($list as &$val) {
+                if ($val['pid'] == 0) {
+                    $val['hasChildren'] = true;
+                }
+            }
+        }
+        return message("操作成功", true, $list);
+    }
+
+    /**
+     * 添加或编辑
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        // 参数
+        $data = request()->all();
+        // 封面地址
+        $cover = trim($data['cover']);
+        if (!$data['id'] && !$cover) {
+            return message('请上传栏目封面', false);
+        }
+        if (strpos($cover, "temp")) {
+            $data['cover'] = save_image($cover, 'itemcate');
+        } else {
+            $data['cover'] = str_replace(IMG_URL, "", $data['cover']);
+        }
+        return parent::edit($data); // TODO: Change the autogenerated stub
+    }
+
+}

+ 96 - 0
app/Services/ItemService.php

@@ -0,0 +1,96 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\ItemModel;
+
+/**
+ * 站点管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class ItemService
+ * @package App\Services
+ */
+class ItemService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * ItemService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new ItemModel();
+    }
+
+    /**
+     * 获取站点列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+
+        // 查询条件
+        $map = [];
+        // 站点类型
+        $type = getter($param, "type", 0);
+        if ($type) {
+            $map[] = ["type", '=', $type];
+        }
+        return parent::getList($map); // TODO: Change the autogenerated stub
+    }
+
+
+    /**
+     * 添加或编辑
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        $data = request()->all();
+
+        // 图片处理
+        $image = trim($data['image']);
+        if (!$data['id'] && !$image) {
+            return message('请上传站点图片', false);
+        }
+        if (strpos($image, "temp")) {
+            $data['image'] = save_image($image, 'item');
+        } else {
+            $data['image'] = str_replace(IMG_URL, "", $data['image']);
+        }
+        return parent::edit($data); // TODO: Change the autogenerated stub
+    }
+
+    /**
+     * 获取站点列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getItemList()
+    {
+        $list = $this->model->where("status", "=", 1)
+            ->where("mark", "=", 1)
+            ->orderBy("sort", "asc")
+            ->get()
+            ->toArray();
+        return message("操作成功", true, $list);
+    }
+
+}

+ 57 - 0
app/Services/LayoutDescService.php

@@ -0,0 +1,57 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\LayoutDescModel;
+
+/**
+ * 布局描述-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LayoutDescService
+ * @package App\Services
+ */
+class LayoutDescService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * LayoutDescService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new LayoutDescModel();
+    }
+
+    /**
+     * 获取数据列表
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function getList()
+    {
+        $param = request()->all();
+
+        // 查询条件
+        $map = [];
+
+        // 布局描述
+        $loc_desc = getter($param, "loc_desc");
+        if ($loc_desc) {
+            $map[] = ["loc_desc", '=', $loc_desc];
+        }
+        return parent::getList($map); // TODO: Change the autogenerated stub
+    }
+
+}

+ 59 - 0
app/Services/LayoutService.php

@@ -0,0 +1,59 @@
+<?php
+// +----------------------------------------------------------------------
+// | RXThinkCMF框架 [ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京RXThinkCMF研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.rxthink.cn
+// +----------------------------------------------------------------------
+// | Author: 牧羊人 <1175401194@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\LayoutModel;
+
+/**
+ * 布局管理-服务类
+ * @author 牧羊人
+ * @since 2020/11/11
+ * Class LayoutService
+ * @package App\Services
+ */
+class LayoutService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author 牧羊人
+     * @since 2020/11/11
+     * LayoutService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new LayoutModel();
+    }
+
+    /**
+     * 添加或编辑
+     * @return array
+     * @since 2020/11/11
+     * @author 牧羊人
+     */
+    public function edit()
+    {
+        $data = request()->all();
+
+        // 图片处理
+        $image = trim($data['image']);
+        if (!$data['id'] && !$image) {
+            return message('请上传布局图片', false);
+        }
+        if (strpos($image, "temp")) {
+            $data['image'] = save_image($image, 'layout');
+        } else {
+            $data['image'] = str_replace(IMG_URL, "", $data['image']);
+        }
+        return parent::edit($data); // TODO: Change the autogenerated stub
+    }
+
+}

+ 0 - 0
app/Services/LevelService.php


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio