rabin 1 month ago
parent
commit
ccb051f2ab
13 changed files with 435 additions and 538 deletions
  1. 31 39
      manage/code.php
  2. 25 30
      manage/core.php
  3. 27 34
      manage/notify.php
  4. 79 97
      manage/template.php
  5. 22 30
      manage/template_code.php
  6. 14 18
      manage/template_email.php
  7. 13 18
      manage/template_sms.php
  8. 43 52
      table/code.php
  9. 26 32
      table/notify.php
  10. 53 64
      table/template.php
  11. 47 56
      table/template_code.php
  12. 35 43
      table/template_email.php
  13. 20 25
      table/template_sms.php

+ 31 - 39
manage/code.php

@@ -1,39 +1,31 @@
-<?php
-return array
-(
-    'list' => array
-    (
-        'field'      => array
-        (
-            'index' => array
-            (
-                'name' => '序号',
-            ),
-            'account',
-            'code',
-            'record' => array
-            (
-                'type' => 'popover',
-                'title' => '查看',
-                'location' => 'left',
-                'show' => 'Dever::load("msg/manage")->showRecord("{id}")',
-            ),
-            'status',
-            'cdate',
-        ),
-        'button' => array
-        (
-            //'新增' => 'fastadd',
-        ),
-        'data_button' => array
-        (
-            //'设置' => 'fastedit',
-        ),
-        'search' => array
-        (
-            'account',
-            'code',
-            'status',
-        )
-    ),
-);
+<?php
+return [
+    'list' => [
+        'field'      => [
+            'index' => [
+                'name' => '序号',
+            ],
+            'account',
+            'code',
+            'record' => [
+                'type' => 'popover',
+                'title' => '查看',
+                'location' => 'left',
+                'show' => 'Dever::load("msg/manage")->showRecord("{id}")',
+            ],
+            'status',
+            'cdate',
+        ],
+        'button' => [
+            //'新增' => 'fastadd',
+        ],
+        'data_button' => [
+            //'设置' => 'fastedit',
+        ],
+        'search' => [
+            'account',
+            'code',
+            'status',
+        ]
+    ],
+];

+ 25 - 30
manage/core.php

@@ -1,30 +1,25 @@
-<?php
-return array
-(
-    'menu' => array
-    (
-        'msg' => array
-        (
-            'parent' => 'connect',
-            'name' => '消息管理',
-            'icon' => 'message-3-line',
-            'sort' => '70',
-        ),
-
-        'template' => array
-        (
-            'parent'    => 'msg',
-            'name'      => '消息模板',
-            'icon'      => 'message-3-line',
-            'sort'      => '1',
-        ),
-
-        'code' => array
-        (
-            'parent'    => 'msg',
-            'name'      => '验证码记录',
-            'icon'      => 'codepen-fill',
-            'sort'      => '2',
-        ),
-    ),
-);
+<?php
+return [
+    'menu' => [
+        'msg' => [
+            'parent' => 'connect',
+            'name' => '消息管理',
+            'icon' => 'message-3-line',
+            'sort' => '70',
+        ],
+
+        'template' => [
+            'parent'    => 'msg',
+            'name'      => '消息模板',
+            'icon'      => 'message-3-line',
+            'sort'      => '1',
+        ],
+
+        'code' => [
+            'parent'    => 'msg',
+            'name'      => '验证码记录',
+            'icon'      => 'codepen-fill',
+            'sort'      => '2',
+        ],
+    ],
+];

+ 27 - 34
manage/notify.php

@@ -1,34 +1,27 @@
-<?php
-return array
-(
-    'list' => array
-    (
-        'field'      => array
-        (
-            'id',
-            'account',
-            'content',
-            'record' => array
-            (
-                'type' => 'popover',
-                'title' => '查看',
-                'location' => 'right',
-                'show' => '{record}',
-            ),
-            'cdate',
-        ),
-        'button' => array
-        (
-            //'新增' => 'fastadd',
-        ),
-        'data_button' => array
-        (
-            //'设置' => 'fastedit',
-        ),
-        'search' => array
-        (
-            'account',
-            'content',
-        )
-    ),
-);
+<?php
+return [
+    'list' => [
+        'field'      => [
+            'id',
+            'account',
+            'content',
+            'record' => [
+                'type' => 'popover',
+                'title' => '查看',
+                'location' => 'right',
+                'show' => '{record}',
+            ],
+            'cdate',
+        ],
+        'button' => [
+            //'新增' => 'fastadd',
+        ],
+        'data_button' => [
+            //'设置' => 'fastedit',
+        ],
+        'search' => [
+            'account',
+            'content',
+        ]
+    ],
+];

+ 79 - 97
manage/template.php

@@ -1,97 +1,79 @@
-<?php
-return array
-(
-    'list' => array
-    (
-        'field'      => array
-        (
-            'name',
-            'key',
-            'type',
-            'method',
-            'cdate',
-            'status' => array
-            (
-                'type' => 'switch',
-                'show'  => '{status}',
-                'active_value' => 1,
-                'inactive_value' => 2,
-            ),
-        ),
-        'button' => array
-        (
-            '新增' => 'add',
-        ),
-        'data_button' => array
-        (
-            '设置' => 'edit',
-        ),
-        'search' => array
-        (
-            'name',
-            'key',
-            'status',
-        )
-    ),
-    'update' => array
-    (
-        'tab' => array
-        (
-            '基本设置' => 'name,key,content,type,msg/template_code',
-            '功能设置' => 'method,msg/template_sms,msg/template_email',
-        ),
-        'field'    => array
-        (
-            'name',
-            'key',
-            'content' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-                'desc' => '变量用大括号包含即可,如:{name}',
-            ),
-            'type' => 'radio',
-            'msg/template_code' => array
-            (
-                'name' => '验证码设置',
-                'where'  => array('template_id' => 'id'),
-                'default' => array(array()),
-                # 默认使用表格形式展示,可以改成每行展示
-                'type' => 'line',
-            ),
-            
-            'method' => 'checkbox',
-            'msg/template_sms' => array
-            (
-                'name' => '短信设置',
-                'where'  => array('template_id' => 'id'),
-                'default' => array(array()),
-                # 默认使用表格形式展示,可以改成每行展示
-                'type' => 'line',
-            ),
-            'msg/template_email' => array
-            (
-                'name' => '邮件设置',
-                'where'  => array('template_id' => 'id'),
-                'default' => array(array()),
-                # 默认使用表格形式展示,可以改成每行展示
-                'type' => 'line',
-            ),
-        ),
-        'control' => array
-        (
-            'msg/template_code' => array
-            (
-                'type' => 2,
-            ),
-            'msg/template_sms' => array
-            (
-                'method' => array('sms'),
-            ),
-            'msg/template_email' => array
-            (
-                'method' => array('email'),
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'list' => [
+        'field'      => [
+            'name',
+            'key',
+            'type',
+            'method',
+            'cdate',
+            'status' => [
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ],
+        ],
+        'button' => [
+            '新增' => 'add',
+        ],
+        'data_button' => [
+            '设置' => 'edit',
+        ],
+        'search' => [
+            'name',
+            'key',
+            'status',
+        ]
+    ],
+    'update' => [
+        'tab' => [
+            '基本设置' => 'name,key,content,type,msg/template_code',
+            '功能设置' => 'method,msg/template_sms,msg/template_email',
+        ],
+        'field'    => [
+            'name',
+            'key',
+            'content' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+                'desc' => '变量用大括号包含即可,如:{name}',
+            ],
+            'type' => 'radio',
+            'msg/template_code' => [
+                'name' => '验证码设置',
+                'where'  => ['template_id' => 'id'],
+                'default' => [[]],
+                # 默认使用表格形式展示,可以改成每行展示
+                'type' => 'line',
+            ],
+            
+            'method' => 'checkbox',
+            'msg/template_sms' => [
+                'name' => '短信设置',
+                'where'  => ['template_id' => 'id'],
+                'default' => [[]],
+                # 默认使用表格形式展示,可以改成每行展示
+                'type' => 'line',
+            ],
+            'msg/template_email' => [
+                'name' => '邮件设置',
+                'where'  => ['template_id' => 'id'],
+                'default' => [[]],
+                # 默认使用表格形式展示,可以改成每行展示
+                'type' => 'line',
+            ],
+        ],
+        'control' => [
+            'msg/template_code' => [
+                'type' => 2,
+            ],
+            'msg/template_sms' => [
+                'method' => ['sms'],
+            ],
+            'msg/template_email' => [
+                'method' => ['email'],
+            ],
+        ],
+    ],
+];

+ 22 - 30
manage/template_code.php

@@ -1,30 +1,22 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'type' => array
-            (
-                'type' => 'select',
-            ),
-            'timeout' => array
-            (
-                'desc' => '单位为秒数',
-            ),
-            'length' => array
-            (
-                'desc' => '设置验证码生成的长度',
-            ),
-            'total' => array
-            (
-                'desc' => '设置每天可以发送的最大次数',
-            ),
-            'interval' => array
-            (
-                'desc' => '单位为秒数,填写60就是每60秒可以发送一次',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'type' => [
+                'type' => 'select',
+            ],
+            'timeout' => [
+                'desc' => '单位为秒数',
+            ],
+            'length' => [
+                'desc' => '设置验证码生成的长度',
+            ],
+            'total' => [
+                'desc' => '设置每天可以发送的最大次数',
+            ],
+            'interval' => [
+                'desc' => '单位为秒数,填写60就是每60秒可以发送一次',
+            ],
+        ],
+    ],
+];

+ 14 - 18
manage/template_email.php

@@ -1,18 +1,14 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'host' => array
-            (
-                'desc' => '主机地址,端口请用:隔开,格式为host:port',
-            ),
-            'user',
-            'username',
-            'pwd',
-            'title',
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'host' => [
+                'desc' => '主机地址,端口请用:隔开,格式为host:port',
+            ],
+            'user',
+            'username',
+            'pwd',
+            'title',
+        ],
+    ],
+];

+ 13 - 18
manage/template_sms.php

@@ -1,18 +1,13 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'account_key' => array
-            (
-                'desc' => '',
-            ),
-            'code' => array
-            (
-                'desc' => '填写短信模板编码,阿里云短信需要模板编码',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'account_key' => [
+                'desc' => '',
+            ],
+            'code' => [
+                'desc' => '填写短信模板编码,阿里云短信需要模板编码',
+            ],
+        ],
+    ],
+];

+ 43 - 52
table/code.php

@@ -1,52 +1,43 @@
-<?php
-return array
-(
-    'name' => '验证码',
-    'store' => 'log',
-    'order' => 'cdate desc',
-    'struct' => array
-    (
-        'template_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '模板',
-        ),
-
-        'account'      => array
-        (
-            'type'      => 'varchar(50)',
-            'name'      => '账户',
-        ),
-
-        'code'      => array
-        (
-            'type'      => 'varchar(50)',
-            'name'      => '验证码',
-        ),
-
-        'day'      => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '发送的时间',
-            'default'   => '5',
-        ),
-
-        'status'      => array
-        (
-            'type'      => 'tinyint(1)',
-            'name'      => '状态',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '未使用',
-                2 => '已使用',
-            )
-        ),
-
-        'record'        => array
-        (
-            'type'      => 'text(255)',
-            'name'      => '返回记录',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '验证码',
+    'store' => 'log',
+    'order' => 'cdate desc',
+    'struct' => [
+        'template_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '模板',
+        ],
+
+        'account'      => [
+            'type'      => 'varchar(50)',
+            'name'      => '账户',
+        ],
+
+        'code'      => [
+            'type'      => 'varchar(50)',
+            'name'      => '验证码',
+        ],
+
+        'day'      => [
+            'type'      => 'int(11)',
+            'name'      => '发送的时间',
+            'default'   => '5',
+        ],
+
+        'status'      => [
+            'type'      => 'tinyint(1)',
+            'name'      => '状态',
+            'default'   => '1',
+            'value'     => [
+                1 => '未使用',
+                2 => '已使用',
+            ]
+        ],
+
+        'record'        => [
+            'type'      => 'text(255)',
+            'name'      => '返回记录',
+        ],
+    ],
+];

+ 26 - 32
table/notify.php

@@ -1,32 +1,26 @@
-<?php
-return array
-(
-    'name' => '通知记录',
-    'store' => 'log',
-    'struct' => array
-    (
-        'template_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '模板',
-        ),
-
-        'account'      => array
-        (
-            'type'      => 'varchar(50)',
-            'name'      => '账户',
-        ),
-
-        'record'        => array
-        (
-            'type'      => 'text(255)',
-            'name'      => '返回记录',
-        ),
-
-        'content'        => array
-        (
-            'type'      => 'text(255)',
-            'name'      => '发送内容',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '通知记录',
+    'store' => 'log',
+    'struct' => [
+        'template_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '模板',
+        ],
+
+        'account'      => [
+            'type'      => 'varchar(50)',
+            'name'      => '账户',
+        ],
+
+        'record'        => [
+            'type'      => 'text(255)',
+            'name'      => '返回记录',
+        ],
+
+        'content'        => [
+            'type'      => 'text(255)',
+            'name'      => '发送内容',
+        ],
+    ],
+];

+ 53 - 64
table/template.php

@@ -1,64 +1,53 @@
-<?php
-return array
-(
-    'name' => '消息模板',
-    'struct' => array
-    (
-        'name'      => array
-        (
-            'type'      => 'varchar(60)',
-            'name'      => '模板名称',
-        ),
-
-        'key'       => array
-        (
-            'type'      => 'varchar(60)',
-            'name'      => '模板标识',
-        ),
-
-        'type'      => array
-        (
-            'type'      => 'tinyint(1)',
-            'name'      => '模板类型',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '通知',
-                2 => '验证码',
-            ),
-        ),
-
-        'method'      => array
-        (
-            'type'      => 'varchar(100)',
-            'name'      => '模板功能',
-            'default'   => '',
-            'value'     => array
-            (
-                //'letter' => '站内信',
-                'sms' => '短信',
-                'email' => '邮箱',
-                //'wechat' => '微信消息',
-                //'app' => 'APP推送',
-            ),
-        ),
-
-        'content'      => array
-        (
-            'type'      => 'varchar(2000)',
-            'name'      => '模板内容',
-        ),
-
-        'status' => array
-        (
-            'name'      => '状态',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '展示',
-                2 => '不展示',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '消息模板',
+    'struct' => [
+        'name'      => [
+            'type'      => 'varchar(60)',
+            'name'      => '模板名称',
+        ],
+
+        'key'       => [
+            'type'      => 'varchar(60)',
+            'name'      => '模板标识',
+        ],
+
+        'type'      => [
+            'type'      => 'tinyint(1)',
+            'name'      => '模板类型',
+            'default'   => '1',
+            'value'     => [
+                1 => '通知',
+                2 => '验证码',
+            ],
+        ],
+
+        'method'      => [
+            'type'      => 'varchar(100)',
+            'name'      => '模板功能',
+            'default'   => '',
+            'value'     => [
+                //'letter' => '站内信',
+                'sms' => '短信',
+                'email' => '邮箱',
+                //'wechat' => '微信消息',
+                //'app' => 'APP推送',
+            ],
+        ],
+
+        'content'      => [
+            'type'      => 'varchar(2000)',
+            'name'      => '模板内容',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '展示',
+                2 => '不展示',
+            ],
+        ],
+    ],
+];

+ 47 - 56
table/template_code.php

@@ -1,56 +1,47 @@
-<?php
-return array
-(
-    'name' => '验证码设置',
-    'struct' => array
-    (
-        'template_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '模板',
-        ),
-
-        'timeout'      => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '有效期',
-            'default'   => '600',
-        ),
-
-        'length'       => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '长度',
-            'default'   => '4',
-        ),
-
-        'type'      => array
-        (
-            'type'      => 'tinyint(1)',
-            'name'      => '类型',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '全数字',
-                2 => '小写字母',
-                3 => '大写字母',
-                4 => '大小写字母',
-                5 => '数字+大小写字母',
-            ),
-        ),
-
-        'total'      => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '最大发送次数',
-            'default'   => '5',
-        ),
-
-        'interval'       => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '发送间隔',
-            'default'   => '60',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '验证码设置',
+    'struct' => [
+        'template_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '模板',
+        ],
+
+        'timeout'      => [
+            'type'      => 'int(11)',
+            'name'      => '有效期',
+            'default'   => '600',
+        ],
+
+        'length'       => [
+            'type'      => 'int(11)',
+            'name'      => '长度',
+            'default'   => '4',
+        ],
+
+        'type'      => [
+            'type'      => 'tinyint(1)',
+            'name'      => '类型',
+            'default'   => '1',
+            'value'     => [
+                1 => '全数字',
+                2 => '小写字母',
+                3 => '大写字母',
+                4 => '大小写字母',
+                5 => '数字+大小写字母',
+            ],
+        ],
+
+        'total'      => [
+            'type'      => 'int(11)',
+            'name'      => '最大发送次数',
+            'default'   => '5',
+        ],
+
+        'interval'       => [
+            'type'      => 'int(11)',
+            'name'      => '发送间隔',
+            'default'   => '60',
+        ],
+    ],
+];

+ 35 - 43
table/template_email.php

@@ -1,43 +1,35 @@
-<?php
-return array
-(
-    'name' => '邮箱设置',
-    'struct' => array
-    (
-        'template_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '模板',
-        ),
-
-        'host'      => array
-        (
-            'type'      => 'varchar(100)',
-            'name'      => '主机地址',
-        ),
-
-        'user'      => array
-        (
-            'type'      => 'varchar(100)',
-            'name'      => '邮件账户',
-        ),
-
-        'pwd'      => array
-        (
-            'type'      => 'varchar(100)',
-            'name'      => '账户密码',
-        ),
-
-        'username'      => array
-        (
-            'type'      => 'varchar(100)',
-            'name'      => '账户名称',
-        ),
-
-        'title'      => array
-        (
-            'type'      => 'varchar(100)',
-            'name'      => '邮件默认标题',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '邮箱设置',
+    'struct' => [
+        'template_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '模板',
+        ],
+
+        'host'      => [
+            'type'      => 'varchar(100)',
+            'name'      => '主机地址',
+        ],
+
+        'user'      => [
+            'type'      => 'varchar(100)',
+            'name'      => '邮件账户',
+        ],
+
+        'pwd'      => [
+            'type'      => 'varchar(100)',
+            'name'      => '账户密码',
+        ],
+
+        'username'      => [
+            'type'      => 'varchar(100)',
+            'name'      => '账户名称',
+        ],
+
+        'title'      => [
+            'type'      => 'varchar(100)',
+            'name'      => '邮件默认标题',
+        ],
+    ],
+];

+ 20 - 25
table/template_sms.php

@@ -1,25 +1,20 @@
-<?php
-return array
-(
-    'name' => '短信设置',
-    'struct' => array
-    (
-        'template_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '模板',
-        ),
-
-        'account_key'      => array
-        (
-            'type'      => 'varchar(50)',
-            'name'      => '账户标识',
-        ),
-
-        'code'      => array
-        (
-            'type'      => 'varchar(50)',
-            'name'      => '短信模板编码',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '短信设置',
+    'struct' => [
+        'template_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '模板',
+        ],
+
+        'account_key'      => [
+            'type'      => 'varchar(50)',
+            'name'      => '账户标识',
+        ],
+
+        'code'      => [
+            'type'      => 'varchar(50)',
+            'name'      => '短信模板编码',
+        ],
+    ],
+];