893 Commits

Author SHA1 Message Date
JaguarJack
d7d36a28c0 update composer 2024-01-08 10:27:29 +08:00
JaguarJack
613ccca7b4 update composer 2024-01-08 10:21:08 +08:00
Jack Jaguar
07eaa5c274 fix:修复类型错误 2024-01-08 10:20:20 +08:00
JaguarJack
2e81eb42d3 update catch/permissions/database/seeds/DepartmentsSeed.php.
Signed-off-by: JaguarJack <njphper@gmail.com>
2024-01-08 00:36:16 +00:00
JaguarJack
8561c54f5f Update composer.json 2022-12-31 10:39:32 +08:00
JaguarJack
65051ca1ef docs 2022-12-09 14:50:47 +08:00
JaguarJack
a35b212e7b docs: update demo website 2022-12-08 15:55:02 +08:00
JaguarJack
a514663598 Merge https://github.com/JaguarJack/catch-admin 2022-08-18 18:10:33 +08:00
JaguarJack
4300c0a5c2 update README.md. 2022-06-13 02:52:32 +00:00
JaguarJack
9714488c7a update README.md. 2022-05-23 10:19:08 +00:00
JaguarJack
f7bc539f81 update README.md. 2022-05-23 10:18:48 +00:00
JaguarJack
fcd9759061 !17 修复 validateNum 方法名与其他Trait方法名冲突
Merge pull request !17 from 邓小明/N/A
2022-03-31 08:36:47 +00:00
邓小明
76379d619d 修复 validateNum 方法名与其他Trait方法名冲突 2022-03-31 08:35:08 +00:00
JaguarJack
4ebcd731fa !16 修正FormValidates纯字母验证
Merge pull request !16 from 邓小明/N/A
2022-03-31 08:11:34 +00:00
邓小明
66e1411bfe 修正FormValidates纯字母验证 2022-03-31 08:04:51 +00:00
JaguarJack
614a159ece Merge pull request #37 from hhun/patch-1 2022-01-10 19:26:07 +08:00
JaguarJack
16a3689794 !15 修复后台【API管理】不显示子菜单问题
Merge pull request !15 from 邓小明/N/A
2022-01-09 06:53:02 +00:00
小天赋
6f3e9f268e 修复后台【API管理】不显示子菜单问题
原有是菜单是一级分类,修复子菜单不会动态对应父菜单的 parent_id 问题
2022-01-09 12:58:09 +08:00
邓小明
e7c2078a2d 修复后台【API管理】不显示子菜单问题
原有是菜单是一级分类,修复子菜单不会动态对应父菜单的 parent_id 问题
2022-01-09 04:46:43 +00:00
JaguarJack
6af3fa413c Merge branch 'master' of https://gitee.com/jaguarjack/catchAdmin 2022-01-04 14:46:18 +08:00
JaguarJack
c5ca2ad3db style: 增加方法的参数类型 2022-01-04 14:45:03 +08:00
JaguarJack
7b180e46a7 style: 升级 tp 核心至 lts 2022-01-04 14:44:21 +08:00
JaguarJack
841fd47487 !14 【轻量级 PR】:新增 action 可自定义icon
Merge pull request !14 from 青芒/N/A
2021-12-24 00:13:56 +00:00
青芒
f14a00d630 新增 action 可自定义icon
新增 action 可自定义icon
2021-12-23 15:05:07 +00:00
JaguarJack
513eba9195 导入 csv 支持中文 2021-12-08 15:36:18 +08:00
JaguarJack
9a5a1cad2d update readme 2021-11-30 14:37:21 +08:00
JaguarJack
f9b87f10a0 !13 修复windows下导出excel路径错误的bug
Merge pull request !13 from Hooper/master
2021-11-22 01:33:28 +00:00
hooper
cb799bf88a 修复windows下导出excel路径错误的bug 2021-11-22 09:13:48 +08:00
JaguarJack
bea3d1825a Merge branch 'master' of https://gitee.com/jaguarjack/catchAdmin 2021-11-18 11:30:55 +08:00
JaguarJack
326a6571b2 update 过滤更新非必要数据 2021-11-18 11:29:43 +08:00
JaguarJack
120cd494c6 !12 apimanager模块添加routelist
Merge pull request !12 from UCT/master
2021-11-12 09:45:22 +00:00
uctoo
e648d1b150 apimanager add routelist 2021-11-12 16:52:09 +08:00
JaguarJack
a76b73e769 !10 修复定时任务状态切换
Merge pull request !10 from Hooper/master
2021-10-28 09:17:32 +00:00
hooper
bc4582caf4 ä¿修复定时任务列表妆åç妆åæ状态 2021-10-28 11:16:11 +08:00
JaguarJack
16586cdd14 update 2021-09-29 12:03:43 +08:00
JaguarJack
bc45ab6be8 update: 获取角色权限 2021-09-26 20:35:57 +08:00
JaguarJack
5e6c329b97 remove 2021-09-16 16:29:49 +08:00
JaguarJack
a350e86494 Merge branch 'master' of https://gitee.com/jaguarjack/catchAdmin 2021-09-14 14:46:56 +08:00
JaguarJack
f7299bb247 fixed:issue#34 2021-09-14 14:45:51 +08:00
JaguarJack
315b4accb7 !8 quickSearch
Merge pull request !8 from jhs1873/master
2021-09-08 01:42:56 +00:00
jhs1873
b908276555 🐞 fix: quickSearch 2021-09-07 16:37:20 +08:00
JaguarJack
3728bd2068 fixed: 超管角色返回全部权限 2021-08-31 14:16:13 +08:00
uctoo
086951f879 add index.html for cloudbase deploy detect 2021-08-20 19:13:09 +08:00
JaguarJack
c5164e25e9 update table fixed 2021-08-19 19:37:31 +08:00
JaguarJack
66e2ea5141 修复 表生成 nullable 错误 2021-08-06 10:20:26 +08:00
JaguarJack
ddb2e0aee1 更新:模型字段注释 2021-08-06 10:05:57 +08:00
JaguarJack
f8174e0520 新增:获取角色权限 2021-07-29 17:58:22 +08:00
JaguarJack
9b75e25c81 Merge branch 'master' of https://gitee.com/jaguarjack/catchAdmin 2021-07-29 16:01:33 +08:00
JaguarJack
5bd93be105 fixed:用户选择角色 2021-07-29 15:59:26 +08:00
JaguarJack
9d4b4ef2cb !6 update apimanager module README doc
Merge pull request !6 from UCT/master
2021-07-28 10:24:24 +00:00
uctoo
427d1a1a2b update apimanager module README doc 2021-07-28 17:05:04 +08:00
JaguarJack
9a23d578b9 !5 add apimanager module catch-admin-vue files and README doc
Merge pull request !5 from UCT/master
2021-07-28 07:43:25 +00:00
uctoo
a1d82020ed add apimanager module catch-admin-vue files and README doc 2021-07-28 15:29:26 +08:00
JaguarJack
11f5180dd6 !4 add apimanager module
Merge pull request !4 from UCT/master
2021-07-27 09:16:13 +00:00
uctoo
b784251605 add apimanager module 2021-07-27 16:49:30 +08:00
JaguarJack
7ad6bacb2d update 2021-07-20 16:27:52 +08:00
JaguarJack
5db73b651f update version 2021-07-19 07:47:09 +08:00
82664165@qq.com
50ac3b60f7 fixed 权限模型Insert后事件 2021-07-01 11:17:22 +08:00
JaguarJack
b927f92ef1 新增便捷的cache操作 2021-06-18 17:19:08 +08:00
JaguarJack
99e53be3e4 fixed 代码生成预览bug 2021-06-18 16:50:16 +08:00
JaguarJack
d53e8c46af update 2021-06-16 08:53:53 +08:00
JaguarJack
205d673432 update 2021-06-16 08:53:03 +08:00
JaguarJack
a0e906b5e1 update route generate 2021-06-10 19:52:57 +08:00
JaguarJack
b4d5fddc73 Merge branch 'master' of https://gitee.com/jaguarjack/catchAdmin 2021-06-10 19:39:00 +08:00
JaguarJack
15c271eafb update 模版生成 2021-06-10 19:38:44 +08:00
JaguarJack
116a576965 !3 add create:seed command
Merge pull request !3 from UCT/master
2021-06-06 17:15:02 +08:00
uctoo
d757f3130e add create:seed command 2021-06-06 17:09:31 +08:00
uctoo
22ad849900 add create:seed command 2021-06-06 15:57:50 +08:00
JaguarJack
72bf97579b update cms 2021-05-31 08:43:40 +08:00
JaguarJack
44f5bf345b 新增模型自动关联功能 2021-05-31 08:43:29 +08:00
JaguarJack
9873a2156b update cms 2021-05-27 08:55:09 +08:00
JaguarJack
af8e6c3f5d add cms banners 2021-05-26 20:35:19 +08:00
JaguarJack
4b30123aa4 update form library 2021-05-26 18:37:27 +08:00
JaguarJack
454dd3deff update db options 2021-05-26 18:37:14 +08:00
JaguarJack
9252c3d537 update cms 2021-05-26 18:37:00 +08:00
JaguarJack
d97b5f62ee Merge branch 'master' of https://gitee.com/jaguarjack/catchAdmin 2021-05-25 08:28:27 +08:00
JaguarJack
95c6059aa1 支持 tree 动态切换 pk 主键名称 2021-05-25 08:28:19 +08:00
JaguarJack
d6e5fa091a update cms category 2021-05-24 21:17:27 +08:00
JaguarJack
bcfb184618 update BaseOptions 2021-05-24 21:16:35 +08:00
JaguarJack
e105bef460 update cms category event 2021-05-24 21:08:01 +08:00
JaguarJack
3bad548d10 update cms 2021-05-24 18:25:33 +08:00
JaguarJack
034705bb3d cms update 2021-05-23 20:35:21 +08:00
JaguarJack
5abc675e5d update 2021-05-23 20:34:50 +08:00
JaguarJack
ece133c3df 新增 cms seeds 2021-05-22 11:09:36 +08:00
JaguarJack
f81eaf40af cms first commit 2021-05-22 11:02:45 +08:00
JaguarJack
0f24c9c580 修改创建table命令大小写 2021-05-17 08:56:28 +08:00
JaguarJack
b55ca29fb2 更新创建table命令 2021-05-17 08:42:52 +08:00
JaguarJack
8c307cd4fb 权限模型更新 2021-05-16 21:24:23 +08:00
JaguarJack
1f30ead774 修改权限更新 2021-05-16 17:24:02 +08:00
JaguarJack
3b1246533d 修改表格头组件 2021-05-16 17:23:22 +08:00
JaguarJack
8f0bdf3167 更新编辑器组件 2021-05-16 17:22:58 +08:00
JaguarJack
f03421008a fixed #33 2021-05-14 08:36:45 +08:00
JaguarJack
66673a0714 权限fields添加level字段 2021-05-13 20:22:07 +08:00
JaguarJack
ef69476a4c 新增复制组件 2021-05-13 08:46:17 +08:00
JaguarJack
5deae744c4 更新 zip 组件 2021-05-13 08:45:47 +08:00
JaguarJack
dd32637d56 update 2021-05-13 08:45:32 +08:00
JaguarJack
d72f4b1509 Merge pull request #32 from tlerbao/patch-3
Update HeaderItem.php
2021-05-12 16:19:39 +08:00
JaguarJack
af569406cb table新增 tips 提示 2021-05-12 08:10:56 +08:00
JaguarJack
2f5c62666a form组件隐藏域新增默认值 2021-05-12 08:09:58 +08:00
Talent.Miao
1b18403c5e Update HeaderItem.php
表格类新增对齐方式
2021-05-11 22:27:48 +08:00
JaguarJack
67363e6478 表头增加可显状态 2021-05-11 18:48:10 +08:00
JaguarJack
95d294afcd fixed 新增action错误 2021-05-10 18:34:18 +08:00
JaguarJack
3202a608a2 新增链接组件 2021-05-09 17:09:53 +08:00
JaguarJack
ed0521dc92 新增动态代理 2021-05-09 17:09:18 +08:00
JaguarJack
4f1eeae989 更新上传接口 2021-05-09 17:08:48 +08:00
JaguarJack
0a4951091f fixed 控制器模型as首字母小写bug 2021-05-08 07:34:06 +08:00
JaguarJack
f44f646878 fixed 附件本地删除 2021-05-08 07:32:09 +08:00
JaguarJack
c40b03a222 button 新增按钮权限功能 2021-05-08 07:31:41 +08:00
JaguarJack
58aea6c0db 更新table组件 2021-05-07 08:41:41 +08:00
JaguarJack
666b837327 新增头像字段 2021-05-05 14:23:54 +08:00
JaguarJack
174e9e39c0 新增 preview 组件 & table 的excel 操作设置默认值 2021-05-04 01:25:40 +08:00
JaguarJack
c221f0fe4a 新增 form 组件字段可变 2021-05-03 14:47:30 +08:00
JaguarJack
afeca7286c 新增添加索引和删除索引方法 2021-05-03 10:55:54 +08:00
JaguarJack
8714f80716 fixed 2021-05-03 10:54:37 +08:00
JaguarJack
4abed197aa 模块创建新增创建table&form文件夹 2021-04-29 08:48:49 +08:00
JaguarJack
6c22fed48d button 新增路由跳转 2021-04-29 08:48:24 +08:00
JaguarJack
4580815fca 新增快速创建模块表格文件命令 2021-04-29 08:47:59 +08:00
JaguarJack
f520d20574 fixed 更新子级错误 2021-04-29 08:47:32 +08:00
JaguarJack
364544303a 升级核心版本 2021-04-29 08:46:17 +08:00
JaguarJack
e75af49add add bind 方法 2021-04-28 08:34:30 +08:00
JaguarJack
58286b181b 模型生成新增字段属性注释 2021-04-27 18:33:59 +08:00
JaguarJack
41aa81069c 新增 bind 方法 2021-04-27 18:33:34 +08:00
JaguarJack
0600fc1dbb update 2021-04-27 18:33:01 +08:00
JaguarJack
08a835ccb9 update table 组件 2021-04-27 08:47:56 +08:00
JaguarJack
2955e17a6a fixed module.json 丢失导致错误 2021-04-26 10:37:52 +08:00
JaguarJack
5513501786 update 新增更新子级信息 2021-04-26 10:37:18 +08:00
JaguarJack
05ba3dd197 delete 2021-04-25 13:41:45 +08:00
JaguarJack
fb579a5771 update:新增选择数据权限默认选项#gitee#issueI3NNH1 2021-04-24 20:35:33 +08:00
JaguarJack
4e1e040936 add:新增导入导出公共接口 2021-04-24 20:32:36 +08:00
JaguarJack
38e10896d4 update:新增模型导入方法 2021-04-24 20:32:05 +08:00
JaguarJack
ba1595f75f update:新增本地上传方法 2021-04-24 20:31:45 +08:00
JaguarJack
566514f729 delete:transtrait 2021-04-24 20:31:19 +08:00
JaguarJack
48c41f7948 add:新增excel的导入导出组件 2021-04-24 20:30:28 +08:00
JaguarJack
f67a4f33d5 add:新增导入组件 2021-04-24 20:29:33 +08:00
JaguarJack
ae53d4e404 add:新增菜单创建restful快捷方式 2021-04-20 18:56:05 +08:00
JaguarJack
504054b68e add:新增获取省市区数据命令 2021-04-20 08:46:14 +08:00
JaguarJack
ceb5a396d8 update:优化基础组件 2021-04-20 08:45:08 +08:00
JaguarJack
be91cfbc4f fixed#gitee#I3J1IL 2021-04-18 07:45:02 +08:00
JaguarJack
898ffbc822 update:更新Editor组件 2021-04-11 21:01:41 +08:00
JaguarJack
f321a71677 update:更新table&form组件 2021-04-10 21:57:51 +08:00
JaguarJack
246d2caf44 update:修改搜索label文字错误 2021-04-10 08:13:34 +08:00
JaguarJack
d020c99db3 fixed:权限菜单错误&用户修改密码 2021-04-09 08:07:22 +08:00
JaguarJack
44b74d53d9 update:更新一些页面操作 2021-04-05 22:11:36 +08:00
JaguarJack
4e170dbd17 add:新增强制更新组件方法 2021-04-05 22:03:25 +08:00
JaguarJack
f7c8d65ea9 update:更新搜索组件 2021-04-05 12:26:31 +08:00
JaguarJack
5b6e34f3fe update:更新权限列表搜索 2021-04-05 12:26:12 +08:00
JaguarJack
b79b226a74 update:重新渲染system页面 2021-04-03 12:50:21 +08:00
JaguarJack
6ba18dfad2 update:更新action操作 2021-04-03 12:49:55 +08:00
JaguarJack
6630058508 delete:删除冗余 2021-04-03 10:35:53 +08:00
JaguarJack
0bbb39696b update:更新表单action 2021-04-03 10:35:21 +08:00
JaguarJack
7fd87caa36 fixed 2021-04-02 12:05:44 +08:00
JaguarJack
2125966684 fixed:class not found 2021-04-01 20:17:25 +08:00
JaguarJack
4180cb2565 update:更新路由注释,编辑器可追踪 2021-04-01 18:39:11 +08:00
JaguarJack
dffad1e2c4 update:更新菜单列表 2021-03-31 20:44:40 +08:00
JaguarJack
3d70495836 update:更新数据 2021-03-31 20:23:18 +08:00
JaguarJack
6372ccd877 新增路由 2021-03-31 20:21:39 +08:00
JaguarJack
2ad466e617 update:table组件 2021-03-31 20:21:16 +08:00
JaguarJack
5ce104e820 update:form组件 2021-03-31 20:21:02 +08:00
JaguarJack
f56cb943ff add:新增catchTable 2021-03-31 20:20:47 +08:00
JaguarJack
2b96f3b650 update:更新权限系统 2021-03-31 20:20:21 +08:00
JaguarJack
d4020b93a3 add:新增table组件 2021-03-29 19:52:01 +08:00
JaguarJack
2f25a0892e update:更新form功能 2021-03-29 19:51:41 +08:00
JaguarJack
114387d030 update readme 2021-03-28 13:00:20 +08:00
JaguarJack
e3ab44e6d3 fixed:代码生成表失败 2021-03-25 17:51:24 +08:00
Talent.Miao
0d918c9446 修复代码生成Bug 2021-03-25 16:29:46 +08:00
JaguarJack
002ad814e5 fixed:冲突 2021-03-14 07:47:46 +08:00
JaguarJack
b4a1e9bc4e add:新增表单生成 2021-03-14 07:42:01 +08:00
JaguarJack
822ff3874a update:优化代码生成 2021-03-14 07:41:15 +08:00
JaguarJack
78ca9bebc4 rm 2021-03-07 10:52:08 +08:00
JaguarJack
7b7f13536f Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2021-03-06 20:06:28 +08:00
JaguarJack
766a01e766 update:更新快捷搜索 2021-03-06 20:05:20 +08:00
JaguarJack
3196292c85 Merge pull request #28 from tlerbao/patch-1
修复带有表前缀时找不到字段的问题
2021-03-02 08:07:43 +08:00
JaguarJack
f45b9315a9 update:更新aliasField方法,支持数组 2021-03-01 21:02:01 +08:00
JaguarJack
c3b36013d7 fixed:修复附件无法删除 2021-03-01 21:01:37 +08:00
JaguarJack
17491ca7da add: 新增implode方法 2021-03-01 21:00:09 +08:00
Talent.Miao
d1423eb6e8 修复带有表前缀时找不到字段的问题 2021-03-01 09:43:21 +08:00
JaguarJack
c190672603 update:优化代码 2021-02-27 18:31:59 +08:00
JaguarJack
ddf521b62b add:新增 implode 方法 2021-02-27 18:30:40 +08:00
JaguarJack
50c8470d73 update:优化auth 2021-02-22 08:52:39 +08:00
JaguarJack
e9179ee084 update 2021-02-10 08:33:17 +08:00
JaguarJack
adb7ff5a03 fixed:gitee Issue#I37RKN 2021-02-08 17:28:25 +08:00
JaguarJack
706410480b update:优化部分代码 2021-02-08 11:26:54 +08:00
JaguarJack
61ecd0629f update:优化模块信息获取 2021-02-08 11:12:36 +08:00
JaguarJack
84c85c3d12 fixed:修复定时任务立即执行导致任务执行混乱 2021-02-08 10:25:03 +08:00
JaguarJack
d8496f9e62 update:更新自定义权限 2021-02-07 17:21:34 +08:00
JaguarJack
1495a4c731 update:更新crontab 2021-02-07 09:42:01 +08:00
JaguarJack
0efe79ddb3 update:修复多数据库切换之后CatchQuery方法失效 2021-02-05 13:52:23 +08:00
JaguarJack
068234b57c update:auth增加忽略密码验证,适配第三方登陆 2021-01-27 14:01:17 +08:00
JaguarJack
dc1ce92194 update 2021-01-24 20:27:27 +08:00
JaguarJack
937e1745d2 update:更新默认加载commands 2021-01-24 20:24:43 +08:00
JaguarJack
9f6f02ad24 update:更新上传路由 2021-01-20 20:30:04 +08:00
JaguarJack
340e8c356b fixed:捕获异常以Json方式返回 2021-01-20 20:12:08 +08:00
JaguarJack
65d3111e65 fixed:修复oss上传 2021-01-20 20:09:06 +08:00
JaguarJack
22a8574824 fixed:空值配置无法更新 2021-01-20 19:53:19 +08:00
JaguarJack
584477f711 update:更新包 2021-01-20 19:20:09 +08:00
JaguarJack
2ae7efce04 add:新增初始化管理密码命令 2021-01-20 19:19:28 +08:00
JaguarJack
b12edc9439 update:更新调度 2021-01-18 09:29:02 +08:00
JaguarJack
c02297ab91 更新:支持app commands 自动载入 2021-01-17 20:51:05 +08:00
JaguarJack
b2b6dbd5ed Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2021-01-17 11:22:13 +08:00
JaguarJack
3f154e5fb5 更新:定时任务重新修改 2021-01-17 11:21:52 +08:00
JaguarJack
cff7b38058 update:开启短线重连 2021-01-17 11:17:37 +08:00
JaguarJack
849493eea2 add:新增请求过滤空值方法 2021-01-17 09:39:18 +08:00
JaguarJack
8cace712ae update readme 2020-12-27 13:20:44 +08:00
JaguarJack
b44c8838c4 add:新增隐藏字段功能 2020-12-27 12:33:30 +08:00
JaguarJack
901c7f6cd7 update:更新定时任务搜索 2020-12-26 22:27:06 +08:00
JaguarJack
870e81ab9d add:新增快速搜索 2020-12-26 22:26:36 +08:00
JaguarJack
d4ec2d104f fixed:修改命令行无法生成model field 2020-12-26 20:56:10 +08:00
JaguarJack
614448d07a update:更新监控路由 2020-12-26 20:54:34 +08:00
JaguarJack
dcbe82f398 fixed:修复创建模块 2020-12-13 10:16:46 +08:00
JaguarJack
afe70d39b9 fixed:修复CatchJoin无法连接同一个模型两次 2020-12-13 10:16:28 +08:00
JaguarJack
9118e07d7b fixed 2020-12-04 21:09:50 +08:00
JaguarJack
c0f05fcf8f fixed:模型生成数据库字段注释标记错误 2020-12-01 17:58:53 +08:00
JaguarJack
35445f37e1 fixed:模型name属性多加了表前缀 2020-12-01 17:55:36 +08:00
JaguarJack
94c430f491 update 2020-11-29 09:29:14 +08:00
JaguarJack
97efb82971 update:强制依赖jwt包 2020-11-29 09:18:07 +08:00
JaguarJack
5f49a22a5e add:新增用户token字段 2020-11-23 19:57:49 +08:00
JaguarJack
85f4fc0df8 update:个人信息校验邮箱唯一性 2020-11-21 20:07:36 +08:00
JaguarJack
04a7818608 fixed bug 2020-11-21 12:33:55 +08:00
JaguarJack
21c1df4f69 update:class增加when方法 2020-11-19 19:11:18 +08:00
JaguarJack
0dfe4fb5c6 fixed 2020-11-19 17:44:11 +08:00
JaguarJack
9ca1fd42ae update 2020-11-19 17:31:57 +08:00
JaguarJack
5713d12ce1 updae:基于AST重构代码生成 2020-11-19 17:31:31 +08:00
JaguarJack
e01790aa23 update:composer新增查找package方法 2020-11-19 17:31:04 +08:00
JaguarJack
ecf0970ca4 fixed:修复搜索参数值为0时导致搜索错误 2020-11-19 17:30:30 +08:00
JaguarJack
78e782dd01 fixed:云上传配置无法生效 2020-11-19 09:42:54 +08:00
JaguarJack
e4a5ae0c37 add:新增创建模块 2020-11-14 18:24:33 +08:00
JaguarJack
c8e9e6361c add:新增字段自增/减少方法 2020-11-04 14:09:23 +08:00
JaguarJack
7c4fa5c516 update:优化用户的部门搜索,减少SQL 2020-11-04 10:06:23 +08:00
JaguarJack
97b7f73ff2 add:新增模型获取所有子节点方法 2020-11-04 10:05:50 +08:00
JaguarJack
0b5c883012 update:支持无限级部门搜索 2020-11-04 08:20:15 +08:00
JaguarJack
a9671b6227 update:更新路由 2020-11-03 08:12:10 +08:00
JaguarJack
9ab22b1a1c update:移除角色与部门关联 2020-10-29 08:13:20 +08:00
JaguarJack
a931b7597c update:升级tp核心 2020-10-29 08:01:27 +08:00
JaguarJack
4506219fb2 update:优化auth认证 2020-10-26 19:09:28 +08:00
JaguarJack
91a1d253c5 update:更新request验证 2020-10-26 11:20:42 +08:00
JaguarJack
3d58942844 fixed:SQL解析错误 2020-10-23 15:45:47 +08:00
JaguarJack
e0b2aafd2c update:readme 2020-10-21 18:21:21 +08:00
JaguarJack
7278be4e49 add:新增模型数据缓存 2020-10-21 17:23:22 +08:00
JaguarJack
a62020650c add:新增模型导出 2020-10-21 13:54:55 +08:00
JaguarJack
9baadccfbb add:新增Collection toTree方法 2020-10-21 08:12:07 +08:00
JaguarJack
538006c3c6 update:rewrite request post,自动填入 creator_id 数据 2020-10-15 10:00:35 +08:00
JaguarJack
e2399b6aa6 add:新增域名管理权限 2020-10-14 20:58:34 +08:00
JaguarJack
c5aee52667 update:更新附件删除 2020-10-14 20:17:18 +08:00
JaguarJack
8991315888 add:新增忽略ssl方法 2020-10-14 20:07:36 +08:00
JaguarJack
9754a23360 update:初始化数据更新 2020-10-12 19:24:51 +08:00
JaguarJack
753f6b9dcf fixed:模块列表排除超级管理员 2020-10-12 14:15:41 +08:00
JaguarJack
bcb96cd3c4 update:更新模块列表 2020-10-12 14:00:40 +08:00
JaguarJack
3908c26e2c add:新增GET方法单独的认证标识 2020-10-12 12:22:05 +08:00
JaguarJack
f17570deef uodate:数据获取用户角色,无需用户传参 2020-10-12 10:18:51 +08:00
JaguarJack
390fc8ccd5 update:更新路由 2020-09-29 14:43:07 +08:00
JaguarJack
4d9f57a8c7 update:修改操作日志搜索 2020-09-29 14:34:11 +08:00
JaguarJack
b8e08eac96 update:升级框架至6.0.4 2020-09-29 14:33:45 +08:00
JaguarJack
bece4dac86 delete:冗余模块 2020-09-28 11:14:02 +08:00
JaguarJack
4b8d5aa507 add:域名管理 2020-09-28 09:55:30 +08:00
JaguarJack
5ec24ae9c9 update:模块配置加载 2020-09-26 15:11:50 +08:00
JaguarJack
25c5faf440 add:域名管理first commit 2020-09-26 15:10:41 +08:00
JaguarJack
097b0e1ee5 fixed:登录日志删除失败 2020-09-25 10:47:20 +08:00
JaguarJack
09b20c255b Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-09-25 07:31:04 +08:00
JaguarJack
a3db671328 update:更新服务监控配置至模块内 2020-09-25 07:30:49 +08:00
JaguarJack
33177f26cb update:新增登录日志搜索 2020-09-24 12:19:41 +08:00
JaguarJack
45712076d2 fixed:模块Json文件无法写入 2020-09-23 08:05:31 +08:00
JaguarJack
5979088144 add:新增服务缓存,提高性能 2020-09-22 11:14:51 +08:00
JaguarJack
42e6cd36aa update:优化登录 2020-09-22 11:13:53 +08:00
JaguarJack
08b3e472a9 upate:支持增量权限菜单倒入 2020-09-21 16:14:27 +08:00
JaguarJack
42b99dd64c 更新README 2020-09-21 09:17:25 +08:00
JaguarJack
e412fd3b60 add:新增表单构建器 2020-09-21 09:16:12 +08:00
JaguarJack
4f0c37d281 add:新增用户信息编辑 2020-09-21 08:06:24 +08:00
JaguarJack
bae186d82a fixed:用户请求 2020-09-20 12:05:19 +08:00
JaguarJack
5223997031 update:优化定时任务日志记录 2020-09-20 09:50:48 +08:00
JaguarJack
5fa20a4f28 update:更新初始化密码 2020-09-19 21:17:41 +08:00
JaguarJack
0cd799dce3 update:默认模块排序 2020-09-19 16:10:08 +08:00
JaguarJack
72a878ed30 update:sms初始化关闭 2020-09-19 16:07:54 +08:00
JaguarJack
5f65e3d25f fixed:定时任务不执行 2020-09-19 16:07:32 +08:00
JaguarJack
66ec4f174d fixed:修复验证消息没有按设置提示 2020-09-18 18:53:46 +08:00
JaguarJack
64ab5439a6 升级composer.json 2020-09-17 21:22:23 +08:00
JaguarJack
0558764093 update:readme 2020-09-17 21:22:11 +08:00
JaguarJack
4216a48907 update:更新代码生成 2020-09-17 21:15:24 +08:00
JaguarJack
8b65690450 update:更新删除方法 2020-09-17 21:14:34 +08:00
JaguarJack
4f461bb673 add:新增短信平台管理 2020-09-17 21:14:00 +08:00
JaguarJack
e30de13d35 update:修改指令 2020-09-17 15:17:22 +08:00
JaguarJack
c72943da58 update:更新定时任务配置和初始化数据 2020-09-16 10:14:27 +08:00
JaguarJack
a98fbdc7a1 add:新增定时任务基类 2020-09-16 10:08:05 +08:00
JaguarJack
42ffcb75c7 update:更新whereLike查询 2020-09-16 10:07:34 +08:00
JaguarJack
c74c3c23d4 add:新增监控模块 2020-09-16 10:06:20 +08:00
JaguarJack
5211d29c5e update readme 2020-09-14 10:07:03 +08:00
JaguarJack
82dc1ebd05 update:更新初始化数据 2020-09-13 11:16:16 +08:00
JaguarJack
e35532850d update:更新微信菜单 2020-09-13 11:13:09 +08:00
JaguarJack
0da4627217 update:微信回复 2020-09-13 10:05:22 +08:00
JaguarJack
5fd218d26a update:更新模块管理 2020-09-12 18:35:31 +08:00
JaguarJack
ee624300b6 新增模块管理 2020-09-12 17:22:43 +08:00
JaguarJack
dc4855f5c1 fixed:数据字典分页查询 2020-09-12 11:11:59 +08:00
JaguarJack
9e13a9c937 upadte:优化路由写入 2020-09-11 18:19:06 +08:00
JaguarJack
90990f8782 update:微信模块初始化未安装状态 2020-09-11 07:43:44 +08:00
JaguarJack
40276babfb update:更新安装&新增本地模块安装 2020-09-11 07:42:38 +08:00
JaguarJack
818ffb2ce6 fixed:修复异常code 2020-09-09 11:35:01 +08:00
JaguarJack
763a05fa80 update:优化登录 2020-09-09 10:40:44 +08:00
JaguarJack
8c153cce60 update:转换路径 2020-09-08 19:54:05 +08:00
JaguarJack
93b6f1e2f1 fixed:数据字典分页 2020-09-08 19:36:24 +08:00
JaguarJack
61b9a07d99 update:新增角色标识唯一性 2020-09-08 16:25:36 +08:00
JaguarJack
d75c455bdc update:更新用户部门搜索 2020-09-08 14:36:32 +08:00
JaguarJack
04e2b1ffe5 update:更新项目安装,增加项目domain配置 2020-09-08 14:34:03 +08:00
JaguarJack
14b5b3ce3a update:更新角色初始化数据 2020-09-08 14:31:30 +08:00
JaguarJack
a4e84ffa75 update:更新配置 2020-09-08 14:13:00 +08:00
JaguarJack
bd7f62b9ed add:新增导出用户 2020-09-08 14:12:42 +08:00
JaguarJack
3a2689db18 update:更新部分组件 2020-09-08 14:10:27 +08:00
JaguarJack
3fb55deaaf add:优雅的返回 Json 数据 2020-09-08 10:06:53 +08:00
JaguarJack
b07defb0e9 update 2020-09-07 20:14:03 +08:00
JaguarJack
377b72ae19 update 2020-09-07 19:57:58 +08:00
JaguarJack
dd023caf36 update:readme 2020-09-07 17:37:49 +08:00
JaguarJack
163d1c4bee update:更新部门及以下数据权限 2020-09-07 16:16:25 +08:00
JaguarJack
2c2b7f8723 fixed table 2020-09-07 14:05:36 +08:00
JaguarJack
d533aeaa9e update 2020-09-07 08:29:12 +08:00
JaguarJack
a6cebc3750 update:更新上传获取配置 2020-09-07 07:44:56 +08:00
JaguarJack
214ca68b44 update:wechat 管理 2020-09-06 16:42:29 +08:00
JaguarJack
e712f824f5 update:支持无限级的菜单隐藏 2020-09-06 11:18:12 +08:00
JaguarJack
f301f149fb update:更新获取方法 2020-09-06 10:58:13 +08:00
JaguarJack
96751d6974 update:导出数据 2020-09-05 17:18:31 +08:00
JaguarJack
da9aa45036 update:更新初始化数据 2020-09-05 17:13:50 +08:00
yanwenwu
9ec1285cb9 update:修复导出 2020-09-05 17:12:04 +08:00
JaguarJack
3947ba7386 update数据 2020-09-05 16:34:43 +08:00
JaguarJack
d0a9a41c68 更新到处数据 2020-09-05 16:33:34 +08:00
JaguarJack
7fbee46c73 update 初始化数据 2020-09-05 16:24:00 +08:00
JaguarJack
c8a7d0291c update 2020-09-05 16:01:18 +08:00
JaguarJack
d0044ee019 update 2020-09-04 20:29:38 +08:00
JaguarJack
3466c8ec1f code 更新 2020-09-04 19:28:47 +08:00
JaguarJack
b3be31750a upate 2020-09-04 19:28:30 +08:00
JaguarJack
ca7a3df823 update 2020-09-04 19:01:57 +08:00
JaguarJack
9a5e7010b1 update 2020-09-04 16:21:18 +08:00
JaguarJack
2e67214032 迁移数据 2020-09-04 10:45:18 +08:00
JaguarJack
c5fb6f9409 迁移 2020-09-04 10:09:26 +08:00
JaguarJack
8f73948223 开发者搜索 2020-09-03 19:07:19 +08:00
JaguarJack
2941eeac1e update 2020-09-03 18:55:25 +08:00
JaguarJack
e0007d4150 update:更新搜索 2020-09-02 20:46:30 +08:00
JaguarJack
0e3656c7cc update:更新表结构和模型字段 2020-09-02 11:20:10 +08:00
JaguarJack
44ed0b9788 update:调整部门管理 2020-09-01 07:58:36 +08:00
JaguarJack
1d660ba648 update:更新表结构 2020-08-30 11:31:25 +08:00
JaguarJack
202f7f1dea update:更新表结构 2020-08-30 11:23:10 +08:00
JaguarJack
b1f5c22c9d update:用户禁用 2020-08-20 21:02:16 +08:00
JaguarJack
a7609d9c77 update:修改部门权限标志 2020-08-18 19:32:33 +08:00
JaguarJack
cb9deeb7ce update:更新readme 2020-08-13 08:55:10 +08:00
JaguarJack
b62cf987d1 fixed:修改方法返回 2020-08-12 19:29:41 +08:00
JaguarJack
c6e235ca6c 更新readme 2020-08-11 21:24:18 +08:00
JaguarJack
03bb91cd9e update:优化数据表搜索 2020-08-10 11:37:34 +08:00
JaguarJack
e15838386f update:更新zip类 2020-08-10 11:17:32 +08:00
JaguarJack
bcf37924d3 update:更新解析parseClass 2020-08-10 11:16:42 +08:00
JaguarJack
1a965ff4f5 add:新增安装模块的类 2020-08-10 11:16:12 +08:00
JaguarJack
bbfb206210 update:更新打包工具 2020-08-10 11:15:48 +08:00
JaguarJack
2f76d0da38 update:更新上传模块 2020-08-10 11:15:12 +08:00
JaguarJack
ea6e45450c update:更新安装模块 2020-08-10 11:14:53 +08:00
JaguarJack
4bfa907191 update: 优化创建模块 2020-08-10 10:33:13 +08:00
JaguarJack
6c9f1cface Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-08-10 08:11:42 +08:00
JaguarJack
8776849d98 update:修改人物提示信息
:^O
2020-08-08 20:49:34 +08:00
JaguarJack
b5a589d4da update:新增进程最大内存限制 2020-08-08 20:43:58 +08:00
JaguarJack
c529d36f03 !2 1.修改描述,嘿嘿
Merge pull request !2 from sunhuan/master
2020-08-07 11:05:51 +08:00
sunhuan
de97a1319e 1.修改描述 2020-08-07 10:51:41 +08:00
JaguarJack
d410434979 fixed:菜单更新 2020-07-29 10:29:10 +08:00
JaguarJack
29732738dc add:新增菜单字段 2020-07-29 07:30:05 +08:00
JaguarJack
230ea26a1b update: 获取上传默认驱动 2020-07-29 07:29:42 +08:00
JaguarJack
d1a42637fe fixed:批量删除 2020-07-28 16:40:05 +08:00
JaguarJack
fae47bf246 update:优化代码 2020-07-28 08:19:51 +08:00
JaguarJack
cba66dfe58 fixed:migration 表前缀 2020-07-27 07:58:11 +08:00
JaguarJack
cc34e058f0 update:配置更新 2020-07-26 18:43:09 +08:00
JaguarJack
3ab7e207c9 update:修改attachments URL 路径地址 2020-07-26 08:28:54 +08:00
JaguarJack
e232062ba6 update:修改can方法 2020-07-25 21:33:20 +08:00
JaguarJack
3a0c537ce0 update:优化代码 2020-07-25 10:04:13 +08:00
JaguarJack
d9faa42905 新增issue模版 2020-07-25 08:46:01 +08:00
JaguarJack
99727f1c7d Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-07-25 08:34:24 +08:00
JaguarJack
7fc50c9916 Merge pull request #13 from qingmang/patch-1
后台增加权限判断
2020-07-25 07:50:13 +08:00
青芒科技
454fa43f8c Update Users.php 2020-07-24 22:16:34 +08:00
青芒科技
cdf6efde1d Update Users.php 2020-07-24 22:16:19 +08:00
JaguarJack
c65863d606 update:更新权限方法 2020-07-24 21:40:26 +08:00
青芒科技
c5650e80bd 后台增加权限判断
后台可以快捷的通过 `request()->user()->can('权限标识');` 来判断某个用户是否拥有某个权限,便于权限区分
2020-07-24 21:36:40 +08:00
JaguarJack
8d21dc8acc http客户端新增属性 2020-07-23 16:43:01 +08:00
JaguarJack
263c036e49 降低symfony/finder版本 2020-07-23 07:34:19 +08:00
JaguarJack
f0351246fc 新增zip&composer工具 2020-07-21 08:01:20 +08:00
JaguarJack
30f405f233 delete composer.lock 2020-07-21 07:57:58 +08:00
JaguarJack
94052b6e01 fixed bug 2020-07-20 17:03:49 +08:00
JaguarJack
ab9302e790 fixed:修复Finder not found 2020-07-20 17:01:01 +08:00
JaguarJack
f396732544 新增symfony/finder 2020-07-20 16:48:27 +08:00
JaguarJack
0fb344fcf3 update:修改微信粉丝同步 2020-07-19 16:55:38 +08:00
JaguarJack
78bb8bccd7 数据库备份 2020-07-19 16:47:58 +08:00
JaguarJack
027ba1acdb 优化catchConsole代码 2020-07-19 10:06:08 +08:00
JaguarJack
2757873ef2 新增文件操作 2020-07-19 09:15:15 +08:00
JaguarJack
6e1fdb2b74 优化模块下 commands 在cli模式下注入 2020-07-19 08:46:12 +08:00
JaguarJack
929f9b2a75 优化commands只有在Cli模式下注入 2020-07-19 08:40:49 +08:00
JaguarJack
db18e71906 Merge pull request #8 from tlerbao/master
登录日志新增数据搜索功能,修改路由Path单词用反了的问题
2020-07-18 20:51:11 +08:00
tlerbao
3f5b84ba45 操作日志和登录日志的路由Path单词用反了 2020-07-18 17:16:04 +08:00
tlerbao
bb1dd9b207 登录日志新增数据搜索功能 2020-07-18 17:12:07 +08:00
JaguarJack
eee53b3131 Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-07-16 14:35:19 +08:00
JaguarJack
a86387a47e fixed:修复表信息获取 2020-07-16 14:12:44 +08:00
JaguarJack
b538c08b88 Merge pull request #6 from tlerbao/master
操作日志新增批量删除
2020-07-15 14:57:59 +08:00
JaguarJack
ce38bc741b Merge pull request #5 from qingmang/patch-2
设置departments获取的默认值
2020-07-15 14:55:23 +08:00
tlerbao
142fd71b56 操作日志新增条件查询,并简单优化了操作日志控制器 2020-07-15 11:39:55 +08:00
tlerbao
a6ad9b63dd 操作日志新增批量删除 2020-07-14 21:06:10 +08:00
JaguarJack
8a901e89cb 删除冗余代码&修复bug 2020-07-14 17:35:16 +08:00
JaguarJack
fc93826016 修改auth认证 2020-07-14 12:21:29 +08:00
青芒科技
98b2d7d31b 设置departments获取的默认值
只有自定义数据才存在departments
2020-07-13 19:00:53 +08:00
JaguarJack
33bdd01933 移除不必要的包 2020-07-13 17:57:57 +08:00
JaguarJack
32b87baeee 优化 Request 认证 2020-07-13 17:07:18 +08:00
JaguarJack
19c092dffc 删除冗余代码 2020-07-13 17:06:54 +08:00
JaguarJack
81e7f78419 新增模块上传 2020-07-13 17:06:21 +08:00
JaguarJack
a5416bd0ad 修复生成代码 2020-07-13 17:05:34 +08:00
JaguarJack
6d51b5bc76 新增开发者认证配置 2020-07-13 17:04:53 +08:00
JaguarJack
04e008fcfa 开发者认证 2020-07-13 17:04:35 +08:00
JaguarJack
7ef4efa37a 新增开发者 2020-07-13 15:28:38 +08:00
JaguarJack
1644076abe Guard 未设置抛出异常 2020-07-13 09:04:57 +08:00
JaguarJack
5b43786432 插件上传 2020-07-12 18:03:48 +08:00
JaguarJack
1e8b5510f1 修复远程下载模块 2020-07-11 21:44:39 +08:00
JaguarJack
7adfc93190 新增安装模块命令 2020-07-11 16:13:06 +08:00
JaguarJack
b9c156e5a7 修改打包命令 2020-07-11 16:12:17 +08:00
JaguarJack
bcdf6cd9c7 修改catchadmin根目录 2020-07-11 15:52:30 +08:00
root
e17846571c 新增下载保存地址方法 2020-07-11 15:02:05 +08:00
JaguarJack
359381fec6 生成代码新增回滚功能 2020-07-11 10:59:57 +08:00
root
42e75f50ff 修改日志记录方式 2020-07-11 10:10:42 +08:00
JaguarJack
454e1fcd55 去除不必要的包 2020-07-10 16:38:42 +08:00
JaguarJack
5584fa66da 修复定时任务秒级执行 2020-07-10 08:49:31 +08:00
JaguarJack
87ec38d1dd 新增调度中心 2020-07-10 08:35:14 +08:00
JaguarJack
6db13b9eab 修改信号处理 2020-07-09 22:01:52 +08:00
JaguarJack
e678b4ce51 新增调度配置 2020-07-09 21:56:39 +08:00
JaguarJack
b8de40a60f 新增守护控制选项 2020-07-09 21:56:17 +08:00
JaguarJack
c84d5a2a17 修复创建最大进程数目之后可继续创建 2020-07-09 21:17:34 +08:00
JaguarJack
9335556197 worker状态切换到table内存操作 2020-07-09 21:03:16 +08:00
JaguarJack
40ed25816c 新增 swoole table 2020-07-09 21:02:44 +08:00
JaguarJack
2a593b179a 异常日志记录 2020-07-09 15:41:53 +08:00
JaguarJack
a5b6b479ce 增加USR1信号,实时获取 worker 信息 2020-07-09 10:04:31 +08:00
JaguarJack
104ad3f744 修复worker等待状态bug 2020-07-09 08:37:03 +08:00
JaguarJack
ea32a4cd33 worker状态管理 2020-07-09 08:28:29 +08:00
JaguarJack
a3f378eca8 写入 worker 状态信息 2020-07-08 19:47:35 +08:00
JaguarJack
bcc4237140 修复定时任务无法准时启动 2020-07-08 17:48:45 +08:00
JaguarJack
4fec98f939 新增 crontab 组件 2020-07-07 16:58:34 +08:00
JaguarJack
f15eedfa9c 新增调度命令 2020-07-07 16:58:16 +08:00
JaguarJack
da683a3592 Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-07-06 08:54:33 +08:00
JaguarJack
7adfb6a0ae Merge pull request #4 from qingmang/patch-1
fix:自定义数据范围更新追加部门数据更新
2020-07-06 08:54:11 +08:00
青芒科技
a73883cc79 fix:自定义数据范围更新追加部门数据更新 2020-07-05 20:15:40 +08:00
JaguarJack
3235e98c38 新增版本信息 2020-07-05 16:36:28 +08:00
JaguarJack
bb38e3bdac 修复更新权限父类未更新子类模块 2020-07-05 07:20:01 +08:00
JaguarJack
9092b64c1f 新增超级管理员判断&权限范围 2020-07-04 21:56:47 +08:00
JaguarJack
e798098a05 修改数据范围 2020-07-04 21:35:01 +08:00
JaguarJack
c2da2e5806 修复数据权限 bug 2020-07-04 14:28:59 +08:00
JaguarJack
6e1be051e2 修改模版 2020-07-04 11:32:04 +08:00
JaguarJack
a34d687203 新增request post方法加入 creator_id 2020-07-04 10:44:39 +08:00
JaguarJack
2746d565e4 修复添加部门没有存入creator_id 2020-07-04 10:43:09 +08:00
JaguarJack
fda520bad3 修改modulejson信息 2020-07-03 21:24:42 +08:00
JaguarJack
1abcc5045f 新增令牌桶限流 2020-07-02 18:41:47 +08:00
JaguarJack
5e076a6eb7 新增滑动窗口限流 2020-07-02 17:28:01 +08:00
JaguarJack
349f36df21 降低phpunit版本 2020-07-02 14:30:25 +08:00
JaguarJack
9ec043ba34 catchConsole加入容器,提高性能 2020-07-02 14:22:02 +08:00
JaguarJack
e51cbc6850 修改wechat commands 注入方式 2020-07-02 14:01:47 +08:00
JaguarJack
26e26b60a7 新增 console 统一注入 2020-07-02 14:01:05 +08:00
JaguarJack
e35b14a883 新增文件处理 2020-07-02 13:19:23 +08:00
JaguarJack
24e1506743 修改启用/禁用模块删除对应的菜单 2020-07-01 15:47:06 +08:00
JaguarJack
51672734a6 优化sql生成&添加creator_id 2020-07-01 15:24:42 +08:00
JaguarJack
1a20159776 新增redis固定窗口限流 2020-06-30 18:06:01 +08:00
JaguarJack
bd840134ad 修改异常信息 2020-06-30 17:42:07 +08:00
JaguarJack
9740df6a97 修改路由生成 2020-06-30 10:46:39 +08:00
JaguarJack
0ef84fea08 修改模型模版 2020-06-30 10:31:27 +08:00
JaguarJack
2b4f9823ff 优化代码生成 2020-06-30 10:14:27 +08:00
JaguarJack
051627547e 优化微信图文 2020-06-30 08:40:00 +08:00
JaguarJack
16a19312a9 回复搜索 2020-06-30 07:36:38 +08:00
JaguarJack
7dedec17d9 修复回复media_id 2020-06-30 07:17:55 +08:00
JaguarJack
b9f055e052 新增上传文件类型 2020-06-30 07:17:13 +08:00
JaguarJack
57d26f8003 完善回复功能 2020-06-29 22:04:40 +08:00
JaguarJack
655541210a 新增禁用/启用 2020-06-29 22:01:47 +08:00
JaguarJack
f2affda157 新增上传 2020-06-29 20:02:33 +08:00
JaguarJack
08fb8b3397 微信回复功能 2020-06-29 19:51:44 +08:00
JaguarJack
09c409fc76 修改权限数据 2020-06-28 15:09:42 +08:00
JaguarJack
6841f6c385 新增系统权限数据 2020-06-28 15:09:15 +08:00
JaguarJack
99136f33d1 修改微信权限数据 2020-06-28 15:08:56 +08:00
JaguarJack
41eb836634 优化提示 2020-06-28 11:32:50 +08:00
JaguarJack
db9428961f 微信权限菜单 2020-06-28 08:45:14 +08:00
JaguarJack
cc5805f410 修改上传 2020-06-28 08:34:19 +08:00
JaguarJack
1c9e98ff2a 新增微信图文 2020-06-28 08:33:49 +08:00
JaguarJack
7152661210 修改本地存储路径 2020-06-28 08:33:34 +08:00
JaguarJack
59774e7958 新增微信认证url 2020-06-26 22:08:27 +08:00
JaguarJack
bcd7215333 新增事件消息 2020-06-26 22:08:01 +08:00
JaguarJack
a232f555c3 微信菜单 2020-06-26 16:27:20 +08:00
JaguarJack
ce71b10d1c 修改数据库基础操作 2020-06-25 09:25:34 +08:00
JaguarJack
707070a06e 修改创建模块命令 2020-06-25 09:25:02 +08:00
JaguarJack
fca8980715 新增角色初始化数据 2020-06-25 08:36:59 +08:00
JaguarJack
4dc2978d61 新增模块权限导出 2020-06-25 08:36:29 +08:00
JaguarJack
cfaec3fbc3 新增seedPath创建方法 2020-06-25 08:35:52 +08:00
JaguarJack
d2bc7a25c0 优化Catchadmin服务 2020-06-24 10:07:53 +08:00
JaguarJack
5f5260a639 优化开启/关闭模块 2020-06-24 10:07:11 +08:00
JaguarJack
f6783cb13e 优化服务发现 2020-06-24 09:46:21 +08:00
JaguarJack
ee04005d69 架构调整,服务调整 2020-06-24 09:11:48 +08:00
JaguarJack
9125292aa8 新增模块抽象服务 2020-06-24 09:11:30 +08:00
JaguarJack
2c18af0aa7 架构调整路由加载 2020-06-24 09:11:08 +08:00
JaguarJack
2d95212973 调整架构,新增微信模块服务 2020-06-24 09:10:24 +08:00
JaguarJack
0e7453a6fe 调整架构,新增系统模块服务 2020-06-24 09:10:01 +08:00
JaguarJack
8c32893c91 调整架构,新增权限模块服务 2020-06-24 09:09:37 +08:00
JaguarJack
805b04a7f8 新增事件监听 2020-06-24 09:09:10 +08:00
JaguarJack
8dfd4596be 删除配置 2020-06-24 09:08:06 +08:00
JaguarJack
8b4404df55 login新增Service 2020-06-24 08:47:46 +08:00
JaguarJack
23fa6ab097 新增禁止开启模块 2020-06-23 21:37:37 +08:00
JaguarJack
f18766c20a 优化范围查询 2020-06-22 15:19:50 +08:00
JaguarJack
d873ba10f9 修复模块服务发现导致的兼容问题 2020-06-22 12:36:25 +08:00
JaguarJack
51d237d0f0 安装新增模块服务发现 2020-06-22 08:05:51 +08:00
JaguarJack
6e76c173a7 优化catchQuery 2020-06-22 07:55:39 +08:00
JaguarJack
a3dd8282b3 完善微信粉丝和标签 2020-06-22 07:55:16 +08:00
JaguarJack
317a9ef595 优化角色权限分配 2020-06-21 21:07:15 +08:00
JaguarJack
e6d7ee8f55 修改命令 2020-06-21 18:04:55 +08:00
JaguarJack
fbf9c11191 微信标签管理 2020-06-21 18:04:30 +08:00
JaguarJack
4392f25e97 优化微信错误码 2020-06-21 16:20:02 +08:00
JaguarJack
73c7788218 新增微信错误码 2020-06-21 14:42:02 +08:00
JaguarJack
835b93eaaf 优化微信服务 2020-06-21 14:41:46 +08:00
JaguarJack
092567a169 新增微信用户 2020-06-21 14:41:22 +08:00
JaguarJack
028333fae3 新增基类仓库 2020-06-21 13:24:15 +08:00
JaguarJack
7b0aa49c21 新增微信响应错误 2020-06-21 13:23:43 +08:00
JaguarJack
c624dc1777 新增微信公众号错误 2020-06-21 13:23:22 +08:00
JaguarJack
dc08715bc7 新增命令行进度条 2020-06-21 10:50:29 +08:00
JaguarJack
11f6419b4f 抽象scope trait 2020-06-21 10:50:05 +08:00
JaguarJack
448154f363 微信用户列表 2020-06-21 10:48:55 +08:00
JaguarJack
cd8ff84f02 微信用户同步 2020-06-21 10:48:11 +08:00
JaguarJack
97724b04df 新增catchadmin模块发现 2020-06-20 16:57:37 +08:00
JaguarJack
6e9c0aed32 删除输出 2020-06-20 09:29:45 +08:00
JaguarJack
de6470fd0e 优化模块服务发现 2020-06-20 09:13:11 +08:00
JaguarJack
bd21242410 删除登陆模块service 2020-06-20 09:12:19 +08:00
JaguarJack
f21716d5a6 修复获取模块信息bug 2020-06-20 08:51:28 +08:00
JaguarJack
49500956dd 删除冗余代码 2020-06-20 08:51:11 +08:00
JaguarJack
9ff6c8d883 新增模块服务安装命令 2020-06-20 08:50:49 +08:00
JaguarJack
6612dfd8b7 优化安装 2020-06-20 08:50:21 +08:00
JaguarJack
93c1c11853 新增模块json信息 2020-06-20 08:49:44 +08:00
JaguarJack
49a8d04157 新增微信服务 2020-06-20 08:49:16 +08:00
JaguarJack
1d1afe468c 新增微信用户同步表 2020-06-19 20:58:11 +08:00
JaguarJack
20b3fd477f 新增用户管理 2020-06-19 19:29:21 +08:00
JaguarJack
e4273e5a1a 新增微信动态调用 2020-06-19 19:28:56 +08:00
JaguarJack
2c9e22ac6c 新增敏感词库菜单 2020-06-18 17:45:45 +08:00
JaguarJack
e717f56416 优化导出命令 2020-06-18 17:45:04 +08:00
JaguarJack
96f04545db 新增trie tree缓存命令 2020-06-18 17:08:47 +08:00
JaguarJack
cbfcce919f 新增敏感词请求验证 2020-06-18 16:30:25 +08:00
JaguarJack
1f3c025f36 新增敏感词验证 2020-06-18 16:29:54 +08:00
JaguarJack
b4b0d624a6 fixed dfa bug 2020-06-18 16:29:26 +08:00
JaguarJack
5a198f8f0b 新增phpunit 2020-06-18 10:50:38 +08:00
JaguarJack
fcc6fd035d 新增redis配置 2020-06-17 23:03:04 +08:00
JaguarJack
4fc4577be3 新增DFA算法过滤敏感词 2020-06-17 23:02:52 +08:00
JaguarJack
dec79f2b28 新增敏感词缓存key 2020-06-17 23:02:12 +08:00
JaguarJack
f14107dc44 新增敏感词搜索 2020-06-17 16:19:51 +08:00
JaguarJack
727640396e 新增子查询方法 addSelectSub 2020-06-17 16:19:21 +08:00
JaguarJack
e105492d27 修改排序 2020-06-17 14:40:01 +08:00
JaguarJack
c450c4afc5 新增敏感词库 2020-06-17 14:29:31 +08:00
JaguarJack
13d3734dba 修改排序 2020-06-17 13:24:02 +08:00
JaguarJack
6977442b05 去除重写Order 方法,新增 CatchOrder 2020-06-17 13:23:43 +08:00
JaguarJack
3b063ac1fd fixed conflict 2020-06-08 08:56:05 +08:00
JaguarJack
5609d4fd09 fixed 2020-06-08 08:54:50 +08:00
JaguarJack
66acbeee8b 优化微信发布命令 2020-06-07 14:23:26 +08:00
JaguarJack
5231770bab 新增微信扩展 2020-06-07 14:23:07 +08:00
JaguarJack
ec5a5a8402 新增微信模块 2020-06-07 14:22:41 +08:00
JaguarJack
e9c8940730 新增微信发布 2020-06-06 22:37:36 +08:00
JaguarJack
333d0be409 修改readme 2020-06-06 21:50:36 +08:00
JaguarJack
ffeec69333 数据范围查询 2020-06-06 18:57:58 +08:00
JaguarJack
ac56a7b80d 添加必要注释 2020-06-06 09:21:24 +08:00
JaguarJack
9a07ae1e1b 修改readme 2020-06-06 08:58:55 +08:00
JaguarJack
08b7a1b17c 修改parseclass 2020-06-05 16:20:50 +08:00
JaguarJack
d232ebb207 优化 2020-06-05 15:58:16 +08:00
JaguarJack
8550c99133 新增parseclass组件 2020-06-05 15:35:51 +08:00
JaguarJack
f55ff91554 修改方法获取 2020-06-05 15:35:31 +08:00
JaguarJack
f9ed43017f 新增权限方法获取 2020-06-05 15:20:22 +08:00
JaguarJack
c06e7b8694 更新附件模型 2020-06-01 21:28:04 +08:00
JaguarJack
fe6ea82014 新增附件事件 2020-06-01 21:25:46 +08:00
JaguarJack
39c0ec4c48 删除冗余代码 2020-05-28 08:24:49 +08:00
JaguarJack
107a7d48da 优化模型生成命令 2020-05-28 06:38:10 +08:00
JaguarJack
b57d7f95c3 优化模型代码生成 2020-05-28 06:37:32 +08:00
JaguarJack
5face1c077 优化excel导出 2020-05-26 22:55:02 +08:00
JaguarJack
a5a05b1e88 增加内存设置选项 2020-05-26 22:44:48 +08:00
JaguarJack
ea6a4b15a8 修改搜索 2020-05-26 22:39:06 +08:00
JaguarJack
c60d8d2dc9 优化搜索 2020-05-26 09:32:52 +08:00
JaguarJack
bae43ad382 优化excel导出 2020-05-25 22:50:51 +08:00
JaguarJack
74a42e7022 修改设置开始列无效bug 2020-05-25 22:39:00 +08:00
JaguarJack
c04530a1be 优化 excel 2020-05-25 19:55:25 +08:00
JaguarJack
2074c1f65d 新增 excel 工具 2020-05-25 19:47:54 +08:00
JaguarJack
c0e3726775 修改README 2020-05-25 15:07:01 +08:00
JaguarJack
0f59685ae3 修服左侧菜单排序不生效 bug 2020-05-25 14:30:28 +08:00
JaguarJack
dfcec7394f 修改readme 2020-05-24 10:56:08 +08:00
JaguarJack
8bf7380d82 优化 auth 单例获取用户,支持 guard 获取 2020-05-23 14:04:23 +08:00
JaguarJack
fa04341608 优化 auth 单例获取用户,防止多次查询 2020-05-23 11:10:28 +08:00
JaguarJack
167ea743a0 优化 http 客户端 2020-05-22 18:24:10 +08:00
JaguarJack
30e7829d21 优化 2020-05-22 15:56:28 +08:00
JaguarJack
1d1eaa0338 优化打包类 2020-05-22 15:45:33 +08:00
JaguarJack
a60880d327 优化 http 客户端 2020-05-22 15:45:14 +08:00
JaguarJack
19c62e049c 修复异常错误显示 2020-05-22 15:22:21 +08:00
JaguarJack
0df821d1a4 优化用户立标 2020-05-22 15:21:05 +08:00
JaguarJack
00a37a05f2 优化command 2020-05-22 14:09:59 +08:00
JaguarJack
93f22ab338 修改方法为静态 2020-05-22 14:09:48 +08:00
JaguarJack
ca5e76497c 完善 http 客户端 2020-05-22 14:08:53 +08:00
JaguarJack
b7d951bdb7 新增facade方法注释,以便用户访问 2020-05-22 14:08:35 +08:00
JaguarJack
bfc576b437 新增前缀获取 2020-05-22 14:07:55 +08:00
JaguarJack
5ac51366f2 新增http客户端 2020-05-21 23:08:16 +08:00
yanwenwu
853ebe7437 优化配置 2020-05-20 19:21:28 +08:00
yanwenwu
c635a322bb 修改配置获取类型错误导致前端报错 2020-05-20 12:52:25 +08:00
yanwenwu
70b6b0407c 菜单新增隐藏显示功能 2020-05-20 11:31:04 +08:00
yanwenwu
ff1d7dfd2e 修复代码生成器bug 2020-05-20 11:03:21 +08:00
yanwenwu
181ceefd55 修复migraions地址 2020-05-20 10:06:42 +08:00
yanwenwu
48f572168f 修复未定义table 2020-05-19 11:03:42 +08:00
yanwenwu
64ce1243b4 fixed bug 2020-05-19 08:22:48 +08:00
yanwenwu
9da4072b30 新增字段 2020-05-18 15:47:32 +08:00
yanwenwu
52e25103d0 新增状态码 2020-05-18 13:42:26 +08:00
yanwenwu
2361be7d71 修改过期token返回码 2020-05-18 13:42:08 +08:00
yanwenwu
5057f3eb9e refresh token 2020-05-18 13:41:46 +08:00
yanwenwu
b4bb0a1910 logout 2020-05-18 10:12:33 +08:00
yanwenwu
f913f76bd2 修改readme 2020-05-17 22:41:14 +08:00
yanwenwu
45383c2230 修改readme 2020-05-17 17:09:53 +08:00
JaguarJack
dbc6eb2b48 修改菜单 2020-05-17 16:08:40 +08:00
JaguarJack
3f814116de 修改安装命令 2020-05-17 15:49:42 +08:00
JaguarJack
db2aba9b1a update readme 2020-05-16 23:44:22 +08:00
JaguarJack
68cdec973a update README.md. 2020-05-16 21:26:39 +08:00
JaguarJack
82a99d7d17 修改readme 2020-05-16 21:09:05 +08:00
JaguarJack
a90f289792 修改READ 2020-05-16 21:06:50 +08:00
JaguarJack
9b2c4aa905 新增添加菜单命令 2020-05-08 20:56:21 +08:00
JaguarJack
d68891035b fixed 生成表 2020-05-08 19:21:31 +08:00
JaguarJack
6f8552fa70 fixed bug 2020-05-07 13:45:31 +08:00
JaguarJack
278b078937 修复创建人ID无法获取 2020-05-06 22:16:55 +08:00
JaguarJack
0cc8dc7927 增加扩展 2020-05-06 17:55:16 +08:00
JaguarJack
9dda665ddc 新增工具方法 2020-05-06 17:41:36 +08:00
JaguarJack
056abcd9f1 新增操作中间件 2020-05-06 17:41:09 +08:00
JaguarJack
98c99e05f3 分离日志操作权限 2020-05-06 17:40:51 +08:00
JaguarJack
339f441d4f 优化角色权限 2020-05-06 11:46:40 +08:00
JaguarJack
72eb174946 优化代码生成 2020-05-05 21:52:44 +08:00
JaguarJack
635f3e00d0 修改SQL生成 2020-05-05 12:35:36 +08:00
JaguarJack
9e5bbeae5a 修改模版 2020-05-05 12:34:32 +08:00
JaguarJack
0bc448f8e8 readme 2020-05-02 06:39:18 +08:00
JaguarJack
dd1ce48646 fixed bug 2020-05-01 01:00:55 +08:00
JaguarJack
ae01ba64b2 fixed bug 2020-05-01 00:59:46 +08:00
JaguarJack
892f8f2aad fixed bug 2020-05-01 00:38:41 +08:00
JaguarJack
4e38e7ede2 fiexed bug 2020-04-30 18:15:48 +08:00
JaguarJack
fbc4a6201a 增加注释 2020-04-30 18:15:34 +08:00
JaguarJack
5fb45c0d49 修改操作日志参数长度 2020-04-30 18:10:38 +08:00
JaguarJack
2febc2bb56 修改部门排序 2020-04-30 17:58:55 +08:00
JaguarJack
e1abef2319 新增order 2020-04-30 17:58:36 +08:00
JaguarJack
dd0ad744e6 优化打包命令 2020-04-30 15:24:16 +08:00
JaguarJack
b86347a993 优化 2020-04-30 15:24:02 +08:00
JaguarJack
196dfbcbda 新增http客户端 2020-04-30 15:23:36 +08:00
JaguarJack
cfc7d8a48c 新增包的更新和打包 2020-04-30 14:52:01 +08:00
JaguarJack
06ee75d496 修改打包命令 2020-04-30 14:51:32 +08:00
JaguarJack
b192a0151f recover 2020-04-29 17:37:45 +08:00
JaguarJack
4d444e9bbc 新增解析功能 2020-04-29 17:35:29 +08:00
JaguarJack
45af3fbc5f fixed install biug 2020-04-29 16:03:24 +08:00
JaguarJack
4a5e4353be 新增扩展 2020-04-29 15:54:30 +08:00
JaguarJack
ab3e420085 delete 2020-04-29 15:30:49 +08:00
JaguarJack
a437d2ed40 fixed bug 2020-04-29 15:25:41 +08:00
JaguarJack
d8ad1f6b87 修改数据初始化 2020-04-29 15:06:38 +08:00
JaguarJack
610f48b4ec 新增tools 2020-04-29 15:06:13 +08:00
JaguarJack
514bb6b520 新增导入树状数据方法 2020-04-29 15:05:49 +08:00
JaguarJack
76855d6b5d 生成控制器 2020-04-29 11:42:48 +08:00
JaguarJack
b30e57bf01 优化代码生成 2020-04-29 11:41:54 +08:00
JaguarJack
f8fb57c9c6 移除方法 2020-04-29 09:02:43 +08:00
JaguarJack
64c03bdfd3 优化代码生成 2020-04-29 09:02:20 +08:00
JaguarJack
7f72784bfb 修改用户 2020-04-28 22:04:01 +08:00
JaguarJack
08aee72ab9 修改日志列表 2020-04-28 22:02:50 +08:00
JaguarJack
50bcb7e289 新增列表查询 2020-04-28 22:02:23 +08:00
JaguarJack
0b546a20be 代码生成器 2020-04-28 22:02:03 +08:00
JaguarJack
d044ac6d8a 新增模型 2020-04-28 16:34:55 +08:00
JaguarJack
011c138439 修改操作事件 2020-04-28 16:34:31 +08:00
JaguarJack
435e1b6399 修改登陆事件 2020-04-28 16:34:17 +08:00
JaguarJack
760ad2a51b readme 2020-04-26 11:06:48 +08:00
JaguarJack
5fa78eda58 修改Query 2020-04-24 14:31:46 +08:00
JaguarJack
3f888f909a fixed migrate create failed 2020-04-23 19:47:00 +08:00
JaguarJack
fbbfc70d39 修改 2020-04-23 14:09:27 +08:00
JaguarJack
9e56f9f85e 优化权限keepalive字端 2020-04-23 14:04:26 +08:00
JaguarJack
e7295fa767 fixed bug 2020-04-22 22:47:31 +08:00
JaguarJack
b3682b1ee6 修改初始化数据 2020-04-22 22:16:41 +08:00
JaguarJack
498b45059b 修改数据 2020-04-22 22:10:47 +08:00
JaguarJack
306c36df85 优化角色 2020-04-22 21:29:13 +08:00
JaguarJack
b71bba6a1e 新增基础操作 2020-04-22 20:17:39 +08:00
JaguarJack
e7491555e8 修改权限 2020-04-22 20:17:19 +08:00
JaguarJack
ef64b8a8cb 权限表新增 level 字段 2020-04-22 20:16:48 +08:00
JaguarJack
05abc92ad9 修改配置 2020-04-22 07:08:07 +08:00
JaguarJack
90241e9a8f 优化auth 2020-04-22 07:02:40 +08:00
JaguarJack
3469cc2adf 优化代码 2020-04-22 07:00:38 +08:00
JaguarJack
6ac556e819 修改权限 2020-04-22 06:43:26 +08:00
JaguarJack
0fd9d3dcb4 修改数据 2020-04-22 06:38:12 +08:00
JaguarJack
aa56154a28 修改用户路由 2020-04-22 06:08:40 +08:00
JaguarJack
57abdd4fd9 删除冗余代码 2020-04-22 06:07:53 +08:00
JaguarJack
6b227688e4 优化登陆 2020-04-22 06:07:14 +08:00
JaguarJack
308ee3120e 迁移用户模块 2020-04-22 06:06:57 +08:00
JaguarJack
fd9ce382db 更改依赖 2020-04-22 05:54:15 +08:00
JaguarJack
67b810b06f delete user module 2020-04-22 05:53:38 +08:00
JaguarJack
86dfe36714 修改数据 2020-04-21 22:22:27 +08:00
JaguarJack
6ac0e3ebf2 修复权限不全bug 2020-04-21 22:19:10 +08:00
JaguarJack
33fee182d2 优化安装 2020-04-21 21:36:25 +08:00
JaguarJack
20410ba52c 修改错误数据 2020-04-21 21:23:58 +08:00
JaguarJack
49f948fdd1 新增createdBy方法 2020-04-21 21:16:23 +08:00
JaguarJack
3d65d111ee fixed bug 2020-04-21 21:16:04 +08:00
JaguarJack
129582a446 部门数据 2020-04-21 21:09:09 +08:00
JaguarJack
8084e11805 新增seed 2020-04-21 21:06:53 +08:00
JaguarJack
dd46a28096 新增数据 2020-04-21 19:56:44 +08:00
JaguarJack
9b2ac5fd49 修改配置 2020-04-21 19:45:58 +08:00
JaguarJack
4f9cf56e69 修改初始化数据 2020-04-21 19:38:27 +08:00
JaguarJack
5e59f507af fixed bug 2020-04-21 19:34:03 +08:00
JaguarJack
9594ea0fc4 修改操作日志 2020-04-21 19:26:35 +08:00
JaguarJack
2f77658f41 修改权限中间件 2020-04-21 19:24:16 +08:00
JaguarJack
6cd67c6498 权限更新 2020-04-21 19:22:11 +08:00
JaguarJack
cfe2a005c0 fixed bug 2020-04-21 19:18:32 +08:00
JaguarJack
7131a6c878 合并配置 2020-04-21 17:07:19 +08:00
JaguarJack
010cc10d53 配置管理优化 2020-04-21 14:07:06 +08:00
JaguarJack
e82e058550 修复循环插入数据导致数据错乱 2020-04-21 10:51:25 +08:00
JaguarJack
1b954c1b16 新增配置管理 2020-04-21 10:34:50 +08:00
JaguarJack
be743d9d23 优化模型生成命令 2020-04-17 17:10:39 +08:00
JaguarJack
2c350cbceb fixed bug 2020-04-17 16:36:24 +08:00
JaguarJack
20091aaf43 日志动态分页数量 2020-04-17 15:02:50 +08:00
JaguarJack
a5c193f192 防止中文转义 2020-04-17 14:30:49 +08:00
JaguarJack
f777816e18 修复命名不规范 2020-04-17 06:48:14 +08:00
JaguarJack
f1f3df2bc8 重写路由 2020-04-17 06:47:19 +08:00
JaguarJack
c4d29b5cbf 重写事件 2020-04-17 06:47:04 +08:00
JaguarJack
1b8f0df628 修改权限 2020-04-16 17:14:56 +08:00
JaguarJack
def5e396e1 新增搜索 2020-04-16 17:14:37 +08:00
JaguarJack
6da68f09cd 修改权限返回数据结构 2020-04-14 20:31:38 +08:00
JaguarJack
9ddc932e89 修改模型生成 2020-04-14 19:17:13 +08:00
JaguarJack
b47ff98bb6 新增权限模型 2020-04-14 19:16:28 +08:00
JaguarJack
48298273dd 禁止项目安装时候cache router 2020-04-13 19:25:32 +08:00
JaguarJack
9548cb34fd permission修改文件 2020-04-13 15:36:22 +08:00
吴彦文
56f6ba90a6 优化install 2020-04-08 17:44:35 +08:00
吴彦文
8d10baa35f 修复重复env导致安装失败 2020-04-06 19:18:31 +08:00
吴彦文
e61f3a4115 异常退出删除.env 2020-04-06 18:29:14 +08:00
wuyanwen
4271a70b16 fixed bug 2020-03-11 14:14:27 +08:00
wuyanwen
49a4e56f48 delete 2020-03-10 16:51:05 +08:00
wuyanwen
29482f4e31 优化 2020-03-10 16:50:04 +08:00
wuyanwen
a90fd31b87 delete 2020-03-07 12:20:55 +08:00
wuyanwen
35a9ecbc82 修改ipv6长度 2020-03-06 17:06:44 +08:00
wuyanwen
defd10ab91 修改服务 2020-02-26 11:47:27 +08:00
wuyanwen
f812033ccc 修改readme 2020-02-26 09:06:35 +08:00
wuyanwen
4c48d0c71d Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-02-24 10:58:29 +08:00
wuyanwen
52e166b330 修改 2020-02-24 10:58:08 +08:00
jaguarjack
91d4f4a54d fixed conflict 2020-02-21 22:34:33 +08:00
jaguarjack
6b7146486c 修改 2020-02-21 22:32:50 +08:00
wuyanwen
3a58e928b6 修改install 2020-02-21 08:09:33 +08:00
wuyanwen
b998d58dea 删除冗余路由 2020-02-20 18:09:30 +08:00
wuyanwen
ff1aecce37 修改readme 2020-02-20 15:45:29 +08:00
wuyanwen
4e1a2d07d6 修改composer 2020-02-20 15:45:21 +08:00
wuyanwen
b0ee2e84d2 删除form 2020-02-20 13:46:06 +08:00
wuyanwen
42059247b2 新增事件配置 2020-02-20 13:45:13 +08:00
wuyanwen
6c5383f83c 益处service 2020-02-20 13:44:54 +08:00
wuyanwen
bcb671697c 切换service 2020-02-20 13:44:25 +08:00
wuyanwen
a9aa28bd77 修复win环境下apache头信息丢失 2020-02-18 17:27:24 +08:00
wuyanwen
bf98751ed5 切换路由中间件可配置 2020-02-18 14:52:32 +08:00
wuyanwen
ebe5f5757a 切换中间件,防止串应用 2020-02-18 14:44:16 +08:00
wuyanwen
fd1798875f 修改配置 2020-02-15 18:05:25 +08:00
wuyanwen
c4bdcd4152 新增wechat 2020-02-15 18:05:13 +08:00
wuyanwen
98f2e4bc31 修改异常错误信息 2020-02-13 19:55:01 +08:00
wuyanwen
0952e8f6f8 修改readme 2020-02-13 16:35:42 +08:00
wuyanwen
13d5b1a7fc 修改数据错误 2020-02-13 14:34:56 +08:00
wuyanwen
2c00ae5bdd 修改 apache 重写规则 2020-02-13 12:30:18 +08:00
wuyanwen
f562a3e8bc 修改readme 2020-02-13 11:55:58 +08:00
yanwenwu
81abf41e31 修改用户名 2020-02-10 13:04:27 +08:00
yanwenwu
db9a9327e5 修改登录 2020-02-08 18:30:56 +08:00
yanwenwu
1377a3a589 支持编辑器跳转 2020-02-06 12:02:38 +08:00
yanwenwu
4b0e9f24b9 删除package 2020-02-03 14:22:55 +08:00
yanwenwu
766d156bf8 新增附件管理 2020-02-02 22:11:38 +08:00
yanwenwu
a752c7914a 重置 2020-02-02 22:11:12 +08:00
yanwenwu
ae37218fcd 重新绑定异常处理 2020-02-02 22:10:52 +08:00
yanwenwu
6040ee4873 新增异常处理 2020-02-02 22:10:30 +08:00
yanwenwu
0c0238f664 修改上传 2020-02-02 22:10:14 +08:00
yanwenwu
fad98021e4 修改工具类 2020-02-02 22:09:53 +08:00
yanwenwu
e5ebc34d84 修改readme 2020-02-02 18:11:27 +08:00
yanwenwu
50410d640a 新增上传设置 2020-02-01 16:55:07 +08:00
yanwenwu
d0687df4de 修改服务 2020-02-01 15:42:13 +08:00
wuyanwen
b18390739f 修改request 2020-01-25 22:23:21 +08:00
wuyanwen
9c1eb59961 新增工具方法 2020-01-25 22:23:10 +08:00
wuyanwen
04b491621e 修改上传 2020-01-25 22:22:56 +08:00
wuyanwen
7dd40dc4aa 修改配置 2020-01-25 22:22:42 +08:00
wuyanwen
a8c98a0a05 新增附件管理 2020-01-25 22:22:29 +08:00
wuyanwen
5181915e3c 新增上传 2020-01-25 22:22:13 +08:00
wuyanwen
021041218b 修改权限 2020-01-25 20:33:04 +08:00
wuyanwen
88971b672d 修改权限 2020-01-25 20:32:31 +08:00
yanwenwu
09f8ef88ea 修改配置 2020-01-25 20:16:28 +08:00
wuyanwen
3e7106f9aa 修改 2020-01-25 20:08:53 +08:00
yanwenwu
10687ea93c 增加composer插件 2020-01-25 20:07:08 +08:00
yanwenwu
714837c8df 新增cloud配置 2020-01-25 20:06:36 +08:00
yanwenwu
b9acfbea2b 新增上传插件 2020-01-25 20:06:13 +08:00
yanwenwu
6f31f12be7 新增commands 2020-01-25 20:05:57 +08:00
yanwenwu
6b0eb5f849 fixed bugs 2020-01-25 20:03:18 +08:00
yanwenwu
3001ba26b1 修改ignore 2020-01-25 17:07:33 +08:00
yanwenwu
1ce6ddc060 修改composer 2020-01-25 17:07:12 +08:00
yanwenwu
0db7f7d3e9 修改composer 2020-01-25 16:24:44 +08:00
yanwenwu
886e86ef24 修改composer 2020-01-25 16:24:11 +08:00
yanwenwu
44eba6b389 修改权限中间件 2020-01-25 11:34:59 +08:00
yanwenwu
07442c8292 修改权限 2020-01-25 11:20:27 +08:00
yanwenwu
e61b61a220 修改服务 2020-01-24 08:40:04 +08:00
yanwenwu
5450edb490 修改权限中间件 2020-01-24 08:39:52 +08:00
yanwenwu
f8f20ab955 修改权限配置 2020-01-24 08:39:34 +08:00
yanwenwu
bea3e43937 删除不必要的引入 2020-01-23 21:26:45 +08:00
yanwenwu
0708d4ce61 新增ws worker命令 2020-01-23 21:26:30 +08:00
wuyanwen
e1ae8fd084 修改模块创建 2020-01-23 18:21:08 +08:00
wuyanwen
46c7307736 Merge branch 'master' of https://github.com/yanwenwu/catch-admin 2020-01-23 17:16:04 +08:00
wuyanwen
98e74c95dc 修改命令 2020-01-23 17:16:02 +08:00
wuyanwen
7b67e47059 修改rollback 2020-01-23 17:02:03 +08:00
wuyanwen
ac2dab4fa7 删除 2020-01-23 17:01:09 +08:00
yanwenwu
db37e71782 删除viewe目录的生成 2020-01-23 16:57:46 +08:00
yanwenwu
055f3d5aa9 统一命令格式 2020-01-23 16:55:51 +08:00
yanwenwu
cb90f5f6d3 修改migration rollback 2020-01-23 13:18:01 +08:00
wuyanwen
4f5476c270 修改数据填充 2020-01-22 17:56:00 +08:00
wuyanwen
9e4883ead6 增加分页常量 2020-01-21 17:57:33 +08:00
wuyanwen
ac74827130 重写分页方法 2020-01-21 17:56:28 +08:00
wuyanwen
f8a97527f6 修改分页 2020-01-21 17:56:10 +08:00
wuyanwen
5c8072e0b8 修改分页 2020-01-21 17:55:54 +08:00
wuyanwen
9f9a83f157 修改 2020-01-21 17:43:40 +08:00
wuyanwen
a719129b64 修改数据备份 2020-01-21 17:43:09 +08:00
wuyanwen
dfd0be23c6 修改初始化数据 2020-01-21 17:22:51 +08:00
wuyanwen
dc5e46e974 修改服务 2020-01-21 17:00:45 +08:00
wuyanwen
2c732555b0 新增rollback和create migration 命令 2020-01-21 17:00:17 +08:00
wuyanwen
ef545b8732 新增stubs 2020-01-21 16:59:40 +08:00
wuyanwen
b06a5300cb 新增登录退出 2020-01-20 14:38:50 +08:00
wuyanwen
1a03783d26 修改登录和权限路由 2020-01-20 14:38:32 +08:00
wuyanwen
bb372844dc 修改 whereLike 方法 2020-01-20 11:46:32 +08:00
wuyanwen
5f9e90ec67 修改权限管理错误 2020-01-19 15:50:27 +08:00
wuyanwen
257c29391e 修改用户搜索错误 2020-01-19 15:50:15 +08:00
wuyanwen
92d4092f1c 删除冗余路由 2020-01-19 15:49:58 +08:00
wuyanwen
a528ee83ae 修改response返回错误 2020-01-19 15:49:40 +08:00
wuyanwen
d09bcba9f3 修改readme 2020-01-19 15:49:19 +08:00
wuyanwen
4442944cc6 删除不必要的依赖 2020-01-19 09:58:40 +08:00
wuyanwen
51f9873d6e 修改readme 2020-01-17 17:56:54 +08:00
wuyanwen
3e4eca9d45 修改license 2020-01-17 16:07:55 +08:00
wuyanwen
9c7a01406d 修改更新方法 2020-01-17 15:49:42 +08:00
wuyanwen
8b216f2bc4 修改权限 2020-01-17 15:49:29 +08:00
wuyanwen
c6c0446c4e 新增配置 2020-01-17 15:49:18 +08:00
wuyanwen
691518c8c8 修改权限 2020-01-17 15:17:51 +08:00
wuyanwen
fb482ded01 修改request 2020-01-17 11:30:39 +08:00
wuyanwen
f427efd2c8 修改权限 2020-01-17 11:29:33 +08:00
wuyanwen
04d942c7db 缓存用户权限 2020-01-17 11:29:17 +08:00
wuyanwen
7eeade987a 更新框架核心 2020-01-16 14:09:07 +08:00
wuyanwen
5f34bac033 修改composer 2020-01-15 18:11:57 +08:00
wuyanwen
05e22d4db8 修改服务注入 2020-01-14 18:32:30 +08:00
wuyanwen
418a6d5418 修改用户模块 2020-01-14 18:31:18 +08:00
wuyanwen
3983c413f6 修改验证为配置注入 2020-01-14 18:31:08 +08:00
wuyanwen
2acf23d296 修改权限模型 2020-01-14 08:23:29 +08:00
wuyanwen
b6b0b5170d 修改用户模块 2020-01-14 08:23:15 +08:00
wuyanwen
09132deb78 新增角色权限traits 2020-01-14 08:22:53 +08:00
wuyanwen
7e41702de8 修改角色管理 2020-01-14 08:22:31 +08:00
wuyanwen
f63706eb0a 新增addFields方法 2020-01-13 21:40:07 +08:00
wuyanwen
5ba918f1a5 修改部门搜索 2020-01-13 21:39:42 +08:00
wuyanwen
64cd112d43 新增过滤搜索参数方法 2020-01-13 21:24:45 +08:00
wuyanwen
2cc2ecae40 新增query方法 2020-01-13 21:24:27 +08:00
wuyanwen
cffcf11192 新增traits方法 2020-01-13 21:24:12 +08:00
wuyanwen
3e0717c339 新增搜索器 2020-01-13 21:23:45 +08:00
wuyanwen
be02170697 新增搜索器 2020-01-13 21:23:24 +08:00
wuyanwen
3b67f3fb5f 注入Query类 2020-01-13 16:23:08 +08:00
wuyanwen
9e2c84dd54 新增query类 2020-01-13 16:22:16 +08:00
wuyanwen
152cd8738a 修改协议 2020-01-13 07:35:26 +08:00
yanwenwu
0fde164059 修改协议 2020-01-12 12:55:28 +08:00
yanwenwu
1b7cc3fcf5 新增角色部门 2020-01-12 12:54:59 +08:00
JaguarJack
313a396ba8 Update LICENSE.txt 2020-01-12 09:44:37 +08:00
yanwenwu
7c09bcf0cf 新增用户岗位关联表 2020-01-12 09:32:32 +08:00
yanwenwu
8b93c63883 新增部门和岗位 2020-01-12 09:30:56 +08:00
wuyanwen
5ec9939cbf 修改readme 2020-01-09 22:24:06 +08:00
wuyanwen
9673c62a14 修改request 2020-01-09 22:20:57 +08:00
wuyanwen
6cc76c9f8e 修改部门和岗位 2020-01-09 22:20:36 +08:00
wuyanwen
dfcfd78557 修改登录 2020-01-09 22:20:18 +08:00
wuyanwen
e994d14537 去除助手函数 2020-01-09 08:22:50 +08:00
wuyanwen
9bcb7466bd 修改基类 2020-01-09 08:22:38 +08:00
wuyanwen
4fa1c9638e 修改服务 2020-01-09 08:22:25 +08:00
wuyanwen
4387bbb7f9 切换request 2020-01-09 08:22:17 +08:00
wuyanwen
2a805b6709 切换request 2020-01-09 08:21:59 +08:00
wuyanwen
88c3bb432d 新增部门和岗位 2020-01-09 08:21:44 +08:00
wuyanwen
e5c8c71011 修改request 2020-01-08 22:43:40 +08:00
wuyanwen
a5242b3aea 修改request基类 2020-01-08 22:31:17 +08:00
wuyanwen
480aadd38b 修改用户数据 2020-01-08 22:18:04 +08:00
wuyanwen
ca0bf90615 修改权限数据 2020-01-08 22:17:48 +08:00
wuyanwen
2dc1270348 修改yonghu 2020-01-08 22:02:25 +08:00
wuyanwen
ce0eb575e9 修改权限 2020-01-08 22:02:16 +08:00
wuyanwen
a03f3c3699 删除文件 2020-01-07 21:52:38 +08:00
wuyanwen
a041504243 删除助手函数 2020-01-07 21:51:15 +08:00
wuyanwen
3ef506d129 修改readme 2020-01-07 21:50:12 +08:00
wuyanwen
9e28cbd91d 登录 2020-01-07 19:18:24 +08:00
wuyanwen
ba91154ee8 增加auth配置 2020-01-07 19:00:17 +08:00
wuyanwen
cf4ef949b5 修改用户信息 2020-01-07 19:00:04 +08:00
wuyanwen
b41121e35b 修改分享 2020-01-07 18:04:05 +08:00
wuyanwen
c9b39327a5 修改auth认证 2020-01-07 17:27:55 +08:00
wuyanwen
f7ac1a23bf 修改命令 2020-01-06 20:20:24 +08:00
wuyanwen
4a8a0b90e8 delete view 2020-01-06 17:42:51 +08:00
wuyanwen
4bf6d5168f 修改readme 2020-01-06 17:10:34 +08:00
wuyanwen
c53c40487c 修改异常 2020-01-06 17:08:10 +08:00
wuyanwen
9b591340a1 delete 2020-01-06 14:47:21 +08:00
wuyanwen
66e4f8f74f 修改路由规则 2019-12-30 17:45:36 +08:00
wuyanwen
ae084819fe 修改 2019-12-30 17:05:42 +08:00
wuyanwen
b061ab5225 修改服务 2019-12-29 17:01:25 +08:00
wuyanwen
872f6b9dfb 增加icon 2019-12-29 17:01:06 +08:00
root
9988c7c00c 删除静态文件 2019-12-29 08:31:14 +08:00
wuyanwen
ef44acee7a 编辑未初始化数据BUG 2019-12-29 08:17:29 +08:00
wuyanwen
998c8edf24 修改服务 2019-12-29 07:48:59 +08:00
wuyanwen
b2bdb12e5b 修改生产的api 2019-12-28 22:19:05 +08:00
wuyanwen
06726f8fc0 修改权限 2019-12-28 21:21:05 +08:00
wuyanwen
1798cbcd0c 修改权限 2019-12-28 21:20:27 +08:00
wuyanwen
a634aa4f93 新增系统模块 2019-12-27 17:01:32 +08:00
wuyanwen
fcc2e04b85 修改 2019-12-27 15:56:56 +08:00
wuyanwen
ef30c07f4a 修改权限 2019-12-27 09:52:03 +08:00
wuyanwen
b94800033f 修改类库 2019-12-27 09:51:48 +08:00
wuyanwen
201cb455f5 修改类库 2019-12-26 09:03:19 +08:00
wuyanwen
1dcce85c3a 修改权限管理 2019-12-26 09:03:09 +08:00
wuyanwen
4a3f043166 角色和用户管理 2019-12-25 22:12:16 +08:00
wuyanwen
ceda3a224a 修改 2019-12-24 18:21:57 +08:00
wuyanwen
8d5ec7966a 修改依赖 2019-12-23 08:40:42 +08:00
wuyanwen
2dc5321128 delete views 2019-12-22 22:04:01 +08:00
yanwenwu
a258ba6cc2 修改用户 2019-12-22 14:18:21 +08:00
yanwenwu
b27ef2570a first commit 2019-12-22 09:37:52 +08:00
1169 changed files with 42543 additions and 66460 deletions

View File

@@ -0,0 +1,24 @@
# 环境
- 操作系统:
- php 版本:
- thinkphp 版本:
- Mysql 版本:
- web 服务器:
# 问题
- 问题描述:
- 问题截图:
# 结果
- 实际结果:
- 预期结果:
# 分析
- 所做的尝试:
-
-
# 方案:
- 解决方案:
> 请在问题解决后关闭 issue

25
.github/issue_template.md vendored Normal file
View File

@@ -0,0 +1,25 @@
# 环境
- 操作系统:
- php 版本:
- thinkphp 版本:
- Mysql 版本:
- web 服务器:
# 问题
- 问题描述:
- 问题截图:
# 结果
- 实际结果:
- 预期结果:
# 分析
- 所做的尝试:
-
-
# 方案:
- 解决方案:
> 请在问题解决后关闭 issue

4
.gitignore vendored
View File

@@ -1,6 +1,8 @@
/.idea /.idea
/.vscode /.vscode
/vendor /vendor
/database /package
*.log *.log
.env .env
composer.lock

View File

@@ -1,32 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
ThinkPHP遵循Apache2开源协议发布并提供免费使用。 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
Apache Licence是著名的非盈利开源组织Apache采用的协议。 1. Definitions.
该协议和BSD类似鼓励代码共享和尊重原作者的著作权
允许代码修改,再作为开源或商业软件发布。需要满足
的条件:
1 需要给代码的用户一份Apache Licence
2 如果你修改了代码,需要在被修改的文件中说明;
3 在延伸的代码中(修改和有源代码衍生的代码中)需要
带有原来代码中的协议,商标,专利声明和其他原来作者规
定需要包含的说明;
4 如果再发布的产品中包含一个Notice文件则在Notice文
件中需要带有本协议内容。你可以在Notice中增加自己的
许可但不可以表现为对Apache Licence构成更改。
具体的协议参考http://www.apache.org/licenses/LICENSE-2.0
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "License" shall mean the terms and conditions for use, reproduction,
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT and distribution as defined by Sections 1 through 9 of this document.
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE "Licensor" shall mean the copyright owner or entity authorized by
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, the copyright owner that is granting the License.
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; "Legal Entity" shall mean the union of the acting entity and all
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER other entities that control, are controlled by, or are under common
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT control with that entity. For the purposes of this definition,
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN "control" means (i) the power, direct or indirect, to cause the
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE direction or management of such entity, whether by contract or
POSSIBILITY OF SUCH DAMAGE. otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

184
README.md
View File

@@ -1,47 +1,165 @@
## CatchAdmin <p align="center">
<img src="https://cdn.learnku.com/uploads/images/202005/17/18206/zSuf7Ce5kM.png!large">
</p>
## 5.1 版本的请使用 tag1.0 版本
## 新版后台在开发中 请不要使用 <p align="center"><code>CatchAdmin</code>是一款基于<a href="http://www.thinkphp.cn/" target="_blank">thinkphp framework</a>
### 环境要求 <a href="https://github.com/PanJiaChen/vue-element-admin/">element admin</a>开发而成的后台管理系统。因为 thinkphp 的简单高效,文档齐全。在看了很多 thinkphp 生态中的后台管理系统,发现没有一款合适的前后端分离系统。遂开发了 CatchAdmin。
基于新版 thinkphp6 服务者的特性,后台的每个模块都可以独立成一个服务,模块之间的功能职责更加清晰。同时后台也兼顾了后台开发前端页面,减少了前端页面代码的输出。将表格和表单都封装成了后台组件,可在后台中通过 Json 数据轻松渲染出前端页面大大提高了开发效率。CatchAdmin 同时也提供 Http 客户端Excel 的导入导出,敏感词检测,大量的内置 commands 等一系列组件工具,提高使用后台的开发体验。
</p>
<p align="center">
<a href="https://catchadmin.com/">文档</a> |
<a href="https://demo.catchadmin.com">演示地址</a> |
<a href="https://bbs.catchadmin.com">论坛交流</a> |
<a href="https://gitee.com/jaguarjack/catchAdmin">项目源码</a> |
<a href="https://www.kancloud.cn/akasishikelu/thinkphp6">看云分析</a>
<a href="#extensions">扩展</a>
</p>
<p align="center">
<a href="https://gitee.com/jaguarjack/catchAdmin" target="_blank">
<img src="https://svg.hamm.cn/gitee.svg?type=star&user=jaguarjack&project=catchAdmin"/>
</a >
<a href="https://gitee.com/jaguarjack/catchAdmin" target="_blank">
<img src="https://svg.hamm.cn/gitee.svg?type=fork&user=jaguarjack&project=catchAdmin"/>
</a >
<img src="https://svg.hamm.cn/badge.svg?key=Base&value=ThinkPHP6"/>
<img src="https://svg.hamm.cn/badge.svg?key=Data&value=MySQL5.5"/>
<img src="https://svg.hamm.cn/badge.svg?key=Runtime&value=PHP7.1"/>
<img src="https://svg.hamm.cn/badge.svg?key=License&value=Apache-2.0"/>
</p >
## 后台启动流程
[![gSrLz6.png](https://z3.ax1x.com/2021/04/26/gSrLz6.png)](https://imgtu.com/i/gSrLz6)
## AntDV 版本
- 请使用 `v1`分支
## 功能
- [x] `用户管理` 后台用户管理
- [x] `部门管理` 配置公司的部门结构,支持树形结构
- [x] `岗位管理` 配置后台用户的职务
- [x] `菜单管理` 配置系统菜单,按钮等等
- [x] `角色管理` 配置用户担当的角色,分配权限
- [x] `数据字典` 管理后台表结构
- [x] `操作日志` 后台用户操作记录
- [x] `登录日志` 后台系统用户的登录记录
- [x] `代码生成` 生成 API 端的 CURD 操作
- [x] `敏感词` 支持敏感词配置
- [x] `附件管理` 可管理上传的文件
- [x] `定时任务` 可管理定时任务,而不依赖于 Crontab
- [x] `短信平台` 短信云管理,支持 阿里大于腾讯云UcloudSubmail
- [x] `云上传` 支持云上传七牛OSS腾讯
- [ ] `微信管理`
## 项目地址
- [github 地址](https://github.com/yanwenwu/catch-admin)
- [gitee 地址](https://gitee.com/jaguarjack/catchAdmin)
- [前端 Vue 项目地址](https://github.com/yanwenwu/catch-admin-vue)
- [文档地址](https://github.com/catch-admin/document)[个人精力实在有限,希望可以小伙伴们可以一起维护文档]
## 支持创作
如果项目对你有帮助,可以订阅支持我❤️。你的每一份支持是对我最大的鼓励。开源不易,感谢支持。可以通过使用 [**🎉 爱发电**](https://afdian.net/@jaguarjack)订阅支持创作。
## 预览
<table>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wucNXq.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wucm6I.md.png"></td>
</tr>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wucZpd.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wuce1A.md.png"></td>
</tr>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wucnXt.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wucKnP.md.png"></td>
</tr>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wuc3tg.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wucM0f.md.png"></td>
</tr>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wucQ78.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wuc1AS.md.png"></td>
</tr>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wuc8hQ.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wucY1s.md.png"></td>
</tr>
<tr>
<td><img src="https://s1.ax1x.com/2020/09/07/wucJpj.md.png"></td>
<td><img src="https://s1.ax1x.com/2020/09/07/wuctcn.md.png"></td>
</tr>
</table>
## 环境要求
- php7.1+ (需以下扩展) - php7.1+ (需以下扩展)
- mbstring - [x] mbstring
- json - [x] json
- openssl - [x] openssl
- xml - [x] xml
- pdo - [x] pdo
- nginx - nginx
- mysql - mysql
### install ### 如何安装
- curl -sS http://install.phpcomposer.com/installer | php > 安装之前请确保已安装 Composer
- composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
- composer update
- php think catch:install
### Use #### 下载项目
- 配置虚拟域名 OR 在根目录下执行 php think run - 通过 Git 下载(推荐)
- yourUrl/login ```shell
- 默认用户名 admin@gmail.com 密码 admin git clone https://gitee.com/jaguarjack/catchAdmin && cd catchAdmin
### Problem curl -sS https://install.phpcomposer.com/installer | php
> SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'updated_at'
> 设置 sql_mode; composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer install --ignore-platform-reqs
``` ```
show variables like 'sql_mode' ; - composer 安装
remove 'NO_ZERO_IN_DATE,NO_ZERO_DATE' ```shell
composer create-project jaguarjack/catchadmin:dev-master
``` ```
> SET GLOBAL sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
### Talking #### 安装
- 可以提 ISSUE请按照 issue 模板提问 下载完成之后通过命令来进行安装, 一键安装 🚀
- 欢迎进入 Q 群,可以及时反馈一些问题。 ```shell
- ![输入图片说明](https://images.gitee.com/uploads/images/2018/1219/110300_0257b6c0_810218.jpeg "微信图片_20181219105915.jpg") php think catch:install
```
仅供学习
## 体验地址 ## 体验地址
[体验地址](http://catch.njphper.com/login) [体验地址](https://demo.catchadmin.com)
- 账号: test@catch.com - 账号: catch@admin.com
- 密码: 123456 - 密码: catchadmin
[catchadmin 文档地址](https://catchadmin.com)
### 系列文章
如果是刚开始使用 thinkphp6, 以下文章可能会对你有些许帮助,文章基于 RC3 版本。整体架构是不变的。
- [Tp6 启动分析](https://www.kancloud.cn/akasishikelu/thinkphp6/1129385)
- [Tp6 Request 解析](https://www.kancloud.cn/akasishikelu/thinkphp6/1134496)
- [TP6 应用初始化](https://www.kancloud.cn/akasishikelu/thinkphp6/1130427)
- [Tp6 中间件分析](https://www.kancloud.cn/akasishikelu/thinkphp6/1136616)
- [Tp6 请求流程](https://www.kancloud.cn/akasishikelu/thinkphp6/1136608)
### Who used
- [uctoo 应用开发管理后台](https://gitee.com/uctoo/uctoo)
### Talking
- [论坛讨论](https://bbs.catchadmin.com)
- 可以提 `ISSUE`,请按照 `issue` 模板提问
- 加入 Q 群 `302266230` 前请先 star 项目支持一下, 备注填写用户名 + 平台。例如: JaguarJack Github
### Thanks
- 感谢 [JetBrains](https://www.jetbrains.com) 提供生产力巨高的 `PHPStorm``WebStorm`
> 排名不分先后
- [top-think/think](https://github.com/top-think/think)
- [element-admin](https://panjiachen.gitee.io/vue-element-admin-site/zh/)
- [thans/tp-jwt-auth](https://packagist.org/packages/thans/tp-jwt-auth)
- [jaguarjack/think-filesystem-cloud](https://github.com/yanwenwu/think-filesystem-cloud)
- [overtrue/wechat](https://github.com/overtrue/wechat)
- [jaguarjack/migration-generator](https://github.com/yanwenwu/migration-generator)
- [phpoffice/phpspreadsheet](https://github.com/PHPOffice/PhpSpreadsheet)

View File

@@ -3,11 +3,8 @@ declare (strict_types = 1);
namespace app; namespace app;
use catcher\CatchAdmin;
use think\App; use think\App;
use think\exception\ValidateException; use think\exception\ValidateException;
use think\facade\View;
use think\helper\Str;
use think\Validate; use think\Validate;
/** /**

View File

@@ -1,11 +1,6 @@
<?php <?php
namespace app; namespace app;
use catcher\CatchResponse;
use catcher\exceptions\CatchException;
use catcher\exceptions\FailedException;
use catcher\exceptions\LoginFailedException;
use catcher\exceptions\PermissionForbiddenException;
use think\db\exception\DataNotFoundException; use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException; use think\db\exception\ModelNotFoundException;
use think\exception\Handle; use think\exception\Handle;
@@ -56,10 +51,7 @@ class ExceptionHandle extends Handle
*/ */
public function render($request, Throwable $e): Response public function render($request, Throwable $e): Response
{ {
// if ($e instanceof CatchException){
return CatchResponse::fail($e->getMessage(), $e->getCode());
// }
// 其他错误交给系统处理 // 其他错误交给系统处理
//return parent::render($request, $e); return parent::render($request, $e);
} }
} }

View File

@@ -3,12 +3,51 @@ namespace app;
// 应用请求对象类 // 应用请求对象类
use catchAdmin\user\Auth; use catchAdmin\permissions\model\Users;
use catcher\CatchAuth;
use catcher\Code;
use catcher\exceptions\FailedException;
use catcher\exceptions\LoginFailedException;
use thans\jwt\exception\TokenBlacklistException;
use thans\jwt\exception\TokenExpiredException;
use thans\jwt\exception\TokenInvalidException;
class Request extends \think\Request class Request extends \think\Request
{ {
public function user() protected $auth;
{
return Auth::user(); /**
* login user
*
* @time 2020年01月09日
* @param null $guard
* @return mixed
*/
public function user($guard = null)
{
if (!$this->auth) {
$this->auth = new CatchAuth;
} }
try {
$user = $this->auth->guard($guard ? : config('catch.auth.default.guard'))->user();
if ($user->status == Users::DISABLE) {
throw new LoginFailedException('该用户已被禁用', Code::USER_FORBIDDEN);
}
} catch (\Exception $e) {
if ($e instanceof TokenExpiredException) {
throw new FailedException('token 过期', Code::LOGIN_EXPIRED);
}
if ($e instanceof TokenBlacklistException) {
throw new FailedException('token 被加入黑名单', Code::LOGIN_BLACKLIST);
}
if ($e instanceof TokenInvalidException) {
throw new FailedException('token 不合法', Code::LOST_LOGIN);
}
throw new FailedException('认证失败: '. $e->getMessage(), $e->getCode());
}
return $user;
}
} }

View File

@@ -6,5 +6,6 @@ return [
// 多语言加载 // 多语言加载
// \think\middleware\LoadLangPack::class, // \think\middleware\LoadLangPack::class,
// Session初始化 // Session初始化
\think\middleware\SessionInit::class // \think\middleware\SessionInit::class
\think\middleware\AllowCrossDomain::class,
]; ];

View File

@@ -1,5 +1,4 @@
<?php <?php
return [ return [
\jaguarjack\think\module\ThinkModuleService::class, \catcher\CatchAdminService::class,
\catchAdmin\CatchAdminService::class,
]; ];

View File

@@ -0,0 +1,23 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager;
use catcher\ModuleService;
class ApimanagerService extends ModuleService
{
public function loadRouteFrom()
{
// TODO: Implement loadRouteFrom() method.
return __DIR__ . DIRECTORY_SEPARATOR . 'route.php';
}
}

View File

@@ -0,0 +1,96 @@
apimanager 模块是一个用于API管理、测试的模块。
# 概述
本模块的设计目标是提供开发人员、产品人员等相关角色可以管理和测试API可以将系统内部或外部API信息保存在系统内使得产品具有自完备的特性和持续交付的特性并可进行灵活的二次开发。
## 主要特性
1. 支持API分类管理支持自定义用户环境变量支持API测试用例管理。
2. 支持HTTP、HTTPS接口测试用例的在线运行。更多协议支持规划在模块roadmap中
3. 支持接口文档管理。
4. 已集成微信第三方平台相关接口测试用例,开发者可快速进行第三方平台应用开发。
5. 支持多帐号多应用使用环境,易于团队协作,不限制接口数量、用户数量、请求数量。
6. 基于catchadmin开发模块安装简单使用便捷支持模块数据导入导出。
7. 开源开放易于二次开发测试用例可共享形成产品API知识库。
8. 支持私有化部署、云原生部署。
9. 可视化管理系统路由列表并可与API测试工具结合可视化测试系统接口。
演示地址demo.uctoo.com 控制台使用demo帐号登录
模块使用界面截图:
<table>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/api%20category%20list.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/api%20category%20edit.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/api%20user%20env%20list.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/api%20user%20env%20edit.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/api%20test%20case%20list.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/api%20test%20case%20edit.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/apirun.png"></td>
</tr>
<tr>
<td><img src="https://gitee.com/UCT_admin/materials/raw/master/uctoo_apitester/images/routelist.png"></td>
</tr>
</table>
## 产品架构
1. 基于catchadmin标准模块开发方式开发可在管理后台一键安装模块和初始化模块数据。
2. 前端采用axios技术选型前端可形成标准客户端接口库。
3. 本地接口数据源类型local主要沿用catchadmin基于用户身份的接口鉴权方案需在API测试用例header添加authorization参数其值为登录接口返回的值。
4. 在扫码登录后注册用户帐号接口测试用例演示了采用微信扫码登录后获取到的用户access_token进行接口鉴权的示例。
5. 微信相关开发使用了[uctoo/think-easywechat SDK](https://gitee.com/UCT/think-easywechat) 集成catchadmin (TP6+VUE) 和 easywechat 4支持微信第三方平台、微信小程序云开发、微信支付服务商等特性。
## 安装教程
### 运行环境依赖
PHP >= 7.1.0
Mysql >= 5.5.0 (需支持innodb引擎)
PDO PHP Extension
MBstring PHP Extension
CURL PHP Extension
ZIP Extension
Composer
catchadmin
### 分步骤安装
1. 从https://gitee.com/jaguarjack/catchAdmin 或 https://gitee.com/uctoo/uctoo 下载https://gitee.com/uctoo/uctoo/tree/master/catch/apimanager 目录模块复制到catchadmin对应目录
2. apimanager/catch-admin-vue 目录内是模块前端vue项目代码复制到前端VUE项目对应目录注意如和原前端vue项目目录的文件有冲突需自行合并代码版本。
3. 前端package.json文件请谨慎覆盖原项目文件。请使用命令 npm install --save @smallwei/avue npm install --save vue-json-editor npm install --save vue-json-views 添加模块依赖等效于手动合并package.json版本。如模块新依赖了第三方组件需要在前端项目目录重新运行 yarn install 命令。
3. 登录管理后台,在系统管理->模块管理启用API管理模块即可安装模块和初始化模块数据。
## 使用手册
1. 可以通过API管理->API分类功能增删改查API分类。
2. 可以通过API环境变量功能增删改查用户环境变量。环境变量的key值以{{key}}方式定义在API测试用例中对应的{{key}}值将替换为环境变量的value值。每个用户可以创建多组环境变量可以切换当前选中的环境变量组。
3. 可以通过API列表功能增删改查API测试用例。api_url、header、body、query、auth字段支持环境变量。新增API测试用例时标识字段请与路由列表name字段保持一致以便API测试用例与路由一一对应快速检索。
4. 可以对已添加的API测试用例执行测试操作在API测试界面可以对api_url、header、body、query、auth等字段进行自定义编辑。发送按钮可以实际执行API测试用例获得接口返回值。
5. 可以使用路由列表->同步至数据库功能,将系统内所有路由信息保存至数据库,以便可视化管理和测试。与 php think route:list -m 命令相同效果。
6. 可以使用路由列表->API测试功能以路由name字段为请求参数跳转至API测试列表页面以便快速查询出对应的API测试用例进行API测试。需更新前端vue项目layout/mixin/formOperate.js文件修复了页面初始化传参bug
具体请参考 https://www.kancloud.cn/doc_uctoo/manual
## 开发说明
### 模块roadmap
1. 通过解析路由文件router.php中的数据自动生成系统接口system类型的所有测试用例。即实现系统接口的可视化测试。
2. 实现API管理功能即可通过界面配置进行基于appid的接口权限管理OAUTH2接口鉴权方案。
3. 实现API测试用例中API文档字段支持markdown编辑和展示。
4. 实现除POST、GET、PUT、DELETE之外的其他接口请求方式。
5. 实现全部content-type类型的支持。
6. 实现测试数据的保存、历史记录等功能。
7. 实现notify类型接口的测试目前还没有在市面上见过类似功能的产品但是实际开发中notify类型的接口在微信第三方平台、各种支付回调、硬件数据上传等很多场景都有遇到。
8. 实现API测试用例的公开共享、私有、保护有偿获取等特性。
具体请参考开源版开发手册 https://www.kancloud.cn/doc_uctoo/uctoo_dev 及 本开源项目示例

View File

@@ -0,0 +1,116 @@
{
"name": "catch-admin",
"version": "4.4.0",
"description": "catch-admin manage system on element-admin-vue",
"author": "JaguarJack <njphper@gmail.com>",
"scripts": {
"dev": "vue-cli-service serve",
"lint": "eslint --ext .js,.vue src",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"new": "plop",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
"@form-create/element-ui": "^2.5.4",
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "5.45.0",
"core-js": "3.6.5",
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
"element-ui": "2.13.2",
"file-saver": "2.0.1",
"fuse.js": "3.4.4",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.2.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"screenfull": "4.2.0",
"script-loader": "0.7.2",
"sortablejs": "1.8.4",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-highlightjs": "^1.3.3",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"xlsx": "0.14.1"
},
"devDependencies": {
"@smallwei/avue": "^2.8.17",
"@vue/cli-plugin-babel": "4.4.4",
"@vue/cli-plugin-eslint": "4.4.4",
"@vue/cli-plugin-unit-jest": "4.4.4",
"@vue/cli-service": "4.4.4",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "9.5.1",
"babel-eslint": "10.1.0",
"babel-jest": "^26.3.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "6.7.2",
"eslint-plugin-vue": "6.2.2",
"highlight.js": "^10.2.0",
"html-webpack-plugin": "3.2.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"lodash": "^4.17.20",
"mockjs": "1.0.1-beta3",
"plop": "2.3.0",
"runjs": "4.3.2",
"sass": "1.26.2",
"sass-loader": "8.0.2",
"script-ext-html-webpack-plugin": "2.1.3",
"serve-static": "1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-highlight.js": "^3.1.0",
"vue-json-editor": "^1.4.3",
"vue-json-views": "^1.3.0",
"vue-template-compiler": "2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"bugs": {
"url": "https://github.com/JaguarJack/catch-admin-vue/issues"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"license": "MIT",
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"husky": {
"hooks": {}
},
"repository": {
"type": "git",
"url": "git+https://github.com/JaguarJack/catch-admin-vue"
}
}

View File

@@ -0,0 +1,7 @@
import request from "@/utils/request";
export function userenvList() {
return request({
url: "/apiTesterUserenv",
method: "get"
});
}

View File

@@ -0,0 +1,48 @@
import Vue from 'vue'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import Avue from '@smallwei/avue'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/element-variables.scss'
// import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log
import request from '@/utils/request'
import * as filters from './filters' // global filters
import catchAdmin from '@/components/Catch'
Vue.use(Element, {
size: 'small'// set element-ui default size
// locale: enLang // 如果使用中文,无需设置,请删除
})
window.axios = request;
Vue.use(Avue, { request });
// register global utility filters
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
// 后台启动
catchAdmin.boot()
Vue.config.productionTip = false
Vue.prototype.$http = request
Vue.prototype.admin = catchAdmin
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})

View File

@@ -0,0 +1,44 @@
<template>
<catch-table
:ref="table.ref"
:headers="table.headers"
:border="true"
:search="table.search"
:filter-params="table.filterParams"
:hide-pagination="true"
:form-create="formCreate"
:actions="table.actions"
:api-route="table.apiRoute"
:dialog-width="table.dialog.width"
default-expand-all
row-key="id"
:tree-props="table.tree.props"
/>
</template>
<script>
import renderTable from '@/views/render-table-form'
export default {
name:'apimanager_apicategory',
mixins: [renderTable],
data() {
return {
tableFrom: 'table/apimanager/ApiCategory',
}
},
methods: {
beforeSubmit(row) {
if (row.form.parent_id instanceof Array) {
row.form.parent_id = row.form.parent_id.length > 0 ? row.form.parent_id.pop() : 0
}
return row
},
afterHandleResponse() {
this.$http.get('table/apimanager/ApiCategory', {params: { only: 'form'}}).then(response => {
this.formCreate.rule = response.data.form
})
}
}
}
</script>

View File

@@ -0,0 +1,217 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="queryParam.env_name" placeholder="环境名称" clearable class="filter-item form-search-input" />
<el-button class="filter-item search" icon="el-icon-search" @click="handleSearch">
搜索
</el-button>
<el-button class="filter-item" icon="el-icon-refresh" @click="handleRefresh">
重置
</el-button>
<el-button class="filter-item fr" type="primary" icon="el-icon-plus" @click="handleCreateEnv">
新增
</el-button>
</div>
<el-table ref="multipleTable" :data="data" tooltip-effect="dark" style="width: 100%" border fit @selection-change="handleSelectMulti">
<el-table-column type="selection" width="55" />
<el-table-column prop="env_name" label="环境名称" />
<el-table-column prop="selected" label="当前环境" />
<el-table-column prop="creator" label="创建人" />
<el-table-column prop="created_at" label="创建时间" />
<el-table-column prop="updated_at" label="更新时间" />
<el-table-column label="操作" fixed="right" width="300">
<template slot-scope="module">
<el-button type="primary" icon="el-icon-refresh" @click="selectAPIenv(module.row.id)" >切换</el-button>
<el-button type="primary" icon="el-icon-edit" @click="handleUpdate(module.row)" />
<el-button type="danger" icon="el-icon-delete" @click="handleDelete(module.row.id)" />
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="paginate.current"
hide-on-single-page
:page-sizes="paginate.sizes"
:page-size="paginate.limit"
:layout="paginate.layout"
:total="paginate.total"/>
<!----------------------------------- 编辑 ---------------------------------------------->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="formVisible" @close="handleCancel">
<el-form label-position="top" :ref="formName" :model="formFieldsData" :rules="rules">
<el-form-item label="env_name" :label-width="formLabelWidth" prop="env_name">
<el-input v-model="formFieldsData.env_name" placeholder="请输入环境名称" autocomplete="off" clearable />
</el-form-item>
<!-- <el-form-item label="appid" :label-width="formLabelWidth" prop="appid">
<el-input v-model="formFieldsData.appid" placeholder="请输入appid" autocomplete="off" clearable />
</el-form-item>
<el-form-item label="project_id" :label-width="formLabelWidth" prop="project_id">
<el-input v-model="formFieldsData.project_id" placeholder="请输入project_id" autocomplete="off" clearable />
</el-form-item> -->
<el-form-item label="env_json" :label-width="formLabelWidth" prop="env_json">
<avue-crud
ref="crudJSON"
:option="tableOption"
:data="jsonTableData"
@row-update="addUpdateJSON"
@row-del="rowDelJSON"
@row-save="rowSaveJSON"
>
<template slot-scope="{ row, index }" slot="menu">
<el-button
type="text"
size="small"
@click="rowCellJSON(row, index)"
>{{ row.$cellEdit ? "自定义保存" : "自定义修改" }}</el-button
>
</template>
</avue-crud>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleSubmit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import formOperate from '@/layout/mixin/formOperate'
import { parseTime } from '@/utils'
export default {
name:'apimanager_apienv',
mixins: [formOperate],
data() {
return {
formName: 'apiEnv',
formLabelWidth: '120px',
// 刷新路由
refreshRoute: true,
// 用户搜索
queryParam: {
env_name: '',
},
formVisible: false,
formFieldsData: {
env_name: '',
env_json: ''
},
url: 'apiTesterUserenv',
// 表单验证
rules: {
env_name: [
{ required: true, message: '请输入环境名称' }
],
env_json: [
{ required: true, message: '请输入环境变量' }
]
},
jsonTableData:[],
tableOption: {
refreshBtn:false,
addBtn: false,
editBtn: false,
addRowBtn: true,
cancelBtn: false,
border: true,
column: [
{
label: "Key",
prop: "key",
cell: true,
rules: [
{
required: true,
message: "Key值示例:{{KeyName}}",
trigger: "blur"
}
]
},
{
label: "Value",
prop: "value",
cell: true,
rules: [
{
required: true,
message: "请输入Value值",
trigger: "blur"
}
]
}
]
},
}
},
watch:{
formFieldsData:{
deep:true,
handler(data){
if(data.env_json){
let obj = this.JsonToObject(data.env_json)
let arr = Object.entries(obj).map(item => {
return { key: item[0], value: item[1], $cellEdit: false };
});
this.jsonTableData = arr;
}
}
}
},
methods: {
handleCreateEnv(){
this.jsonTableData = []
this.handleCreate()
},
selectAPIenv(id) {
this.$http.get( 'apiTesterUserenv/selectAPIenv/' + id).then(response => {
this.$message.success(response.message)
this.handleRefresh()
})
},
// ↓ 处理 ApiBaseInfo Json数据格式 返回 Object 格式 ↓
JsonToObject(json) {
if (json) {
let flag = /\'/.test(json);
if (flag) {
return JSON.parse(json.replace(/\'/gi, '"'));
} else {
return JSON.parse(json);
}
} else {
return null;
}
},
// ↓ JSON 表格 行编辑 ↓
rowCellJSON(row, index) {
this.$refs.crudJSON.rowCell(row, index);
},
// ↓ JSON 表格 编辑行数据 ↓
addUpdateJSON(form, index, done, loading) {
loading();
done();
},
// ↓ JSON 表格 保存行数据 ↓
rowSaveJSON(form, done) {
done();
this.formFieldsData.env_json = this.handlerJson(this.jsonTableData);
},
// ↓ JSON 表格 删除行数据 ↓
rowDelJSON(form, index, done) {
this.jsonTableData.splice(index, 1);
this.formFieldsData.env_json = this.handlerJson(this.jsonTableData);
},
handlerJson(arrData){
let cache = {};
arrData.forEach(item => {
cache[item.key] = item.value;
});
if(Object.keys(cache).length){
return JSON.stringify(cache);
}else{
return null;
}
}
}
}
</script>

View File

@@ -0,0 +1,659 @@
<template>
<div class="run-container">
<el-card class="box-card">
<el-row style="margin-bottom:5px">
<el-button
@click="dialogTableVisible = true"
class="filter-item fr"
type="primary"
icon="el-icon-s-grid"
>
</el-button>
<el-select
style="margin-right:5px"
class="filter-item fr"
@change="changeUserenv"
v-model="currentEnvId"
placeholder="用户环境变量"
>
<el-option
:value="env.id"
:label="env.env_name"
v-for="env in userEnvInfos"
:key="env.id"
/>
</el-select>
</el-row>
<el-input
placeholder="请输入内容"
v-model="currentInputUrl"
class="input-with-select"
:disabled="userable"
>
<el-select
class="method_select"
:disabled="userable"
v-model="currentSelectMethod"
slot="prepend"
placeholder="请选择"
>
<el-option
v-for="(mth, index) in apiMethods"
:key="index"
:label="mth"
:value="mth"
></el-option>
</el-select>
<el-button
type="primary"
class="apisend"
slot="append"
icon="el-icon-s-promotion"
@click="_runapi"
:disabled="sendAble"
>发送</el-button
>
</el-input>
<el-tabs class="mt30 tab-liut" type="border-card">
<el-tab-pane label="Header">
<el-table :data="headerTableData">
<el-table-column width="50">
<template slot-scope="{ row }">
<el-checkbox v-model="row.open"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="KEY">
<template slot-scope="{ row }">
<item-btn v-model="row.key" />
</template>
</el-table-column>
<el-table-column label="VALUE">
<template slot-scope="{ row }">
<item-btn :selectshow="true" v-model="row.value" />
</template>
</el-table-column>
<el-table-column width="50">
<template slot="header" slot-scope="scope">
<el-button
type="primary"
icon="el-icon-plus"
circle
@click="addRow(headerTableData, scope)"
></el-button>
</template>
<template slot-scope="{ row }">
<el-button
icon="el-icon-delete"
circle
type="danger"
@click="delRow(row, headerTableData)"
></el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="Query">
<el-table :data="queryTableData">
<el-table-column width="50">
<template slot-scope="{ row }">
<el-checkbox v-model="row.open"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="KEY">
<template slot-scope="{ row }">
<item-btn v-model="row.key" />
</template>
</el-table-column>
<el-table-column label="VALUE">
<template slot-scope="{ row }">
<item-btn :selectshow="true" v-model="row.value" />
</template>
</el-table-column>
<el-table-column width="50">
<template slot="header" slot-scope="scope">
<el-button
type="primary"
icon="el-icon-plus"
circle
@click="addRow(queryTableData, scope)"
></el-button>
</template>
<template slot-scope="{ row }">
<el-button
icon="el-icon-delete"
circle
type="danger"
@click="delRow(row, queryTableData)"
></el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="Body">
<el-radio-group v-model="radio">
<el-radio :label="0">none</el-radio>
<el-radio :label="1">form-data</el-radio>
<el-radio :label="2">x-www-form-urlencoded</el-radio>
<el-radio :label="3">json</el-radio>
<el-radio :label="4">raw(json)</el-radio>
</el-radio-group>
<vue-json-editor
class="vjd"
v-if="radio === 4"
v-model="rawJson"
:mode="'code'"
lang="zh"
></vue-json-editor>
<el-table
v-else
v-loading="loading"
element-loading-text="This request dose not have a body"
element-loading-spinner="el-icon-warning"
element-loading-background="rgba(0, 0, 0, 0.8)"
:data="bodyTableData"
>
<el-table-column width="50">
<template slot-scope="{ row }">
<el-checkbox v-model="row.open"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="KEY">
<template slot-scope="{ row }">
<item-btn v-model="row.key" />
</template>
</el-table-column>
<el-table-column label="VALUE">
<template slot-scope="{ row }">
<item-btn :selectshow="true" v-model="row.value" />
</template>
</el-table-column>
<el-table-column width="50">
<template slot="header" slot-scope="scope">
<el-button
type="primary"
icon="el-icon-plus"
circle
@click="addRow(bodyTableData, scope)"
></el-button>
</template>
<template slot-scope="{ row }">
<el-button
icon="el-icon-delete"
circle
type="danger"
@click="delRow(row, bodyTableData)"
></el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-card v-if="json" class="box-card mt30">
<json-view :data="json" />
</el-card>
</el-card>
<el-dialog :title="currentUserEnvName" :visible.sync="dialogTableVisible">
<el-table :data="currentUserEnvJson" border style="width: 100%">
<el-table-column prop="key" label="变量" fit> </el-table-column>
<el-table-column prop="value" label="值" fit> </el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import vueJsonEditor from "vue-json-editor";
import { userenvList } from "@/api/userenv";
import ItemBtn from "./itemBtn.vue";
import jsonView from "vue-json-views";
import axios from "axios";
import qs from "qs";
export default {
components: {
jsonView,
ItemBtn,
vueJsonEditor
},
data() {
return {
// ↓ 是否允许用户发送请求 ↓
sendAble: false,
// ↓ 是否允许用户编辑 ↓
userable: false,
// ↓ 用户变量对话框展示与隐藏 ↓
dialogTableVisible: false,
// ↓ Api Mthods ↓
apiMethods: [
"POST",
"GET",
"PUT",
"PATCH",
"DELETE",
"COPY",
"HEAD",
"OPTIONS"
],
// ↓ Api 响应 ↓
json: null,
// ↓ api接口基本信息 ↓
apiBaseInfo: {},
// ↓ 用户所有环境变量 ↓
userEnvInfos: [],
// ↓ 当前用户选择的环境变量id ↓
currentEnvId: null,
// ↓ 用户当前输入的Url ↓
currentInputUrl: "",
// ↓ 用户当前选择的Api Method ↓
currentSelectMethod: "GET",
regEnv: /\{\{(.+?)\}\}/g,
// ↓ 请求 body 下的 数据发送格式 0:none 1:form-data 2:x-www-form-urlencoded ↓
radio: 2,
checked: true,
input: "",
// ↓ 请求Body ↓
bodyTableData: [],
headerTableData: [],
queryTableData: [],
radioLabel: ["none", "form-data", "x-www-form-urlencoded", "json"],
rawJson: {},
headers: null,
params: null
};
},
computed: {
// ↓ 用户当前选择环境变量信息 ↓
currentUserEnvInfo() {
if (this.userEnvInfos.length !== 0) {
return this.userEnvInfos.filter(env => env.id === this.currentEnvId)[0];
} else {
return null;
}
},
// ↓ 用户当前选择环境变量信息键值对模型 ↓
currentUserEnvJson() {
if (this.currentUserEnvInfo && this.currentUserEnvInfo.env_json) {
let obj = JSON.parse(this.currentUserEnvInfo.env_json);
return Object.entries(obj).map(item => {
return { key: item[0], value: item[1] };
});
} else {
return null;
}
},
// ↓ 用户当前选择的环境变量名称 ↓
currentUserEnvName() {
if (this.currentUserEnvInfo && this.currentUserEnvInfo.env_name) {
return this.currentUserEnvInfo.env_name;
} else {
return "未定义名称";
}
},
// ↓ 用户当前选择环境变量信息Map数据模型 ↓
currentUserEnvMap() {
if (this.currentUserEnvInfo && this.currentUserEnvInfo.env_json) {
let obj = JSON.parse(this.currentUserEnvInfo.env_json);
return obj;
} else {
return null;
}
},
// ↓ Api接口url (base_url + url) ↓
currentApiUrl() {
// ↓ reg formula ↓
let regEnv = /\{\{(.+?)\}\}/g;
// ↓ 拿到用户当前地址栏看见的 Url ↓
let curInputUrl = this.currentInputUrl;
// ↓ 判断用户是否使用了变量环境字符串 ↓
let flag = regEnv.test(curInputUrl);
if (flag) {
if (this.currentUserEnvMap) {
let new_url = this.replaceUserenv(curInputUrl); //curInputUrl.replace(regEnv,this.currentUserEnvMap["{{host}}"]);
return new_url;
} else {
return null;
}
} else {
return curInputUrl;
}
},
loading() {
return !Boolean(this.radio);
}
},
mounted() {
this.init();
},
methods: {
init() {
let id = this.$route.query.id;
this.$http.get("apitester/" + id).then(response => {
this.apiBaseInfo = response.data;
this.apiBaseInfo.body = this.apiBaseInfo.body.replace(/'/g, '"');
if (this.apiBaseInfo.body) {
// let resstr = this.apiBaseInfo.body
// .replace(/\\/g, "")
// .replace(/"{/g, "{")
// .replace(/}"/g, "}");
this.rawJson = JSON.parse(this.apiBaseInfo.body);
} else {
this.rawJson = {};
}
this.resetMethodAndUrl();
this.initTable();
});
userenvList().then(response => {
this.userEnvInfos = response.data;
if (response.data.length !== 0) {
response.data.forEach(env => {
if (env.selected) {
this.currentEnvId = env.id;
}
});
}
});
},
/**@dis 初始化table表格 */
initTable() {
let { header, query, body, content_type } = this.apiBaseInfo;
this.radio = this.radioLabel.findIndex(el => {
if (content_type.indexOf(el) !== -1) return true;
return false;
});
let resTable = [header, query, body].map(el => {
return el ? JSON.parse(el) : false;
});
[this.headerTableData, this.queryTableData, this.bodyTableData].some(
(el, index) => {
if (resTable[index] === false) return false;
for (const [key, value] of Object.entries(resTable[index])) {
if (typeof value === "string") {
el.push({ open: true, key: key.trim(), value: value.trim() });
} else if (typeof value === "object") {
el.push({
open: true,
key: key.trim(),
value: JSON.stringify(value)
});
} else {
el.push({ open: true, key: key.trim(), value });
}
}
}
);
},
watchParam(arr) {
let regEnv = /\{\{(.+?)\}\}/g;
let watchCeche = {};
arr.forEach(item => {
let regFlag = regEnv.test(item.value);
let cacheFlag = this.currentUserEnvMap[item.value];
if (regFlag && cacheFlag) {
watchCeche[item.key] = cacheFlag;
}
});
return watchCeche;
},
// ↓ 执行Api 核心业务逻辑 ↓
_runapi() {
this.requestBeforeHook();
switch (this.currentSelectMethod) {
case "POST":
this.apiPost();
break;
case "GET":
this.apiGet();
break;
case "PUT":
this.apiPut();
break;
case "DELETE":
this.apiDelete();
break;
case "PATCH":
case "COPY":
case "HEAD":
case "OPTIONS":
this.$notify({
title: "消息",
message: "通知开发人员进行扩展",
type: "info"
});
break;
default:
this.$notify({
title: "消息",
message: "平台版本暂时不支持该请求方法",
type: "info"
});
break;
}
},
headFactory(ctype, args) {
let product = null;
switch (ctype) {
case "x-www-form-urlencoded":
product = qs.stringify(args);
break;
case "form-data":
let data = new FormData();
for (const key in args) {
data.append(key, args[key]);
}
product = data;
break;
case "raw":
this.$notify({
title: "消息",
message: "平台版本暂时还未支持raw数据格式",
type: "info"
});
product = args;
break;
case "json":
default:
product = args;
break;
}
return product;
},
tbDataToObj(tb) {
const params = {};
tb.filter(el => el.open)
.map(el =>
Object.defineProperty({}, el.key, {
value: el.value,
writable: true,
enumerable: true,
configurable: true
})
)
.forEach(el => Object.assign(params, el));
return params;
},
async apiGet() {
let { status, data } = await axios
.get(this.currentApiUrl, {
headers: this.headers,
params: this.params
})
.catch(err => {
this.json = err;
this.$notify({
title: "失败",
message: "请求发送失败",
type: "error"
});
});
if (status === 200) {
this.json = data;
this.$notify({
title: "成功",
message: "请求发送成功",
type: "success"
});
}
},
async apiPost() {
const data =
this.radio === 4
? this.rawJson
: this.headFactory(
this.radioLabel[this.radio],
this.tbDataToObj(this.bodyTableData)
);
let res = await axios
.post(this.currentApiUrl, data, {
headers: this.headers,
params: this.params
})
.catch(err => {
this.json = {};
this.$notify({
title: "失败",
message: "请求发送失败",
type: "error"
});
});
if (res.status === 200) {
this.json = res.data;
this.$notify({
title: "成功",
message: "请求发送成功",
type: "success"
});
}
},
async apiPut() {
const data = this.headFactory(
this.radioLabel[this.radio],
this.tbDataToObj(this.bodyTableData)
);
let res = await axios
.put(this.currentApiUrl, data, {
headers: this.headers,
params: this.params
})
.catch(err => {
this.json = err;
this.$notify({
title: "失败",
message: "请求发送失败",
type: "error"
});
});
if (res.status === 200) {
this.json = res.data;
this.$notify({
title: "成功",
message: "请求发送成功",
type: "success"
});
}
},
async apiDelete() {
const data =
this.radio === 4
? this.rawJson
: this.headFactory(
this.radioLabel[this.radio],
this.tbDataToObj(this.bodyTableData)
);
let res = await axios
.delete(this.currentApiUrl, {
data,
headers: this.headers,
params: this.params
})
.catch(err => {
this.json = err;
this.$notify({
title: "失败",
message: "请求发送失败",
type: "error"
});
});
if (res.status === 200) {
this.json = res.data;
this.$notify({
title: "成功",
message: "请求发送成功",
type: "success"
});
}
},
requestBeforeHook() {
this.headers = this.watchParam(this.headerTableData);
this.params = Object.assign(
this.tbDataToObj(this.queryTableData),
this.watchParam(this.queryTableData)
);
},
// ↓ 修改用户环境变量 ↓
changeUserenv(env) {
this.$http.get("apiTesterUserenv/selectAPIenv/" + env).then(response => {
this.$message.success(response.message);
});
},
// ↓ 重置 Api Methods 与 Api Url ↓
resetMethodAndUrl() {
this.currentInputUrl = this.apiBaseInfo.api_url;
this.currentSelectMethod = this.apiBaseInfo.methods.toLocaleUpperCase();
},
//循环用户选中的环境变量进行替换
replaceUserenv(orgStr) {
let userEnv = this.currentUserEnvJson;
for (let envelement of userEnv) {
orgStr = orgStr.replace(envelement.key, envelement.value);
}
return orgStr;
},
/**@dis 删除行 */
delRow(row, _table) {
let index = _table.findIndex(_row => row === _row);
_table.splice(index, 1);
},
addRow(_table) {
_table.push({ open: false, key: "KEY", value: "VALUE" });
}
},
watch: {
// ↓ 监听经过处理的 Api Url 控制发送按钮是否开启 ↓
currentApiUrl(url) {
let flag = /http|https/.test(url);
if (url && flag) {
this.sendAble = false;
} else {
this.sendAble = true;
}
}
}
};
</script>
<style lang="scss" scoped>
.run-container {
margin: 20px;
.method_select {
width: 100px;
}
.apisend {
background-color: #70b9eb;
color: white;
}
.mt30 {
margin-top: 30px;
}
.tab-liut {
min-height: 200px;
}
}
</style>
<style lang="scss">
.vjd {
.jsoneditor-vue {
height: 430px;
}
.jsoneditor-poweredBy {
display: none;
}
}
</style>

View File

@@ -0,0 +1,114 @@
<template>
<div class="item-btn-container">
<el-row>
<el-col v-show="!selectValue" :span="18">
<el-button @click="clickBtn" v-if="isShow">{{ value }}</el-button>
<el-input
ref="inputRef"
placeholder="请输入内容"
v-else
:value="value"
@blur="inputBlur"
@input="value => this.$emit('input', value)"
></el-input>
</el-col>
<el-col v-show="selectValue" :span="18">
<el-tag v-if="filename" @close="delFile" closable type="success">{{
filename
}}</el-tag>
<el-upload
v-else
action="/upload/image"
:limit="1"
ref="upload"
:show-file-list="false"
:http-request="uploadGuard"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-col>
<el-col :span="6">
<el-select v-if="selectshow" v-model="selectValue">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
props: {
value: {
type: [String, File, Number],
default() {
return null;
}
},
selectshow: {
value: Boolean,
default() {
return false;
}
}
},
data() {
return {
isShow: true,
options: [
{
value: false,
label: "Text"
},
{
value: true,
label: "File"
}
],
selectValue: false,
filename: ""
};
},
computed: {
uploadFile() {
return this.$refs.upload;
}
},
methods: {
/**@dis 切换状态 */
clickBtn() {
this.isShow = false;
this.$nextTick(() => {
this.$refs.inputRef.focus();
});
},
inputBlur() {
this.isShow = true;
},
uploadGuard({ file }) {
this.filename = file.name;
this.$emit("input", file);
},
delFile() {
this.filename = "";
this.$emit("input", null);
}
}
};
</script>
<style lang="scss">
.item-btn-container {
.el-button {
max-width: 100%;
overflow: hidden;
text-align: left;
}
}
</style>

View File

@@ -0,0 +1,816 @@
<template>
<div class="app-container">
<el-row :gutter="12">
<el-col :span="6">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>分类</span>
</div>
<div class="block">
<el-tree
:data="apicategory"
:props="apicategoryProps"
node-key="id"
default-expand-all
:expand-on-click-node="false"
@node-click="getApicategoryData"
/>
</div>
</el-card>
</el-col>
<el-col :span="18">
<div class="filter-container">
<el-row>
<el-input
v-model="queryParam.api_title"
placeholder="名称"
clearable
class="filter-item form-search-input"
/>
<el-input
v-model="queryParam.api_name"
placeholder="标识"
clearable
class="filter-item form-search-input"
/>
<el-select
v-model="queryParam.type"
clearable
placeholder="请选择数据源类型"
class="filter-item"
style="margin-right: 5px"
>
<el-option value="1" label="remote" />
<el-option value="2" label="local" />
</el-select>
<el-button
class="filter-item fr"
icon="el-icon-refresh"
@click="handleRefresh"
>
重置
</el-button>
<el-button
style="margin-right: 5px"
class="filter-item fr search"
icon="el-icon-search"
@click="handleSearch"
>
搜索
</el-button>
</el-row>
<el-row style="margin-top: 5px">
<el-select
class="filter-item "
@change="changeUserenv"
v-model="userenvid"
placeholder="用户环境变量"
>
<el-option
:value="env.id"
:label="env.env_name"
v-for="env in userenvs"
:key="env.id"
/>
</el-select>
<el-button
class="filter-item fr"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>
新增
</el-button>
</el-row>
</div>
<el-button
v-if="this.selectedIds.length"
size="small"
class="filter-item mb-5"
type="danger"
icon="el-icon-delete"
@click="handleMultiDelete"
>
批量删除
</el-button>
<el-table
ref="multipleTable"
:data="data"
tooltip-effect="dark"
style="width: 100%"
border
fit
@selection-change="handleSelectMulti"
>
<el-table-column
type="selection"
width="55"
:selectable="selectInit"
/>
<el-table-column label="名称">
<template slot-scope="api">{{ api.row.api_title }}</template>
</el-table-column>
<el-table-column prop="methods" label="methods" />
<el-table-column prop="api_name" label="标识" />
<!-- <el-table-column prop="status" label="状态">
<template slot-scope="api">
<el-switch
v-if="api.row.id === 0"
v-model="api.row.status"
disabled
active-text="启用"
:active-value="1"
/>
<el-switch
v-else
v-model="api.row.status"
active-text="启用"
inactive-text="禁用"
:active-value="1"
:inactive-value="2"
@change="disOrEnableUser(api.row)"
/>
</template>
</el-table-column> -->
<el-table-column prop="type" label="数据源类型">
<template slot-scope="api">
<el-tag v-if="api.row.type === 1" type="success">remote</el-tag>
<el-tag v-if="api.row.type === 2" type="danger">local</el-tag>
</template>
</el-table-column>
<el-table-column prop="created_at" label="创建时间" />
<el-table-column label="操作" fixed="right" width="300">
<template slot-scope="api">
<el-button
type="primary"
icon="el-icon-refresh"
@click="testApi(api.row.id)"
>测试</el-button
>
<el-button
type="primary"
icon="el-icon-edit"
v-if="api.row.id === 0"
disabled
/>
<el-button
type="primary"
icon="el-icon-edit"
v-else
@click="beforeHandleUpdate(api.row)"
/>
<el-button
type="danger"
icon="el-icon-edit"
v-if="api.row.id === 0"
disabled
/>
<el-button
type="danger"
icon="el-icon-delete"
v-else
@click="handleDelete(api.row.id)"
/>
</template>
</el-table-column>
</el-table>
<el-pagination
background
class="pagination-container"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="paginate.current"
hide-on-single-page
:page-sizes="paginate.sizes"
:page-size="paginate.limit"
:layout="paginate.layout"
:total="paginate.total"
/>
</el-col>
</el-row>
<!----------------------------------- API ---------------------------------------------->
<el-dialog
:close-on-click-modal="false"
:title="title"
:visible.sync="formVisible"
:destroy-on-close="true"
@close="handleCancel()"
>
<el-form :ref="formName" :model="formFieldsData" :rules="rules">
<el-row :gutter="12">
<el-form-item
label="分类"
:label-width="formLabelWidth"
prop="category_id"
>
<el-cascader
v-model="formFieldsData.category_id"
:options="treeCategory.data"
:props="treeCategory.prop"
:show-all-levels="false"
style="width: 85%"
clearable
/>
</el-form-item>
<el-form-item label="type" :label-width="formLabelWidth" prop="type">
<el-select
v-model="formFieldsData.type"
style="width: 85%"
placeholder="请选择数据源类型"
>
<el-option
v-for="(item, key) in type"
:key="key"
:label="item"
:value="key"
/>
</el-select>
</el-form-item>
<el-form-item
label="名称"
:label-width="formLabelWidth"
prop="api_title"
>
<el-input
v-model="formFieldsData.api_title"
placeholder="请输入名称"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item
label="标识路由name"
:label-width="formLabelWidth"
prop="api_name"
>
<el-input
v-model="formFieldsData.api_name"
placeholder="请输入英文唯一标识请与路由name字段一致"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item
label="methods类型"
:label-width="formLabelWidth"
prop="methods"
>
<el-select
v-model="formFieldsData.methods"
placeholder="请选择methods类型"
>
<el-option
v-for="(item, key) in methodsTypes"
:key="key"
:label="item"
:value="key"
/>
</el-select>
</el-form-item>
<el-form-item
label="api_url"
:label-width="formLabelWidth"
prop="api_url"
>
<el-input
v-model="formFieldsData.api_url"
placeholder="请输入api地址"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item label="Header">
<avue-crud
ref="crudHeader"
:option="tableOption"
:data="headerTableData"
@row-update="addUpdateHeader"
@row-del="rowDelHeader"
@row-save="rowSaveHeader"
>
<template slot-scope="{ row, index }" slot="menu">
<el-button
type="text"
size="small"
@click="rowCellHeader(row, index)"
>{{ row.$cellEdit ? "自定义保存" : "自定义修改" }}</el-button
>
</template>
</avue-crud>
</el-form-item>
<el-form-item label="Body">
<avue-crud
ref="crudBody"
:option="tableOption"
:data="bodyTableData"
@row-update="addUpdateBody"
@row-del="rowDelBody"
@row-save="rowSaveBody"
>
<template slot-scope="{ row, index }" slot="menu">
<el-button
type="text"
size="small"
@click="rowCellBody(row, index)"
>{{ row.$cellEdit ? "自定义保存" : "自定义修改" }}</el-button
>
</template>
</avue-crud>
</el-form-item>
<el-form-item label="Query">
<avue-crud
ref="crudQuery"
:option="tableOption"
:data="queryTableData"
@row-update="addUpdateQuery"
@row-del="rowDelQuery"
@row-save="rowSaveQuery"
>
<template slot-scope="{ row, index }" slot="menu">
<el-button
type="text"
size="small"
@click="rowCellQuery(row, index)"
>{{ row.$cellEdit ? "自定义保存" : "自定义修改" }}</el-button
>
</template>
</avue-crud>
</el-form-item>
<el-form-item label="Auth">
<avue-crud
ref="crudAuth"
:option="tableOption"
:data="authTableData"
@row-update="addUpdateAuth"
@row-del="rowDelAuth"
@row-save="rowSaveAuth"
>
<template slot-scope="{ row, index }" slot="menu">
<el-button
type="text"
size="small"
@click="rowCellAuth(row, index)"
>{{ row.$cellEdit ? "自定义保存" : "自定义修改" }}</el-button
>
</template>
</avue-crud>
</el-form-item>
<el-form-item
label="content-type"
:label-width="formLabelWidth"
prop="content_type"
>
<el-select
v-model="formFieldsData.content_type"
style="width: 85%"
placeholder="请选择content_type类型"
>
<el-option
v-for="(item, key) in content_types"
:key="key"
:label="item"
:value="key"
/>
</el-select>
</el-form-item>
<el-form-item
label="文档url"
:label-width="formLabelWidth"
prop="doc_url"
>
<el-input
v-model="formFieldsData.doc_url"
placeholder="请输入文档url地址"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item
label="文档"
:label-width="formLabelWidth"
prop="document"
>
<el-input
type="textarea"
:rows="5"
v-model="formFieldsData.document"
placeholder="请输入文档内容markdown格式"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item
label="示例请求数据"
:label-width="formLabelWidth"
prop="sample_data"
>
<el-input
type="textarea"
:rows="5"
v-model="formFieldsData.sample_data"
placeholder="请输入示例请求数据"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item
label="示例返回数据"
:label-width="formLabelWidth"
prop="sample_result"
>
<el-input
type="textarea"
:rows="5"
v-model="formFieldsData.sample_result"
placeholder="请输入示例返回数据"
autocomplete="off"
clearable
/>
</el-form-item>
<el-form-item label="排序" :label-width="formLabelWidth" prop="sort">
<el-input-number
v-model="formFieldsData.sort"
:min="1"
:max="100000"
/>
</el-form-item>
<el-form-item label="状态" :label-width="formLabelWidth">
<el-radio v-model="formFieldsData.status" :label="1" checked
>已完成</el-radio
>
<el-radio v-model="formFieldsData.status" :label="2"
>待开发</el-radio
>
<el-radio v-model="formFieldsData.status" :label="3"
>开发中</el-radio
>
<el-radio v-model="formFieldsData.status" :label="4"
>已废弃</el-radio
>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel()"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import formOperate from "@/layout/mixin/formOperate";
import { userenvList } from "@/api/userenv";
export default {
name: "apimanager_apitester",
mixins: [formOperate],
data() {
return {
formName: "apis",
// 刷新路由
refreshRoute: true,
apicategoryProps: {
label: "category_title"
},
formLabelWidth: "120px",
// api搜索
queryParam: {
api_title: "",
api_name: "",
status: "",
type: "",
category_id: ""
},
formVisible: false,
formFieldsData: {
api_title: "",
api_name: "",
api_url: "",
category_id: 0,
type: "",
methods: "",
auth: "",
header: "",
query: "",
body: "",
doc_url: "",
document: "",
sample_data: "",
sample_result: "",
sort: "",
status: "",
content_type: "",
env_id: "",
memo: ""
},
url: "apitester",
data: [],
// 分类
treeCategory: {
data: [],
default: [],
prop: {
label: "category_title",
value: "id",
emitPath: false,
checkStrictly: true
}
},
// methods类型
type: {
1: "remote",
2: "local"
},
// methods类型
methodsTypes: {
POST: "POST",
GET: "GET",
PUT: "PUT",
PATCH: "PATCH",
DELETE: "DELETE",
COPY: "COPY",
HEAD: "HEAD",
OPTIONS: "OPTIONS"
},
content_types: {
"application/x-www-form-urlencoded":
"application/x-www-form-urlencoded",
"application/json; charset=utf-8": "application/json; charset=utf-8",
"multipart/form-data": "multipart/form-data",
raw: "raw"
},
// 表单验证
rules: {
api_title: [
{ required: true, message: "请输入名称", trigger: "blur" },
{ min: 3, max: 20, message: "长度在 3 到 20 个字符", trigger: "blur" }
],
api_name: [
{ required: true, message: "请输入英文唯一标识", trigger: "blur" }
]
},
// 分类
apicategory: [],
userenvs: [],
userenvid: {},
// ↓ api form 表单 ↓
headerTableData: [],
bodyTableData: [],
queryTableData: [],
authTableData: [],
// ↓ api form 表单 Options ↓
tableOption: {
refreshBtn: false,
addBtn: false,
editBtn: false,
addRowBtn: true,
cancelBtn: false,
border: true,
column: [
{
label: "Key",
prop: "key",
cell: true,
rules: [
{
required: true,
message: "请输入Key值",
trigger: "blur"
}
]
},
{
label: "Value",
prop: "value",
cell: true,
rules: [
{
required: true,
message: "请输入Value值",
trigger: "blur"
}
]
}
]
}
};
},
// 初始化数据
mounted() {
this.$http.get("apicategory").then(response => {
this.apicategory = response.data;
});
userenvList().then(response => {
if (response.data.length !== 0) {
response.data.forEach(env => {
if (env.selected) {
this.userenvid = env.id;
}
});
}
this.userenvs = response.data;
});
},
methods: {
testApi(id) {
this.$router.push({ path: "/apimanager/apirun", query: { id } });
},
// 获取分类API
getApicategoryData(data, node, self) {
this.queryParam.category_id = data.id;
this.handleSearch();
},
// 禁用/启用
disOrEnableApi(api) {
this.$http.put("apitester/switch/status/" + api.id).then(response => {
this.$message({
message: response.message,
type: "success"
});
});
},
beforeCreate() {
this.$http.get("apicategory").then(response => {
this.treeCategory.data = response.data;
});
},
beforeHandleUpdate(api) {
this.beforeCreate();
this.$http.get(this.url + "/" + api.id).then(response => {
const api = response.data;
this.handleUpdate(api);
});
},
selectInit(row, index) {
return row.id !== 0;
},
submit() {
this.handleSubmit();
},
onJsonChange(value) {
console.log("value:", value);
},
onJsonSave(value) {
console.log("value:", value);
},
changeUserenv(env) {
this.$http
.get("apiTesterUserenv/selectAPIenv/" + env)
.then(response => {});
},
// ↓ Header 表格 行编辑 ↓
rowCellHeader(row, index) {
this.$refs.crudHeader.rowCell(row, index);
},
rowCellBody(row, index) {
this.$refs.crudBody.rowCell(row, index);
},
rowCellQuery(row, index) {
this.$refs.crudQuery.rowCell(row, index);
},
rowCellAuth(row, index) {
this.$refs.crudAuth.rowCell(row, index);
},
// ↓ Header 表格 编辑行数据 ↓
addUpdateHeader(form, index, done, loading) {
loading();
done();
},
addUpdateBody(form, index, done, loading) {
loading();
done();
},
addUpdateQuery(form, index, done, loading) {
loading();
done();
},
addUpdateAuth(form, index, done, loading) {
loading();
done();
},
afterCancel() {
setTimeout(() => {
this.headerTableData = [];
this.bodyTableData = [];
this.queryTableData = [];
this.authTableData = [];
}, 400);
Object.keys(this.formFieldsData).forEach(k => {
switch (k) {
case "category_id":
this.formFieldsData[k] = null;
break;
case "type":
this.formFieldsData[k] = "1";
break;
default:
break;
}
});
},
// ↓ Header 表格 保存行数据 ↓
rowSaveHeader(form, done) {
done();
let json = this.handlerTable(this.headerTableData);
this.formFieldsData.header = json;
},
rowSaveBody(form, done) {
done();
let json = this.handlerTable(this.bodyTableData);
this.formFieldsData.body = json;
},
rowSaveQuery(form, done) {
done();
let json = this.handlerTable(this.queryTableData);
this.formFieldsData.query = json;
},
rowSaveAuth(form, done) {
done();
let json = this.handlerTable(this.authTableData);
this.formFieldsData.auth = json;
},
// ↓ Header 表格 删除行数据 ↓
rowDelHeader(form, index, done) {
this.headerTableData.splice(index, 1);
let json = this.handlerTable(this.headerTableData);
this.formFieldsData.header = json;
},
rowDelBody(form, index, done) {
this.bodyTableData.splice(index, 1);
let json = this.handlerTable(this.bodyTableData);
this.formFieldsData.body = json;
},
rowDelQuery(form, index, done) {
this.queryTableData.splice(index, 1);
let json = this.handlerTable(this.queryTableData);
this.formFieldsData.query = json;
},
rowDelAuth(form, index, done) {
this.authTableData.splice(index, 1);
let json = this.handlerTable(this.authTableData);
this.formFieldsData.auth = json;
},
// ↓ 处理 ApiBaseInfo Json数据格式 返回 Object 格式 ↓
JsonToObject(json) {
if (json && json !== "") {
let flag = /\'/.test(json);
if (flag) {
return JSON.parse(json.replace(/\'/gi, '"'));
} else {
return JSON.parse(json);
}
} else {
return null;
}
},
initTableData(json) {
let obj = this.JsonToObject(json);
let arr = Object.entries(obj).map(item => {
return { key: item[0], value: item[1], $cellEdit: false };
});
return arr;
},
handlerTable(arr) {
let obj = {};
if (arr) {
arr.forEach(item => {
return (obj[item.key] = item.value);
});
}
if (Object.keys(obj).length) {
return JSON.stringify(obj);
} else {
return "";
}
}
},
watch: {
formFieldsData: {
handler(data) {
if (data.header) {
this.headerTableData = this.initTableData(data.header);
}
if (data.body) {
this.bodyTableData = this.initTableData(data.body);
}
if (data.auth) {
this.authTableData = this.initTableData(data.auth);
}
if (data.query) {
this.queryTableData = this.initTableData(data.query);
}
},
deep: true
}
}
};
</script>
<style>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<div class="app-container">
<el-form ref="form" :model="queryParam" :inline="true">
<el-form-item prop="rule" label="rule" :label-width="formLabelWidth">
<el-input v-model="queryParam.rule" placeholder="rule" type="input"></el-input>
</el-form-item><el-form-item prop="route" label="route" :label-width="formLabelWidth">
<el-input v-model="queryParam.route" placeholder="route" type="input"></el-input>
</el-form-item><el-form-item prop="method" label="method" :label-width="formLabelWidth">
<el-input v-model="queryParam.method" placeholder="method" type="input"></el-input>
</el-form-item><el-form-item prop="name" label="name" :label-width="formLabelWidth">
<el-input v-model="queryParam.name" placeholder="name" type="input"></el-input>
</el-form-item><el-form-item prop="domain" label="domain" :label-width="formLabelWidth">
<el-input v-model="queryParam.domain" placeholder="domain" type="input"></el-input>
</el-form-item><el-form-item prop="option" label="option" :label-width="formLabelWidth">
<el-input v-model="queryParam.option" placeholder="option" type="input"></el-input>
</el-form-item><el-form-item prop="pattern" label="pattern" :label-width="formLabelWidth">
<el-input v-model="queryParam.pattern" placeholder="pattern" type="input"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="handleSearch">
查询
</el-button>
</el-form-item>
</el-form>
<el-divider content-position="center"></el-divider>
<div class="filter-container">
<el-row>
<el-col :span="12">
<div class="grid-content">
<el-button class="filter-item" icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
<!-- <el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleCreate()">添加</el-button> -->
<el-button type="primary" class="filter-item" icon="el-icon-refresh" @click="sync">
同步至数据库
</el-button>
<el-button v-if="this.selectedIds.length" size="small" class="filter-item mb-5" type="danger" icon="el-icon-delete" @click="handleMultiDelete">批量删除</el-button>
<el-button @click="clearFilter">清除所有过滤器</el-button>
</div>
</el-col>
<el-col :span="12">
<el-button icon="el-icon-info" circle @click="templateVersion" style="float: right; padding: 3px 0"></el-button>
<el-dropdown @command="handleTableCommand" style="float: right; padding: 3px 0">
<span class="el-dropdown-link">
<i class="el-icon-more el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="a">配置表格</el-dropdown-item>
<el-dropdown-item command="b" divided>移除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<div class="grid-content">
<el-dropdown @command="handleDropdownCommand" style="float: right; padding: 3px 0">
<span class="el-dropdown-link">
<i class="el-icon-menu el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-checkbox-group v-model="checkList">
<el-dropdown-item command="a"><el-checkbox label="rule"></el-checkbox></el-dropdown-item><el-dropdown-item command="a"><el-checkbox label="route"></el-checkbox></el-dropdown-item><el-dropdown-item command="a"><el-checkbox label="method"></el-checkbox></el-dropdown-item><el-dropdown-item command="a"><el-checkbox label="name"></el-checkbox></el-dropdown-item><el-dropdown-item command="a"><el-checkbox label="domain"></el-checkbox></el-dropdown-item><el-dropdown-item command="a"><el-checkbox label="option"></el-checkbox></el-dropdown-item><el-dropdown-item command="a"><el-checkbox label="pattern"></el-checkbox></el-dropdown-item>
</el-checkbox-group>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-col>
</el-row>
</div>
<el-table ref="multipleTable" :data="data" tooltip-effect="dark" style="width: 100%" fit @selection-change="handleSelectMulti">
<el-table-column type="selection" width="55" v-if="true"></el-table-column>
<el-table-column prop="rule" label="rule" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="route" label="route" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="method" label="method" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="name" label="name" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="domain" label="domain" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="option" label="option" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="pattern" label="pattern" sortable="true" v-if="true"></el-table-column>
<el-table-column prop="creator" label="创建人" v-if="true"></el-table-column>
<el-table-column prop="created_at" label="创建时间" v-if="true"></el-table-column>
<el-table-column prop="updated_at" label="更新时间" v-if="true"></el-table-column>
<el-table-column label="操作" v-if="true" fixed="right">
<template slot-scope="module">
<el-button type="primary" icon="el-icon-stopwatch" @click="testApi(module.row.name)">API测试</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="paginate.current" hide-on-single-page :page-sizes="paginate.sizes" :page-size="paginate.limit" :layout="paginate.layout" :total="paginate.total"></el-pagination>
<!----------------------------------- 新增/编辑 ---------------------------------------------->
<el-drawer ref="drawer" size="60%" :title="drawerTitle" :visible.sync="formVisible" :before-close="handleClose" direction="rtl" @close="handleCancel">
<div class="demo-drawer__content">
<el-form :ref="formName" :model="formFieldsData" :rules="rules">
<el-form-item prop="rule" label="rule" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.rule" placeholder="rule" autocomplete="off" clearable type="input"></el-input>
</el-form-item><el-form-item prop="route" label="route" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.route" placeholder="route" autocomplete="off" clearable type="input"></el-input>
</el-form-item><el-form-item prop="method" label="method" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.method" placeholder="method" autocomplete="off" clearable type="input"></el-input>
</el-form-item><el-form-item prop="name" label="name" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.name" placeholder="name" autocomplete="off" clearable type="input"></el-input>
</el-form-item><el-form-item prop="domain" label="domain" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.domain" placeholder="domain" autocomplete="off" clearable type="input"></el-input>
</el-form-item><el-form-item prop="option" label="option" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.option" placeholder="option" autocomplete="off" clearable type="input"></el-input>
</el-form-item><el-form-item prop="pattern" label="pattern" :label-width="formLabelWidth">
<el-input v-model="formFieldsData.pattern" placeholder="pattern" autocomplete="off" clearable type="input"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="drawer__footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleSubmit" :loading="loading">{{ loading ? '提交中 ...' : '确 定' }}</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import formOperate from '@/layout/mixin/formOperate'
export default {
name:'apimanager_routeList',
mixins: [formOperate],
data() {
return {
url: 'routeList',
formName: 'route_list',
formLabelWidth: '120px',
// 用户搜索
queryParam: {
rule:'',route:'',method:'',name:'',domain:'',option:'',pattern:'',
},
formVisible: false,
formFieldsData: {
rule:'',route:'',method:'',name:'',domain:'',option:'',pattern:'',
},
loading: false,
checkList: [],
search: '',
drawerTitle: 'route_list',
form: {rule:'',route:'',method:'',name:'',domain:'',option:'',pattern:'', },
timer: null,
// 表单验证
rules: {
}
}
},
mounted() {},
methods: {
testApi(name) {
let api_name = name.replace(/\\/g,"\\\\") //数据库存了含反斜杠的字段查询时转义成四个反斜杠
this.$router.push({ path: "/apitester", query: { api_name} });
},
sync() {
this.$http.post('apimanager/routelist/sync').then(res => {
this.$message.success(res.message)
this.handleRefresh()
})
},
},
}
</script>

View File

@@ -0,0 +1,9 @@
export default {
// api分类
apicategory: () => import('@/views/apimanager/apicategory'),
// api测试
apitester: () => import('@/views/apimanager/apitester'),
apirun: () => import('@/views/apimanager/apirun'),
apienv: () => import('@/views/apimanager/apienv'),
apimanager_routeList: () => import('@/views/apimanager/route_list/route_list'),
}

View File

@@ -0,0 +1,83 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\controller;
use catcher\base\CatchController;
use catchAdmin\apimanager\model\ApiCategory as ApiCategoryModel;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\exceptions\FailedException;
class ApiCategory extends CatchController
{
protected $ApiCategoryModel;
public function __construct(ApiCategoryModel $ApiCategoryModel)
{
$this->ApiCategoryModel = $ApiCategoryModel;
}
/**
* 列表
* @time 2021年05月19日 15:21
* @param Request $request
*/
public function index(): \think\response\Json
{
return CatchResponse::success($this->ApiCategoryModel->getList());
}
/**
* 保存信息
* @time 2021年05月19日 15:21
* @param Request $request
*/
public function save(Request $request) : \think\response\Json
{
return CatchResponse::success($this->ApiCategoryModel->storeBy($request->post()));
}
/**
* 读取
* @time 2021年05月19日 15:21
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->ApiCategoryModel->findBy($id));
}
/**
* 更新
* @time 2021年05月19日 15:21
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\response\Json
{
return CatchResponse::success($this->ApiCategoryModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2021年05月19日 15:21
* @param $id
*/
public function delete($id) : \think\Response
{
if ($this->ApiCategoryModel->where('parent_id', $id)->find()) {
throw new FailedException('存在子分类,无法删除');
}
return CatchResponse::success($this->ApiCategoryModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,79 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\apimanager\model\ApiTester as ApiTesterModel;
use catchAdmin\apimanager\model\ApiCategory;
class ApiTester extends CatchController
{
protected $ApiTesterModel;
public function __construct(ApiTesterModel $ApiTesterModel)
{
$this->ApiTesterModel = $ApiTesterModel;
}
/**
* 列表
* @time 2021年05月20日 11:41
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->ApiTesterModel->getList());
}
/**
* 保存信息
* @time 2021年05月20日 11:41
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->ApiTesterModel->storeBy($request->post()));
}
/**
* 读取
* @time 2021年05月20日 11:41
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->ApiTesterModel->findBy($id));
}
/**
* 更新
* @time 2021年05月20日 11:41
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->ApiTesterModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2021年05月20日 11:41
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->ApiTesterModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,78 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\apimanager\model\ApiTesterLog as ApiTesterLogModel;
class ApiTesterLog extends CatchController
{
protected $ApiTesterLogModel;
public function __construct(ApiTesterLogModel $ApiTesterLogModel)
{
$this->ApiTesterLogModel = $ApiTesterLogModel;
}
/**
* 列表
* @time 2021年06月10日 19:20
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->ApiTesterLogModel->getList());
}
/**
* 保存信息
* @time 2021年06月10日 19:20
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->ApiTesterLogModel->storeBy($request->post()));
}
/**
* 读取
* @time 2021年06月10日 19:20
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->ApiTesterLogModel->findBy($id));
}
/**
* 更新
* @time 2021年06月10日 19:20
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->ApiTesterLogModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2021年06月10日 19:20
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->ApiTesterLogModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,99 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\apimanager\model\ApiTesterUserenv as ApiTesterUserenvModel;
use think\facade\Log;
class ApiTesterUserenv extends CatchController
{
protected $ApiTesterUserenvModel;
public function __construct(ApiTesterUserenvModel $ApiTesterUserenvModel)
{
$this->ApiTesterUserenvModel = $ApiTesterUserenvModel;
}
/**
* 列表
* @time 2021年05月26日 18:28
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->ApiTesterUserenvModel->getList());
}
/**
* 保存信息
* @time 2021年05月26日 18:28
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->ApiTesterUserenvModel->storeBy($request->post()));
}
/**
* 读取
* @time 2021年05月26日 18:28
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->ApiTesterUserenvModel->findBy($id));
}
/**
* 更新
* @time 2021年05月26日 18:28
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->ApiTesterUserenvModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2021年05月26日 18:28
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->ApiTesterUserenvModel->deleteBy($id));
}
/**
* 切换API环境
* @param Request $request
* @param $id
*/
public function selectAPIenv(Request $request,$id = "") : \think\Response
{
if ($id)
{
$creator_id = $request->user()->id;
$this->ApiTesterUserenvModel->update(['selected' => 0], ['creator_id' => $creator_id]); //全不选
$res = $this->ApiTesterUserenvModel->update(['selected' => 1], ['id' => $id]); //选中当前
//设置为管理员当前选中的applet
if($res){
return CatchResponse::success($res,'切换API环境成功');
}
}
return CatchResponse::fail('切换API环境错误');
}
}

View File

@@ -0,0 +1,93 @@
<?php
namespace catchAdmin\apimanager\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\apimanager\repository\RouteListRepository as RouteListModel;
use think\Response;
class RouteList extends CatchController
{
protected $routeListModel;
/**
*
* @time 2021/11/11 17:47
* @param RouteListModel $routeListModel
* @return mixed
*/
public function __construct(RouteListModel $routeListModel)
{
$this->routeListModel = $routeListModel;
}
/**
*
* @time 2021/11/11 17:47
* @return Response
*/
public function index() : Response
{
return CatchResponse::paginate($this->routeListModel->getList());
}
/**
*
* @time 2021/11/11 17:47
* @param Request $request
* @return Response
*/
public function save(Request $request) : Response
{
return CatchResponse::success($this->routeListModel->storeBy($request->post()));
}
/**
*
* @time 2021/11/11 17:47
* @param $id
* @return Response
*/
public function read($id) : Response
{
return CatchResponse::success($this->routeListModel->findBy($id));
}
/**
*
* @time 2021/11/11 17:47
* @param $id
* @param Request $request
* @return Response
*/
public function update($id, Request $request) : Response
{
return CatchResponse::success($this->routeListModel->updateBy($id, $request->post()));
}
/**
*
* @time 2021/11/11 17:47
* @param $id
* @return Response
*/
public function delete($id) : Response
{
return CatchResponse::success($this->routeListModel->deleteBy($id));
}
/**
* 同步
*
* @time 2021/11/11 17:47
* @return \think\response\Json
* @throws \Exception
*/
public function sync()
{
return CatchResponse::success($this->routeListModel->sync());
}
}

View File

@@ -0,0 +1,45 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class ApiCategory extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('api_category', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => 'API分类' ,'id' => 'id' ,'primary_key' => ['id']]);
$table->addColumn('category_title', 'string', ['limit' => 64,'null' => false,'default' => '','signed' => true,'comment' => '分类标题',])
->addColumn('parent_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '父级ID',])
->addColumn('category_name', 'string', ['limit' => 128,'null' => false,'default' => '','signed' => true,'comment' => '分类唯一标识',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '状态:1=正常;2=停用',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '排序字段',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除字段',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addIndex(['category_name'], ['unique' => true,'name' => 'api_category_category_name'])
->create();
}
}

View File

@@ -0,0 +1,60 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class ApiTester extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('api_tester', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => 'api测试表' ,'id' => 'id' ,'primary_key' => ['id']]);
$table->addColumn('api_title', 'string', ['limit' => 128,'null' => false,'default' => '新建接口','signed' => true,'comment' => '标题',])
->addColumn('api_name', 'string', ['limit' => 128,'null' => false,'default' => '','signed' => true,'comment' => '英文唯一标识',])
->addColumn('category_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '分类',])
->addColumn('type', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '数据源类型:1=remote,2=local',])
->addColumn('appid', 'string', ['limit' => 64,'null' => true,'signed' => true,'comment' => 'appid',])
->addColumn('project_id', 'string', ['limit' => 64,'null' => true,'signed' => true,'comment' => '项目ID',])
->addColumn('api_url', 'string', ['limit' => 512,'null' => false,'default' => 'https://127.0.0.1','signed' => true,'comment' => 'API URL',])
->addColumn('methods', 'string', ['limit' => 128,'null' => false,'default' => 'POST','signed' => true,'comment' => '方法:POST,GET,PUT,PATCH,DELETE,COPY,HEAD,OPTIONS',])
->addColumn('auth', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '鉴权',])
->addColumn('header', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => 'header',])
->addColumn('query', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => 'query',])
->addColumn('body', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => 'body',])
->addColumn('doc_url', 'string', ['limit' => 512,'null' => true,'signed' => true,'comment' => '文档URL',])
->addColumn('document', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '文档',])
->addColumn('sample_data', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '示例数据',])
->addColumn('sample_result', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '示例返回数据',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '排序',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '状态:1=已完成,2=待开发,3=开发中,4=已废弃',])
->addColumn('content_type', 'string', ['limit' => 128,'null' => false,'default' => 'application/x-www-form-urlencoded','signed' => true,'comment' => 'content-type:application/x-www-form-urlencoded,multipart/form-data,raw',])
->addColumn('env_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '环境ID',])
->addColumn('memo', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '备注',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除字段',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->create();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class ApiTesterUserenv extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('api_tester_userenv', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => 'API测试用户环境' ,'id' => 'id' ,'primary_key' => ['id']]);
$table->addColumn('env_name', 'string', ['limit' => 128,'null' => false,'default' => '','signed' => true,'comment' => '环境名称',])
->addColumn('appid', 'string', ['limit' => 64,'null' => false,'default' => '','signed' => true,'comment' => 'appid',])
->addColumn('project_id', 'string', ['limit' => 64,'null' => false,'default' => '','signed' => true,'comment' => '项目ID',])
->addColumn('env_json', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => false,'signed' => true,'comment' => '环境变量json',])
->addColumn('selected', 'boolean', ['null' => false,'default' => 0,'signed' => true,'comment' => '是否当前选中:0=否,1=是',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除字段',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class ApiTesterLog extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('api_tester_log', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => 'API测试记录' ,'id' => 'id' ,'primary_key' => ['id']]);
$table->addColumn('appid', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => 'appid',])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'users表id',])
->addColumn('api_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'api_tester表id',])
->addColumn('params', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => 'api参数',])
->addColumn('result', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '返回值',])
->addColumn('request_data', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '请求数据',])
->addColumn('response_data', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '响应数据',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除字段',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->create();
}
}

View File

@@ -0,0 +1,48 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class RouteList extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('route_list', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '路由表' ,'id' => 'id' ,'primary_key' => ['id']]);
$table->addColumn('rule', 'string', ['limit' => 128,'null' => true,'signed' => true,'comment' => 'rule',])
->addColumn('route', 'string', ['limit' => 256,'null' => true,'signed' => true,'comment' => 'route',])
->addColumn('method', 'string', ['limit' => 16,'null' => true,'signed' => true,'comment' => 'method',])
->addColumn('name', 'string', ['limit' => 256,'null' => true,'signed' => true,'comment' => 'name',])
->addColumn('domain', 'string', ['limit' => 128,'null' => true,'signed' => true,'comment' => 'domain',])
->addColumn('option', 'string', ['limit' => 256,'null' => true,'signed' => true,'comment' => 'option',])
->addColumn('pattern', 'string', ['limit' => 128,'null' => true,'signed' => true,'comment' => 'pattern',])
->addColumn('title', 'string', ['limit' => 128,'null' => true,'signed' => true,'comment' => 'title',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除字段',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addIndex(['name'], ['unique' => true,'name' => 'route_list_name'])
->create();
}
}

View File

@@ -0,0 +1,98 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
use think\migration\Seeder;
class ApiCategorySeed extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run(): void
{
$data = array (
0 =>
array (
'id' => 1,
'category_title' => '微信第三方平台',
'parent_id' => 0,
'category_name' => 'wechatopen',
'status' => 1,
'sort' => 1,
'created_at' => 1621414770,
'updated_at' => 1621414770,
'deleted_at' => 0,
'creator_id' => 1,
),
1 =>
array (
'id' => 2,
'category_title' => '微信交易组件标准版',
'parent_id' => 1,
'category_name' => 'MiniShop_Base',
'status' => 1,
'sort' => 1,
'created_at' => 1621415897,
'updated_at' => 1621415897,
'deleted_at' => 0,
'creator_id' => 1,
),
2 =>
array (
'id' => 3,
'category_title' => '腾讯AI开放平台',
'parent_id' => 0,
'category_name' => 'tencentAI',
'status' => 1,
'sort' => 1,
'created_at' => 1621493345,
'updated_at' => 1621493345,
'deleted_at' => 0,
'creator_id' => 1,
),
3 =>
array (
'id' => 4,
'category_title' => '批量代云开发',
'parent_id' => 1,
'category_name' => 'componenttcb',
'status' => 1,
'sort' => 1,
'created_at' => 1621494287,
'updated_at' => 1621494287,
'deleted_at' => 0,
'creator_id' => 1,
),
4 =>
array (
'id' => 5,
'category_title' => '本地接口',
'parent_id' => 0,
'category_name' => 'local',
'status' => 1,
'sort' => 2,
'created_at' => 1621494287,
'updated_at' => 1621494287,
'deleted_at' => 0,
'creator_id' => 1,
),
);
foreach ($data as $item) {
\catchAdmin\apimanager\model\ApiCategory::create($item);
}
}
}

View File

@@ -0,0 +1,785 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
use think\migration\Seeder;
class ApiTesterSeed extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run(): void
{
$data = array (
0 =>
array (
'id' => 1,
'api_title' => '获取类目详情',
'api_name' => 'product/category/get',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/category/get',
'methods' => 'POST',
'auth' => NULL,
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/cat/get_cat_list.html',
'document' => '参考文档url',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 2,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => NULL,
'created_at' => 1621484754,
'updated_at' => 1622461634,
'deleted_at' => 0,
'creator_id' => 1,
),
1 =>
array (
'id' => 2,
'api_title' => '获取品牌列表',
'api_name' => 'product/brand/get',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/brand/get',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/cat/get_brand.html',
'document' => '详见文档url地址',
'sample_data' => '无',
'sample_result' => '返回',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => NULL,
'created_at' => 1621485017,
'updated_at' => 1622378856,
'deleted_at' => 0,
'creator_id' => 1,
),
2 =>
array (
'id' => 3,
'api_title' => '登录日志',
'api_name' => '/log/login',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/log/login',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '',
'doc_url' => 'http://apidoc.catchadmin.com/web/#/5?page_id=23',
'document' => '无',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621598744,
'updated_at' => 1622965477,
'deleted_at' => 0,
'creator_id' => 1,
),
3 =>
array (
'id' => 4,
'api_title' => '操作日志',
'api_name' => 'log/operate',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/log/operate',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '',
'doc_url' => 'http://apidoc.catchadmin.com/web/#/5?page_id=53',
'document' => '无',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621598935,
'updated_at' => 1622965460,
'deleted_at' => 0,
'creator_id' => 1,
),
4 =>
array (
'id' => 5,
'api_title' => '获取运费模板',
'api_name' => 'product/delivery/get_freight_template',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/delivery/get_freight_template',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '',
'doc_url' => 'https://developers.weixin.qq.com/doc/ministore/minishopopencomponent/API/cat/get_freight_template.html',
'document' => '详见文档URL',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621599469,
'updated_at' => 1622378826,
'deleted_at' => 0,
'creator_id' => 1,
),
5 =>
array (
'id' => 6,
'api_title' => '获取店铺的商品分类',
'api_name' => 'product/store/get_shopcat',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/store/get_shopcat',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/store/get_shopcat.html',
'document' => '参考文档url',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621762669,
'updated_at' => 1622378816,
'deleted_at' => 0,
'creator_id' => 1,
),
6 =>
array (
'id' => 7,
'api_title' => '添加商品',
'api_name' => 'product/spu/add',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/spu/add',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '{
"out_product_id": "1234566",
"title": "任天堂 Nintendo Switch 国行续航增强版 NS家用体感游戏机掌机 便携掌上游戏机 红蓝主机",
"sub_title": "JD自营更放心】【国行Switch更安心的保修服务更快的国行服务器】一台主机三种模式游戏掌机随时随地一起趣玩。",
"head_img":
[
"http://img10.360buyimg.com/n1/s450x450_jfs/t1/85865/39/13611/488083/5e590a40E4bdf69c0/55c9bf645ea2b727.jpg"
],
"desc_info":
{
"imgs":
[
"http://img10.360buyimg.com/n1/s450x450_jfs/t1/85865/39/13611/488083/5e590a40E4bdf69c0/55c9bf645ea2b727.jpg"
]
},
"brand_id": 2100000000,
"cats":
[
{
"cat_id": 6033,
"level": 1
},
{
"cat_id": 6057,
"level": 2
},
{
"cat_id": 6091,
"level": 3
}
],
"attrs":
[
{
"attr_key": "商品毛重",
"attr_value": "380g"
},
{
"attr_key": "商品产地",
"attr_value": "中国大陆"
}
],
"model": "国行续航增强版",
"express_info":
{
"template_id": 5189
},
"skus":
[
{
"out_product_id": "1234566",
"out_sku_id": "1024",
"thumb_img": "http://img10.360buyimg.com/n1/s450x450_jfs/t1/100778/17/13648/424215/5e590a40E2d68e774/e171d222a0c9b763.jpg",
"sale_price": 1300,
"market_price": 1500,
"stock_num": 100,
"sku_code": "A24525252",
"barcode": "13251454",
"sku_attrs":
[
{
"attr_key": "选择颜色",
"attr_value": "红蓝主机"
},
{
"attr_key": "选择套装",
"attr_value": "主机+保护套"
}
]
}
]
}',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/spu/add_spu.html',
'document' => '参考文档url',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621764682,
'updated_at' => 1622378805,
'deleted_at' => 0,
'creator_id' => 1,
),
7 =>
array (
'id' => 8,
'api_title' => '获取商品',
'api_name' => 'product/spu/get',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/spu/get',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '{\'product_id\':\'31334398\'}',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/spu/get_spu.html',
'document' => '参考文档URL',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621774347,
'updated_at' => 1622378781,
'deleted_at' => 0,
'creator_id' => 1,
),
8 =>
array (
'id' => 9,
'api_title' => '获取商品列表',
'api_name' => 'product/spu/get_list',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/spu/get_list',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '{"status":5}',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/spu/get_spu_list.html',
'document' => '参考文档URL',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1621777668,
'updated_at' => 1622378754,
'deleted_at' => 0,
'creator_id' => 1,
),
9 =>
array (
'id' => 10,
'api_title' => '搜索商品',
'api_name' => 'product/spu/search',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/spu/search',
'methods' => 'POST',
'auth' => NULL,
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '{\'status\':5,\'keyword\':\'UI\',\'page\':1}',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/spu/search_spu.html',
'document' => '参考文档url',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 1,
'memo' => NULL,
'created_at' => 1622000389,
'updated_at' => 1622378719,
'deleted_at' => 0,
'creator_id' => 1,
),
10 =>
array (
'id' => 11,
'api_title' => '上架商品',
'api_name' => 'product/spu/listing',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/spu/listing',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '{\'product_id\':\'33541981\'}',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/spu/up_spu_listing.html',
'document' => '参考文档URL',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622019456,
'updated_at' => 1622378710,
'deleted_at' => 0,
'creator_id' => 1,
),
11 =>
array (
'id' => 12,
'api_title' => '下架商品',
'api_name' => 'product/spu/delisting',
'category_id' => 2,
'type' => 1,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/api/wechatopen/product/spu/delisting',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{"appid":"{{appid}}"}',
'body' => '{\'product_id\':33541981}',
'doc_url' => 'https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/spu/up_spu_delisting.html',
'document' => '参考文档URL',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622019791,
'updated_at' => 1622378701,
'deleted_at' => 0,
'creator_id' => 1,
),
12 =>
array (
'id' => 13,
'api_title' => 'API测试用户环境新增',
'api_name' => 'ApiTesterUserenv/save',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/apiTesterUserenv',
'methods' => 'POST',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '{\'env_name\':\'api.server.local\',\'appid\':\'wx407e\',\'project_id\':1,\'selected\':0}',
'doc_url' => '无',
'document' => '新增一条API测试用户环境数据',
'sample_data' => '{\'env_name\':\'appapi.uctoo.local\',\'appid\':\'wx407e\',\'project_id\':1,\'env_json\':\'{"{{host}}":"api.server.local","{{appid}}":"wx407e","{{authorization}}":"BearereyJ0eXA"}\',\'selected\':0}',
'sample_result' => '无',
'sort' => 1,
'status' => 4,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 1,
'memo' => '',
'created_at' => 1622030621,
'updated_at' => 1622965370,
'deleted_at' => 0,
'creator_id' => 1,
),
13 =>
array (
'id' => 14,
'api_title' => 'API测试用户环境列表',
'api_name' => 'apiTesterUserenv/index',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/apiTesterUserenv',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{\'creator\':\'admin\'}',
'body' => '',
'doc_url' => '无',
'document' => 'API测试用户环境列表。可以按用户名检索环境列表在query部分增加creator筛选字段。',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622031131,
'updated_at' => 1622965325,
'deleted_at' => 0,
'creator_id' => 1,
),
14 =>
array (
'id' => 15,
'api_title' => 'API测试用户环境更新',
'api_name' => 'apiTesterUserenv/update',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/apiTesterUserenv/3',
'methods' => 'PUT',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '{\'selected\':1}',
'doc_url' => '无',
'document' => 'API地址http://127.0.0.1/apiTesterUserenv/{id}
id为数据主键。body部分为要更新的字段。',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622033581,
'updated_at' => 1622965309,
'deleted_at' => 0,
'creator_id' => 1,
),
15 =>
array (
'id' => 16,
'api_title' => '微应用列表',
'api_name' => 'applet/index',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/applet',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '{\'creator\':\'demo\'}',
'body' => '',
'doc_url' => '无',
'document' => '可在query字段用creator用户名、name应用名称、appid字段进行筛选。',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622083381,
'updated_at' => 1622965295,
'deleted_at' => 0,
'creator_id' => 1,
),
16 =>
array (
'id' => 17,
'api_title' => '设置选中微应用',
'api_name' => 'applet/setapplet/<id>',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/applet/setapplet/1',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '',
'doc_url' => '无',
'document' => '<id>参数为数据主键',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622085296,
'updated_at' => 1622965277,
'deleted_at' => 0,
'creator_id' => 1,
),
17 =>
array (
'id' => 18,
'api_title' => '获取当前选中应用',
'api_name' => 'admin/applet/<creator_id>',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/admin/applet/1',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '',
'doc_url' => '无',
'document' => '<creator_id>参数是后台用户主键ID',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622097323,
'updated_at' => 1622965263,
'deleted_at' => 0,
'creator_id' => 1,
),
18 =>
array (
'id' => 19,
'api_title' => '切换API环境',
'api_name' => 'apiTesterUserenv/selectAPIenv/<id>',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/apiTesterUserenv/selectAPIenv/1',
'methods' => 'GET',
'auth' => '',
'header' => '{"authorization":"{{authorization}}"}',
'query' => '',
'body' => '',
'doc_url' => '无',
'document' => '<id>为API环境数据主键',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622176574,
'updated_at' => 1622965231,
'deleted_at' => 0,
'creator_id' => 1,
),
19 =>
array (
'id' => 20,
'api_title' => '帐号登录',
'api_name' => 'login',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/login',
'methods' => 'POST',
'auth' => '',
'header' => '',
'query' => '',
'body' => '{"email":"catch@admin.com","password":"catchadmin"}',
'doc_url' => 'http://apidoc.catchadmin.com/web/#/5?page_id=24',
'document' => '无',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/json; charset=utf-8',
'env_id' => 0,
'memo' => '',
'created_at' => 1622429937,
'updated_at' => 1622460840,
'deleted_at' => 0,
'creator_id' => 1,
),
20 =>
array (
'id' => 21,
'api_title' => '微信扫码登录后获取后台帐号',
'api_name' => 'wechatlogin/wechatoauth',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/wechatlogin/wechatoauth',
'methods' => 'GET',
'auth' => '',
'header' => '',
'query' => '{"code":"0712VE1"}',
'body' => '',
'doc_url' => 'https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html',
'document' => '微信扫码登录后,在跳转到的页面需要先调用此接口获取微信用户关联的后台管理员帐号列表。根据此接口返回的帐号列表信息,展示帐号名,用户可以点选登录对应帐号。如此接口返回空值,则展示用户注册后台帐号页面。
Query参数
必填参数
code微信扫码登录后微信服务器通知跳转到redirect_url时添加的code参数用于获取微信用户access_token
非必填参数
state扫码登录时添加的随机验证字符串。前端自定义。前端自验证。
返回值accountList 包含扫码登录后获得的 openidaccess_token以及关联的后台帐号列表
',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/x-www-form-urlencoded',
'env_id' => 0,
'memo' => '',
'created_at' => 1622539671,
'updated_at' => 1622709792,
'deleted_at' => 0,
'creator_id' => 1,
),
21 =>
array (
'id' => 22,
'api_title' => '扫码登录后注册用户帐号',
'api_name' => 'wechatlogin/wechatregist',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/wechatlogin/wechatregist',
'methods' => 'POST',
'auth' => '',
'header' => '',
'query' => '',
'body' => '{"username":"13688888888","password":"123456","email":"demo@uctoo.com","openid":"openid","access_token":"access_token"}',
'doc_url' => '无',
'document' => 'openid和access_token是微信扫码登录后获取到的值用于调用帐号注册接口权限验证。
username建议采用用户手机号码并进行短信验证。
password建议校验密码复杂度。
email建议进行邮箱验证。可作为密码找回方式之一。',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/json; charset=utf-8',
'env_id' => 0,
'memo' => '',
'created_at' => 1622710277,
'updated_at' => 1622876680,
'deleted_at' => 0,
'creator_id' => 1,
),
22 =>
array (
'id' => 23,
'api_title' => '微信扫码登录后选择帐号登录',
'api_name' => 'wechatlogin/wechatlogin',
'category_id' => 5,
'type' => 2,
'appid' => '',
'project_id' => '',
'api_url' => '{{host}}/wechatlogin/wechatlogin',
'methods' => 'POST',
'auth' => '',
'header' => '',
'query' => '',
'body' => '{"email":"demo@uctoo.com","openid":"openid","access_token":"access_token","password":"any"}',
'doc_url' => '无',
'document' => '微信扫码后,选择帐号登录。
openid和access_token是在扫码授权后获得。
password参数必须传可以是任意值不做验证。',
'sample_data' => '无',
'sample_result' => '无',
'sort' => 1,
'status' => 1,
'content_type' => 'application/json; charset=utf-8',
'env_id' => 0,
'memo' => '',
'created_at' => 1622713987,
'updated_at' => 1622876660,
'deleted_at' => 0,
'creator_id' => 1,
),
);
foreach ($data as $item) {
\catchAdmin\apimanager\model\ApiTester::create($item);
}
}
}

View File

@@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
use think\migration\Seeder;
class ApiTesterUserenvSeed extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run(): void
{
$data = array (
0 =>
array (
'id' => 1,
'env_name' => 'localhost',
'appid' => 'wx407e4',
'project_id' => '1',
'env_json' => '{"{{host}}":"http://127.0.0.1:8000","{{status}}":"5","{{appid}}":"wx407","{{authorization}}":"Bearer{{手动替换为login接口的token}}"}',
'selected' => 1,
'created_at' => 1622029539,
'updated_at' => 1622386890,
'deleted_at' => 0,
'creator_id' => 1,
),
1 =>
array (
'id' => 2,
'env_name' => 'api.server.local',
'appid' => 'wx407',
'project_id' => '1',
'env_json' => '{"{{host}}":"http://api.server.local"}',
'selected' => 0,
'created_at' => 1622030904,
'updated_at' => 1622386890,
'deleted_at' => 0,
'creator_id' => 1,
),
);
foreach ($data as $item) {
\catchAdmin\apimanager\model\ApiTesterUserenv::create($item);
}
}
}

View File

@@ -0,0 +1,460 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
use think\migration\Seeder;
class ApimanagerMenusSeed extends Seeder {
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run(): void
{
\catcher\Utils::importTreeData($this->getPermissions(), 'permissions', 'parent_id');
}
protected function getPermissions() {
return [
0 => [
'id' => 143,
'permission_name' => 'API管理',
'parent_id' => 0,
'level' => '',
'route' => '/apimanager',
'icon' => 'el-icon-sort',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apimanager',
'component' => 'layout',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621425807,
'updated_at' => 1621427128,
'deleted_at' => 0,
'children' => [
0 => [
'id' => 144,
'permission_name' => 'API分类',
'parent_id' => 143,
'level' => '',
'route' => '/apicategory',
'icon' => 'el-icon-s-grid',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apicategory',
'component' => 'apicategory',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 10,
'created_at' => 1621413029,
'updated_at' => 1624010103,
'deleted_at' => 0,
'children' => [
0 => [
'id' => 151,
'permission_name' => '列表',
'parent_id' => 144,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apicategory@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779121,
'updated_at' => 1624010103,
'deleted_at' => 0,
],
1 => [
'id' => 152,
'permission_name' => '创建',
'parent_id' => 144,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apicategory@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779137,
'updated_at' => 1624010103,
'deleted_at' => 0,
],
2 => [
'id' => 153,
'permission_name' => '更新',
'parent_id' => 144,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apicategory@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779154,
'updated_at' => 1624010103,
'deleted_at' => 0,
],
3 => [
'id' => 154,
'permission_name' => '读取',
'parent_id' => 144,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apicategory@read',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779171,
'updated_at' => 1624010103,
'deleted_at' => 0,
],
4 => [
'id' => 155,
'permission_name' => '删除',
'parent_id' => 144,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apicategory@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779186,
'updated_at' => 1624010103,
'deleted_at' => 0,
],
],
],
1 => [
'id' => 145,
'permission_name' => 'API测试列表',
'parent_id' => 143,
'level' => '',
'route' => '/apitester',
'icon' => 'el-icon-stopwatch',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apitester',
'component' => 'apitester',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621479275,
'updated_at' => 1624010086,
'deleted_at' => 0,
'children' => [
0 => [
'id' => 146,
'permission_name' => '列表',
'parent_id' => 145,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apitester@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621778966,
'updated_at' => 1624010086,
'deleted_at' => 0,
],
1 => [
'id' => 147,
'permission_name' => '创建',
'parent_id' => 145,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apitester@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779011,
'updated_at' => 1624010086,
'deleted_at' => 0,
],
5 => [
'id' => 148,
'permission_name' => '更新',
'parent_id' => 145,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apitester@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779033,
'updated_at' => 1624010086,
'deleted_at' => 0,
],
2 => [
'id' => 149,
'permission_name' => '读取',
'parent_id' => 145,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apitester@read',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779051,
'updated_at' => 1624010086,
'deleted_at' => 0,
],
3 => [
'id' => 150,
'permission_name' => '删除',
'parent_id' => 145,
'level' => '',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apitester@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621779083,
'updated_at' => 1624010086,
'deleted_at' => 0,
],
],
],
2 => [
'id' => 156,
'permission_name' => 'API运行',
'parent_id' => 143,
'level' => '',
'route' => '/apimanager/apirun',
'icon' => 'el-icon-position',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apirun',
'component' => 'apirun',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 2,
'sort' => 1,
'created_at' => 1621798022,
'updated_at' => 1621831249,
'deleted_at' => 0,
],
3 => [
'id' => 161,
'permission_name' => 'API环境变量',
'parent_id' => 143,
'level' => '',
'route' => '/apienv',
'icon' => 'el-icon-setting',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'apienv',
'component' => 'apienv',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622176953,
'updated_at' => 1622177106,
'deleted_at' => 0,
],
4 => [
'id' => 281,
'permission_name' => '路由列表',
'parent_id' => 143,
'level' => '143',
'route' => '/apimanager/routeList/curd',
'icon' => 'el-icon-link',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'routeList',
'component' => 'apimanager_routeList',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 0,
'created_at' => 1636624116,
'updated_at' => 1636689266,
'deleted_at' => 0,
'children' => [
0 => [
'id' => 282,
'permission_name' => '列表',
'parent_id' => 281,
'level' => '143-281',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'routeList@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1636624117,
'updated_at' => 1636689266,
'deleted_at' => 0,
],
1 => [
'id' => 283,
'permission_name' => '保存',
'parent_id' => 281,
'level' => '143-281',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'routeList@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1636624117,
'updated_at' => 1636689266,
'deleted_at' => 0,
],
2 => [
'id' => 284,
'permission_name' => '读取',
'parent_id' => 281,
'level' => '143-281',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'routeList@read',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1636624118,
'updated_at' => 1636689266,
'deleted_at' => 0,
],
3 => [
'id' => 285,
'permission_name' => '更新',
'parent_id' => 281,
'level' => '143-281',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'routeList@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1636624118,
'updated_at' => 1636689266,
'deleted_at' => 0,
],
4 => [
'id' => 286,
'permission_name' => '删除',
'parent_id' => 281,
'level' => '143-281',
'route' => '',
'icon' => '',
'module' => 'apimanager',
'creator_id' => 1,
'permission_mark' => 'routeList@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1636624119,
'updated_at' => 1636689266,
'deleted_at' => 0,
],
],
],
],
],
];
}
}

View File

@@ -0,0 +1,92 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model;
use catchAdmin\apimanager\model\search\ApiCategorySearch;
use catcher\base\CatchModel as Model;
use think\db\exception\DbException;
/**
*
* @property int $id
* @property string $category_title
* @property int $parent_id
* @property string $category_name
* @property int $status
* @property int $sort
* @property int $created_at
* @property int $updated_at
* @property int $deleted_at
* @property int $creator_id
*/
class ApiCategory extends Model
{
use ApiCategorySearch;
// 表名
public $name = 'api_category';
// 数据库字段映射
public $field = array(
'id',
// 分类标题
'category_title',
// 父级ID
'parent_id',
// 分类唯一标识
'category_name',
// 状态:1=正常;2=停用
'status',
// 排序字段
'sort',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除字段
'deleted_at',
// 创建人ID
'creator_id',
);
protected $updateChildrenFields = 'status';
/**
* 列表数据
*
* @time 2020年01月09日
* @return array
* @throws DbException
*/
public function getList(): array
{
return $this->catchSearch()
->catchOrder()
->select()->toTree();
}
/**
* 获取子分类IDS
*
* @time 2020年11月04日
* @param $id
* @throws DbException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @return mixed
*/
public static function getChildrenCategoryIds($id)
{
$categoryIds = ApiCategory::field(['id', 'parent_id'])->select()->getAllChildrenIds([$id]);
$categoryIds[] = $id;
return $categoryIds;
}
}

View File

@@ -0,0 +1,104 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model;
use catcher\base\CatchModel as Model;
use catchAdmin\apimanager\model\search\ApiTesterSearch;
/**
*
* @property int $id
* @property string $api_title
* @property string $api_name
* @property int $category_id
* @property int $type
* @property string $appid
* @property string $project_id
* @property string $api_url
* @property string $methods
* @property string $auth
* @property string $header
* @property string $query
* @property string $body
* @property string $doc_url
* @property string $document
* @property string $sample_data
* @property string $sample_result
* @property int $sort
* @property int $status
* @property string $content_type
* @property int $env_id
* @property string $memo
* @property int $created_at
* @property int $updated_at
* @property int $deleted_at
* @property int $creator_id
*/
class ApiTester extends Model
{
use ApiTesterSearch;
// 表名
public $name = 'api_tester';
// 数据库字段映射
public $field = array(
'id',
// 标题
'api_title',
// 英文唯一标识
'api_name',
// 分类
'category_id',
// 数据源类型:1=remote,2=local
'type',
// appid
'appid',
// 项目ID
'project_id',
// API URL
'api_url',
// 方法:POST,GET,PUT,PATCH,DELETE,COPY,HEAD,OPTIONS
'methods',
// 鉴权
'auth',
// header
'header',
// query
'query',
// body
'body',
// 文档URL
'doc_url',
// 文档
'document',
// 示例数据
'sample_data',
// 示例返回数据
'sample_result',
// 排序
'sort',
// 状态:1=已完成,2=待开发,3=开发中,4=已废弃
'status',
// content-type:application/x-www-form-urlencoded,multipart/form-data,raw
'content_type',
// 环境ID
'env_id',
// 备注
'memo',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除字段
'deleted_at',
// 创建人ID
'creator_id',
);
}

View File

@@ -0,0 +1,60 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model;
use catcher\base\CatchModel as Model;
/**
*
* @property int $id
* @property string $appid
* @property int $user_id
* @property int $api_id
* @property string $params
* @property string $result
* @property string $request_data
* @property string $response_data
* @property int $created_at
* @property int $updated_at
* @property int $deleted_at
* @property int $creator_id
*/
class ApiTesterLog extends Model
{
// 表名
public $name = 'api_tester_log';
// 数据库字段映射
public $field = array(
'id',
// appid
'appid',
// users表id
'user_id',
// api_tester表id
'api_id',
// api参数
'params',
// 返回值
'result',
// 请求数据
'request_data',
// 响应数据
'response_data',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除字段
'deleted_at',
// 创建人ID
'creator_id',
);
}

View File

@@ -0,0 +1,76 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model;
use catchAdmin\permissions\model\DataRangScopeTrait;
use catchAdmin\permissions\model\Users;
use catchAdmin\apimanager\model\search\ApiTesterUserenvSearch;
use catcher\base\CatchModel as Model;
/**
*
* @property int $id
* @property string $env_name
* @property string $appid
* @property string $project_id
* @property string $env_json
* @property int $selected
* @property int $created_at
* @property int $updated_at
* @property int $deleted_at
* @property int $creator_id
*/
class ApiTesterUserenv extends Model
{
use ApiTesterUserenvSearch;
use DataRangScopeTrait;
// 表名
public $name = 'api_tester_userenv';
// 数据库字段映射
public $field = array(
'id',
// 环境名称
'env_name',
// appid
'appid',
// 项目ID
'project_id',
// 环境变量json
'env_json',
// 是否当前选中:0=否,1=是
'selected',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除字段
'deleted_at',
// 创建人ID
'creator_id',
);
/**
* get list
*
* @time 2020年04月28日
* @param $params
* @throws \think\db\exception\DbException
* @return void
*/
public function getList()
{
return $this->dataRange()->field([$this->aliasField('*')])
->catchJoin(Users::class, 'id', 'creator_id', ['username as creator'])
->catchSearch()
->order($this->aliasField('id'), 'desc')
->paginate();
}
}

View File

@@ -0,0 +1,66 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model;
use catchAdmin\apimanager\model\search\RouteListSearch;
use catcher\base\CatchModel as Model;
/**
*
* @property int $id
* @property string $rule
* @property string $route
* @property string $method
* @property string $name
* @property string $domain
* @property string $option
* @property string $pattern
* @property string $title
* @property int $created_at
* @property int $updated_at
* @property int $deleted_at
* @property int $creator_id
*/
class RouteList extends Model
{
use RouteListSearch;
public $field = [
//
'id',
//
'rule',
//
'route',
//
'method',
//
'name',
//
'domain',
//
'option',
//
'pattern',
//
'title',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除字段
'deleted_at',
// 创建人ID
'creator_id',
];
public $name = 'route_list';
}

View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model\search;
trait ApiCategorySearch
{
public function searchCategoryTitleAttr($query, $value, $data)
{
return $query->whereLike('category_title', $value);
}
public function searchStatusAttr($query, $value, $data)
{
return $query->where('status', $value);
}
}

View File

@@ -0,0 +1,54 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model\search;
use catchAdmin\apimanager\model\ApiCategory;
trait ApiTesterSearch
{
public function searchApiTitleAttr($query, $value, $data)
{
return $query->whereLike('api_title', $value);
}
public function searchApiNameAttr($query, $value, $data)
{
return $query->whereLike('api_name', $value);
}
public function searchStatusAttr($query, $value, $data)
{
return $query->where($this->aliasField('status'), $value);
}
public function searchTypeAttr($query, $value, $data)
{
return $query->where($this->aliasField('type'), $value);
}
/**
* 查询分类下的API
*
* @time 2021年05月20日
* @param $query
* @param $value
* @param $data
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @return mixed
*/
public function searchCategoryIdAttr($query, $value, $data)
{
return $query->whereIn($this->aliasField('category_id'), ApiCategory::getChildrenCategoryIds($value));
}
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model\search;
use catchAdmin\permissions\model\Users;
trait ApiTesterUserenvSearch
{
public function searchCreatorAttr($query, $value, $data)
{
return $query->whereLike(app(Users::class)->getTable() . '.username', $value);
}
public function searchEnvNameAttr($query, $value, $data)
{
return $query->whereLike('env_name', $value);
}
}

View File

@@ -0,0 +1,50 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\model\search;
use catchAdmin\apimanager\model\ApiCategory;
trait RouteListSearch
{
public function searchRuleAttr($query, $value, $data)
{
return $query->whereLike('rule', $value);
}
public function searchRouteAttr($query, $value, $data)
{
return $query->whereLike('route', $value);
}
public function searchMethodAttr($query, $value, $data)
{
return $query->whereLike('method', $value);
}
public function searchNameAttr($query, $value, $data)
{
return $query->whereLike('name', $value);
}
public function searchDomainAttr($query, $value, $data)
{
return $query->whereLike('domain', $value);
}
public function searchOptionAttr($query, $value, $data)
{
return $query->whereLike('option', $value);
}
public function searchPatternAttr($query, $value, $data)
{
return $query->whereLike('pattern', $value);
}
}

View File

@@ -0,0 +1,17 @@
{
"name": "API管理",
"alias": "apimanager",
"description": "UCToo API管理",
"version": "1.0.0",
"keywords": [
"API"
],
"order": 0,
"services": [
"\\catchAdmin\\apimanager\\ApimanagerService"
],
"aliases": [],
"files": [],
"requires": [],
"enable": true
}

View File

@@ -0,0 +1,66 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\repository;
use catchAdmin\permissions\middleware\PermissionsMiddleware;
use catchAdmin\apimanager\model\RouteList;
use catcher\base\CatchRepository;
use catcher\exceptions\FailedException;
use think\facade\Console;
use think\facade\Log;
use think\facade\Db;
class RouteListRepository extends CatchRepository
{
protected $routeList;
public function __construct(RouteList $routeList)
{
$this->routeList = $routeList;
}
protected function model()
{
return $this->routeList;
}
public function all()
{
$routeList = $this->routeList->select();
return $routeList->toArray();
}
/**
* 同步
*
* @time 2020年06月26日
* @throws \Exception
* @return bool
*/
public function sync()
{
DB::table('route_list')->delete(true);
Console::call('route:list', ['-m']); //没用也不是从命令生成的route_list文件读的数据就是想执行一下命令
$routeList = app()->route->getRuleList();
$rows = [];
foreach ($routeList as $item) {
$item['route'] = $item['route'] instanceof \Closure ? '<Closure>' : $item['route'];
$item['option'] = json_encode($item['option']);
$item['pattern'] = json_encode($item['pattern']);
$rows[] = $item;
}
$res = $this->routeList->saveAll($rows);
return true;
}
}

View File

@@ -0,0 +1,29 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
// you should use `$router`
/* @var think\Route $router */
$router->group(function () use ($router){
// apiCategory路由
$router->resource('apicategory', '\catchAdmin\apimanager\controller\ApiCategory');
// apiTester路由
$router->resource('apitester', '\catchAdmin\apimanager\controller\ApiTester');
// apiTesterUserenv路由
$router->resource('apiTesterUserenv', '\catchAdmin\apimanager\controller\ApiTesterUserenv');
// 切换API环境
$router->get('apiTesterUserenv/selectAPIenv/<id>', '\catchAdmin\apimanager\controller\ApiTesterUserenv@selectAPIenv');
// apiTesterLog路由
$router->resource('apiTesterLog', '\catchAdmin\apimanager\controller\ApiTesterLog');
// routeList 路由
$router->resource('routeList', catchAdmin\apimanager\controller\RouteList::class);
$router->post('apimanager/routelist/sync', 'catchAdmin\apimanager\controller\RouteList@sync');
})->middleware('auth');

View File

@@ -0,0 +1,61 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\tables;
use catchAdmin\apimanager\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;
use catcher\library\table\Table;
class ApiCategory extends CatchTable
{
/**
* table
*
* @time 2021年03月29日
* @return array
*/
protected function table(): array
{
// TODO: Implement table() method.
return $this->getTable('api_category')->header([
HeaderItem::label('分类标题')->prop('category_title'),
HeaderItem::label('分类唯一标识')->prop('category_name'),
HeaderItem::label('排序')->prop('sort')->withEditNumberComponent(),
HeaderItem::label('状态')->prop('status')->withSwitchComponent(),
HeaderItem::label('创建时间')->prop('created_at'),
HeaderItem::label('操作')->width(260)->actions([
Actions::update(),
Actions::delete(),
])
])->withApiRoute('apicategory')->withActions([
Actions::create()
])->withSearch([
Search::label('分类标题')->text('category_title', '请输入分类标题'),
Search::label('状态')->status()
])->withDialogWidth('35%')
->toTreeTable()->render();
}
/**
* form 方式
*
* @time 2021年03月29日
* @return array
*/
protected function form(): array
{
return Factory::create('ApiCategory');
}
}

View File

@@ -0,0 +1,40 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\tables\forms;
use catchAdmin\apimanager\model\ApiCategory as ApiCategoryModel;
use catcher\library\form\Form;
class ApiCategory extends Form
{
public function fields(): array
{
return [
// TODO: Implement fields() method
Form::cascader('parent_id', '上级分类', [0])->options(
ApiCategoryModel::field(['id', 'parent_id', 'category_title'])->select()->toTree()
)->clearable(true)->filterable(true)->props([
'props' => [
'value' => 'id',
'label' => 'category_title',
'checkStrictly' => true
],
])->style(['width' => '100%']),
Form::input('category_title', '分类标题')->required()->placeholder('分类标题'),
Form::input('category_name', '分类唯一标识'),
Form::radio('status', '状态')->value(1)->options(
Form::options()->add('启用', 1)->add('禁用', 2)->render()
),
Form::number('sort', '排序')->value(1)->min(1)->max(10000),
];
}
}

View File

@@ -0,0 +1,22 @@
<?php
// +----------------------------------------------------------------------
// | UCToo [ Universal Convergence Technology ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: UCToo <contact@uctoo.com>
// +----------------------------------------------------------------------
namespace catchAdmin\apimanager\tables\forms;
use catcher\library\form\FormFactory;
class Factory extends FormFactory
{
public static function from(): string
{
return __NAMESPACE__;
}
}

25
catch/cms/CmsService.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms;
use catcher\ModuleService;
class CmsService extends ModuleService
{
public function loadRouteFrom()
{
// TODO: Implement loadRouteFrom() method.
return __DIR__ . DIRECTORY_SEPARATOR . 'route.php';
}
}

6
catch/cms/README.md Normal file
View File

@@ -0,0 +1,6 @@
## 内容管理系统
#### 安装
```shell
composer require xaboy/form-builder:~2.0
```

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Articles as articlesModel;
class Articles extends CatchController
{
protected $articlesModel;
public function __construct(ArticlesModel $articlesModel)
{
$this->articlesModel = $articlesModel;
}
/**
* 列表
* @time 2020年12月27日 19:40
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->articlesModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 19:40
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->articlesModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 19:40
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->articlesModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 19:40
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->articlesModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 19:40
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->articlesModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Banners as bannersModel;
class Banners extends CatchController
{
protected $bannersModel;
public function __construct(BannersModel $bannersModel)
{
$this->bannersModel = $bannersModel;
}
/**
* 列表
* @time 2020年12月27日 19:58
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->bannersModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 19:58
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->bannersModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 19:58
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->bannersModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 19:58
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->bannersModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 19:58
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->bannersModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,91 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchAdmin;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Category as categoryModel;
use catcher\CatchUpload;
use catcher\library\excel\reader\Reader;
use think\Exception;
use think\facade\Db;
class Category extends CatchController
{
protected $categoryModel;
public function __construct(CategoryModel $categoryModel)
{
$this->categoryModel = $categoryModel;
}
/**
* 列表
* @time 2020年12月27日 19:15
* @param Request $request
* @return \think\response\Json
*/
public function index(Request $request)
{
return CatchResponse::success($this->categoryModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 19:15
* @param Request $request
* @return \think\response\Json
*/
public function save(Request $request)
{
return CatchResponse::success($this->categoryModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 19:15
* @param $id
* @return \think\response\Json
*/
public function read($id)
{
return CatchResponse::success($this->categoryModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 19:15
* @param Request $request
* @param $id
* @return \think\response\Json
*/
public function update(Request $request, $id)
{
return CatchResponse::success($this->categoryModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 19:15
* @param $id
* @return \think\response\Json
*/
public function delete($id)
{
return CatchResponse::success($this->categoryModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Comments as commentsModel;
class Comments extends CatchController
{
protected $commentsModel;
public function __construct(CommentsModel $commentsModel)
{
$this->commentsModel = $commentsModel;
}
/**
* 列表
* @time 2020年12月27日 19:53
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->commentsModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 19:53
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->commentsModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 19:53
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->commentsModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 19:53
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->commentsModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 19:53
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->commentsModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\FormData as formDataModel;
class FormData extends CatchController
{
protected $formDataModel;
public function __construct(FormDataModel $formDataModel)
{
$this->formDataModel = $formDataModel;
}
/**
* 列表
* @time 2020年12月27日 20:35
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->formDataModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 20:35
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->formDataModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 20:35
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->formDataModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 20:35
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->formDataModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 20:35
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->formDataModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\FormFields as formFieldsModel;
class FormFields extends CatchController
{
protected $formFieldsModel;
public function __construct(FormFieldsModel $formFieldsModel)
{
$this->formFieldsModel = $formFieldsModel;
}
/**
* 列表
* @time 2020年12月27日 20:28
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->formFieldsModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 20:28
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->formFieldsModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 20:28
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->formFieldsModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 20:28
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->formFieldsModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 20:28
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->formFieldsModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Forms as formsModel;
class Forms extends CatchController
{
protected $formsModel;
public function __construct(FormsModel $formsModel)
{
$this->formsModel = $formsModel;
}
/**
* 列表
* @time 2020年12月27日 20:19
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->formsModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 20:19
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->formsModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 20:19
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->formsModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 20:19
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->formsModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 20:19
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->formsModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,95 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catchAdmin\cms\support\Table;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\ModelFields as ModelFieldsModel;
use catchAdmin\cms\model\Models;
use catcher\exceptions\FailedException;
class ModelFields extends CatchController
{
protected $modelFields;
public function __construct(ModelFieldsModel $modelFields)
{
$this->modelFields = $modelFields;
}
/**
* 列表
* @time 2020年12月29日 21:00
* @param Request $request
* @param Models $models
* @return \think\response\Json
*/
public function index(Request $request): \think\response\Json
{
// $columns = Table::columns($models::where('id',$request->param('model_id'))->value('table_name'));
//foreach ($columns as &$column) {
// $column['title'] = $column['comment'];
// }
return CatchResponse::success($this->modelFields->getFieldsByModelId($request->param('model_id')));
}
/**
* 保存信息
* @time 2020年12月29日 21:00
* @param Request $request
* @return \think\response\Json
*/
public function save(Request $request): \think\response\Json
{
return CatchResponse::success($this->modelFields->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月29日 21:00
* @param $id
* @return \think\response\Json
*/
public function read($id): \think\response\Json
{
return CatchResponse::success($this->modelFields->findBy($id));
}
/**
* 更新
* @time 2020年12月29日 21:00
* @param Request $request
* @param $id
* @return \think\response\Json
*/
public function update(Request $request, $id): \think\response\Json
{
return CatchResponse::success($this->modelFields->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月29日 21:00
* @param $id
* @return \think\response\Json
*/
public function delete($id): \think\response\Json
{
return CatchResponse::success($this->modelFields->deleteBy($id));
}
}

View File

@@ -0,0 +1,85 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Models as CmsModel;
class Models extends CatchController
{
protected $cmsModel;
public function __construct(CmsModel $cmsModel)
{
$this->cmsModel = $cmsModel;
}
/**
* 列表
* @time 2020年12月29日 20:02
* @param Request $request
* @return \think\response\Json
*/
public function index(Request $request): \think\response\Json
{
return CatchResponse::paginate($this->cmsModel->getList());
}
/**
* 保存信息
* @time 2020年12月29日 20:02
* @param Request $request
* @return \think\response\Json
*/
public function save(Request $request): \think\response\Json
{
return CatchResponse::success($this->cmsModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月29日 20:02
* @param $id
* @return \think\response\Json
*/
public function read($id): \think\response\Json
{
return CatchResponse::success($this->cmsModel->findBy($id));
}
/**
* 更新
* @time 2020年12月29日 20:02
* @param Request $request
* @param $id
* @return \think\response\Json
*/
public function update(Request $request, $id): \think\response\Json
{
return CatchResponse::success($this->cmsModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月29日 20:02
* @param $id
* @return \think\response\Json
*/
public function delete($id): \think\response\Json
{
return CatchResponse::success($this->cmsModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\SiteLinks as siteLinksModel;
class SiteLinks extends CatchController
{
protected $siteLinksModel;
public function __construct(SiteLinksModel $siteLinksModel)
{
$this->siteLinksModel = $siteLinksModel;
}
/**
* 列表
* @time 2020年12月27日 20:02
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->siteLinksModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 20:02
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->siteLinksModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 20:02
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->siteLinksModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 20:02
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->siteLinksModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 20:02
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->siteLinksModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Tags as tagsModel;
class Tags extends CatchController
{
protected $tagsModel;
public function __construct(TagsModel $tagsModel)
{
$this->tagsModel = $tagsModel;
}
/**
* 列表
* @time 2020年12月27日 19:44
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->tagsModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 19:44
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->tagsModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 19:44
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->tagsModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 19:44
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->tagsModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 19:44
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->tagsModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,69 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catchAdmin\system\model\Attachments;
use catcher\base\CatchController;
use catcher\base\CatchRequest;
use catcher\CatchResponse;
use catcher\CatchUpload;
use catcher\exceptions\FailedException;
class Upload extends CatchController
{
protected $attachment;
public function __construct(Attachments $attachment)
{
$this->attachment = $attachment;
}
/**
* image upload
*
* @time 2020年01月25日
* @param CatchRequest $request
* @param CatchUpload $upload
* @return \think\response\Json
*/
public function image(CatchRequest $request, CatchUpload $upload): \think\response\Json
{
$images = $request->file();
if (!$images) {
throw new FailedException('请选择图片上传');
}
return CatchResponse::success([
'filePath' => $upload->checkImages($images)->multiUpload($images['image'])
]);
}
/**
* file upload
*
* @time 2020年01月25日
* @param CatchRequest $request
* @param CatchUpload $upload
* @return \think\response\Json
*/
public function file(CatchRequest $request, CatchUpload $upload): \think\response\Json
{
$files = $request->file();
return CatchResponse::success([
'src' => $upload->checkFiles($files)->multiUpload($files['file'])
]);
}
}

View File

@@ -0,0 +1,80 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\controller;
use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\cms\model\Users as usersModel;
class Users extends CatchController
{
protected $usersModel;
public function __construct(UsersModel $usersModel)
{
$this->usersModel = $usersModel;
}
/**
* 列表
* @time 2020年12月27日 19:04
* @param Request $request
*/
public function index(Request $request) : \think\Response
{
return CatchResponse::paginate($this->usersModel->getList());
}
/**
* 保存信息
* @time 2020年12月27日 19:04
* @param Request $request
*/
public function save(Request $request) : \think\Response
{
return CatchResponse::success($this->usersModel->storeBy($request->post()));
}
/**
* 读取
* @time 2020年12月27日 19:04
* @param $id
*/
public function read($id) : \think\Response
{
return CatchResponse::success($this->usersModel->findBy($id));
}
/**
* 更新
* @time 2020年12月27日 19:04
* @param Request $request
* @param $id
*/
public function update(Request $request, $id) : \think\Response
{
return CatchResponse::success($this->usersModel->updateBy($id, $request->post()));
}
/**
* 删除
* @time 2020年12月27日 19:04
* @param $id
*/
public function delete($id) : \think\Response
{
return CatchResponse::success($this->usersModel->deleteBy($id));
}
}

View File

@@ -0,0 +1,44 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsHomeUsers extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_users', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '用户表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('username', 'string', ['limit' => 100,'null' => true,'signed' => true,'comment' => '用户名',])
->addColumn('email', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '邮箱',])
->addColumn('mobile', 'string', ['limit' => 50,'null' => false,'default' => '','signed' => true,'comment' => '手机号',])
->addColumn('avatar', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '头像',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 正常 2 禁用',])
->addColumn('password', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '密码',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,53 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsCategory extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_category', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '分类表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('name', 'string', ['limit' => 100,'null' => true,'signed' => true,'comment' => '栏目名称',])
->addColumn('parent_id', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 0,'signed' => true,'comment' => '父级ID',])
->addColumn('title', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'seo标题',])
->addColumn('keywords', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'seo关键词',])
->addColumn('description', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '描述',])
->addColumn('url', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '自定义 URL',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '状态',])
->addColumn('is_can_contribute', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '是否可以投稿',])
->addColumn('is_can_comment', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '是否可以评论',])
->addColumn('type', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '页面模式',])
->addColumn('weight', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 1,'signed' => true,'comment' => '权重',])
// ->addColumn('is_link_out', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '1 是 2 否',])
->addColumn('link_to', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '链接外部地址',])
->addColumn('limit', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 10,'signed' => true,'comment' => '每页数量',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,54 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsArticles extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_articles', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '文章表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('title', 'string', ['limit' => 255,'null' => true,'signed' => true,'comment' => '文章标题',])
->addColumn('category_id', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => true,'signed' => true,'comment' => '分类ID',])
->addColumn('images', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '多图集合',])
->addColumn('tags', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '标签集合',])
->addColumn('url', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '自定义URL',])
->addColumn('content', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => false,'signed' => true,'comment' => '内容',])
->addColumn('keywords', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '关键字',])
->addColumn('description', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '描述',])
->addColumn('pv', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '浏览量',])
->addColumn('likes', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '喜欢',])
->addColumn('comments', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '评论数',])
->addColumn('is_top', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '1 置顶 2 非置顶',])
->addColumn('is_recommend', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '1 推荐 2 不推荐',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 展示 2 隐藏',])
->addColumn('is_can_comment', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 允许 2 不允许',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsTags extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_tags', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '标签表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('name', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '标签名称',])
->addColumn('title', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'seo 标签',])
->addColumn('keywords', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '关键字',])
->addColumn('description', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '描述',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsArticleRelateTags extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_article_relate_tags', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '文章关联标签表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('article_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => false,'comment' => '文章ID',])
->addColumn('tag_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => false,'comment' => '标签ID',])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsComments extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_comments', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('article_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => false,'comment' => '文章ID',])
->addColumn('content', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '内容',])
->addColumn('parent_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '父ID',])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => false,'comment' => '评论者ID',])
->addColumn('ip', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'ip 地址',])
->addColumn('user_agent', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'agent',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 展示 2 隐藏',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsBanners extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_banners', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => 'banner 图' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('title', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'banner 标题',])
->addColumn('banner_img', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'banner 图片',])
->addColumn('category_id', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 0,'signed' => true,'comment' => '默认 0 代表首页展示',])
->addColumn('link_to', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '链接地址',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsSiteLinks extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_site_links', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '友情链接' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('title', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '友情链接标题',])
->addColumn('link_to', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '跳转地址',])
->addColumn('weight', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 1,'signed' => true,'comment' => '权重',])
->addColumn('is_show', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 展示 2 隐藏',])
->addColumn('icon', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '网站图标',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,49 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsForms extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_forms', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '动态表单' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('name', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '表单名称',])
->addColumn('alias', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '表单别名',])
->addColumn('submit_url', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '表单提交的 URL',])
->addColumn('title', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '表单标题',])
->addColumn('keywords', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '关键词',])
->addColumn('description', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '描述',])
->addColumn('success_message', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '成功提示信息',])
->addColumn('failed_message', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '失败提示信息',])
->addColumn('success_link_to', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '成功后跳转',])
->addColumn('is_login_to_submit', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 需要 2 不需要',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,48 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsFormFields extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_form_fields', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '动态表单字段' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('form_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'form id',])
->addColumn('label', 'string', ['limit' => 50,'null' => false,'default' => '','signed' => true,'comment' => '字段 label',])
->addColumn('name', 'string', ['limit' => 50,'null' => false,'default' => '','signed' => true,'comment' => '表单字段name',])
->addColumn('default_value', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '默认值',])
->addColumn('type', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 1,'signed' => false,'comment' => '类型',])
->addColumn('rule', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '验证规则',])
->addColumn('length', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => false,'default' => 0,'signed' => true,'comment' => '字段长度',])
->addColumn('failed_message', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '验证失败信息',])
->addColumn('status', 'boolean', ['null' => false,'default' => 1,'signed' => true,'comment' => '1 展示 2 隐藏',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsFormData extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_form_data', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '动态提交的表单数据' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('form_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '表单ID',])
->addColumn('data', 'json', ['null' => false,'signed' => true,'comment' => 'json字段',])
->addColumn('user_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '用户ID',])
->addColumn('ip', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'ip 地址',])
->addColumn('user_agent', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => 'agent',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsModel extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_models', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '模型表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('name', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '模型名称',])
->addColumn('alias', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '模型别名',])
->addColumn('table_name', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '模型关联的表名,数据来源',])
->addColumn('description', 'string', ['limit' => 1000,'null' => false,'default' => '','signed' => true,'comment' => '模型描述',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,55 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
use Phinx\Db\Adapter\MysqlAdapter;
class CmsModelFields extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_model_fields', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '模型字段' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('title', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '字段中文名称',])
->addColumn('name', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '表单字段名称',])
->addColumn('type', 'string', ['limit' => 50, 'null' => false,'signed' => true,'comment' => '类型',])
->addColumn('length', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => true,'signed' => true,'comment' => '字段长度',])
->addColumn('default_value', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '默认值',])
->addColumn('options', 'string', ['limit' => 1000,'null' => false,'default' => '', 'comment' => '选项',])
->addColumn('is_index', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '是否是索引 1 是 2 否',])
->addColumn('is_unique', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '是否唯一 1 是 2 否',])
->addColumn('rules', 'string', ['limit' => 255,'null' => false,'default' => '', 'comment' => '验证规则',])
->addColumn('pattern', 'string', ['limit' => 255,'null' => false,'default' => '', 'comment' => '正则',])
->addColumn('model_id', 'integer', ['limit' => MysqlAdapter::INT_SMALL,'null' => true,'signed' => true,'comment' => '模型ID',])
->addColumn('use_at_list', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '展示在列表 1 是 2 否',])
->addColumn('use_at_detail', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '展示在详情 1 是 2 否',])
->addColumn('use_at_search', 'boolean', ['null' => false,'default' => 2,'signed' => true,'comment' => '用作是否搜索 1 是 2 否',])
->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
->addColumn('sort', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 1,'signed' => false,'comment' => '排序',])
->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY,'null' => false,'default' => 1,'signed' => false,'comment' => '状态 1显示 2隐藏',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,51 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
use think\migration\Migrator;
use think\migration\db\Column;
use \Phinx\Db\Adapter\MysqlAdapter;
class ModelAuxiliaryTable extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('cms_model_auxiliary_table', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '模型副表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
$table->addColumn('model_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '模型ID',])
->addColumn('table_name', 'string', ['limit' => 255,'null' => false,'default' => '','signed' => true,'comment' => '副表表明',])
->addColumn('used', 'integer', ['limit' => MysqlAdapter::INT_TINY,'null' => false,'default' => 2,'signed' => true,'comment' => '默认使用 1 不使用 2 使用',])
->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
->create();
}
}

View File

@@ -0,0 +1,48 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
use think\migration\Migrator;
use think\migration\db\Column;
class AddModelFields extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
if ($this->hasTable('cms_models')) {
$this->table('cms_models')
->addColumn('used_at_list', 'string', ['limit' => 512,'null' => false,'default' => '','signed' => true,'comment' => '用在列表的字段', 'after' => 'description'])
->addColumn('used_at_search', 'string', ['limit' => 512,'null' => false,'default' => '','signed' => true,'comment' => '用在搜索的字段', 'after' => 'description'])
->addColumn('used_at_detail', 'string', ['limit' => 512,'null' => false,'default' => '','signed' => true,'comment' => '用在详情的字段', 'after' => 'description'])
->update();
}
}
}

View File

@@ -0,0 +1,57 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
use think\migration\Migrator;
use think\migration\db\Column;
class AddArticleColumns extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
if ($this->hasTable('cms_articles')) {
$table = $this->table('cms_articles');
$table->addColumn('weight', 'integer', [
'default' => 1,
'comment' => '文章权重',
'after' => 'status'
])->update();
$table->addColumn('cover', 'string', [
'limit' => 255,
'default' => '',
'comment' => '封面地址',
'after' => 'category_id'
])->update();
}
}
}

View File

@@ -0,0 +1,44 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
use think\migration\Migrator;
use think\migration\db\Column;
class RemoveArticlesTagsField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
if ($this->hasTable('cms_articles')) {
$this->table('cms_articles')->removeColumn('tags');
}
}
}

View File

@@ -0,0 +1,47 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
use think\migration\Migrator;
use think\migration\db\Column;
class UpdateArticleColumns extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
if ($this->hasTable('cms_articles')) {
$table = $this->table('cms_articles');
$table->renameColumn('comments', 'comment_num')
->update();
}
}
}

View File

@@ -0,0 +1,901 @@
<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
use think\migration\Seeder;
class CmsMenusSeed extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run(): void
{
\catcher\Utils::importTreeData($this->getPermissions(), 'permissions', 'parent_id');
}
protected function getPermissions()
{
return array (
0 =>
array (
'id' => 140,
'permission_name' => '内容管理',
'parent_id' => 0,
'level' => '',
'route' => 'cms',
'icon' => 'el-icon-video-camera-solid',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'cms',
'component' => 'layout',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618909227,
'updated_at' => 1620956103,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 171,
'permission_name' => '栏目管理',
'parent_id' => 140,
'level' => '140',
'route' => '/cms/category',
'icon' => 'el-icon-s-flag',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'category',
'component' => 'cmsCategory',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618912610,
'updated_at' => 1620956103,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 172,
'permission_name' => '列表',
'parent_id' => 171,
'level' => '140-171',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'category@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 0,
'created_at' => 0,
'updated_at' => 1620369713,
'deleted_at' => 0,
),
1 =>
array (
'id' => 173,
'permission_name' => '保存',
'parent_id' => 171,
'level' => '140-171',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'category@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 0,
'created_at' => 0,
'updated_at' => 1620369713,
'deleted_at' => 0,
),
2 =>
array (
'id' => 174,
'permission_name' => '更新',
'parent_id' => 171,
'level' => '140-171',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'category@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 0,
'created_at' => 0,
'updated_at' => 1620369713,
'deleted_at' => 0,
),
3 =>
array (
'id' => 175,
'permission_name' => '删除',
'parent_id' => 171,
'level' => '140-171',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'category@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 0,
'created_at' => 0,
'updated_at' => 1620369713,
'deleted_at' => 0,
),
),
),
1 =>
array (
'id' => 176,
'permission_name' => '模型管理',
'parent_id' => 140,
'level' => '',
'route' => '/cms/model',
'icon' => 'el-icon-help',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'model',
'component' => 'cmsModel',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618923203,
'updated_at' => 1620956103,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 177,
'permission_name' => '列表',
'parent_id' => 176,
'level' => '140-176',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'model@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618923203,
'updated_at' => 1620909102,
'deleted_at' => 0,
),
1 =>
array (
'id' => 178,
'permission_name' => '保存',
'parent_id' => 176,
'level' => '140-176',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'model@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618923203,
'updated_at' => 1620892464,
'deleted_at' => 0,
),
2 =>
array (
'id' => 179,
'permission_name' => '更新',
'parent_id' => 176,
'level' => '140-176',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'model@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618923203,
'updated_at' => 1620892464,
'deleted_at' => 0,
),
3 =>
array (
'id' => 180,
'permission_name' => '删除',
'parent_id' => 176,
'level' => '140-176',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'model@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1618923203,
'updated_at' => 1620892464,
'deleted_at' => 0,
),
),
),
2 =>
array (
'id' => 182,
'permission_name' => '友情链接',
'parent_id' => 140,
'level' => '140',
'route' => '/cms/site/links',
'icon' => ' el-icon-attract',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'siteLinks',
'component' => 'cmsSiteLinks',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1620548662,
'updated_at' => 1620956103,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 183,
'permission_name' => '列表',
'parent_id' => 182,
'level' => '140-182',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'siteLinks@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1620548662,
'updated_at' => 1620982550,
'deleted_at' => 0,
),
1 =>
array (
'id' => 184,
'permission_name' => '保存',
'parent_id' => 182,
'level' => '140-182',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'siteLinks@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1620548662,
'updated_at' => 1620905875,
'deleted_at' => 0,
),
2 =>
array (
'id' => 185,
'permission_name' => '更新',
'parent_id' => 182,
'level' => '140-182',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'siteLinks@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1620548662,
'updated_at' => 1620905875,
'deleted_at' => 0,
),
3 =>
array (
'id' => 186,
'permission_name' => '删除',
'parent_id' => 182,
'level' => '140-182',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'siteLinks@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1620548662,
'updated_at' => 1620905875,
'deleted_at' => 0,
),
),
),
3 =>
array (
'id' => 196,
'permission_name' => '文章管理',
'parent_id' => 140,
'level' => '',
'route' => '/cms/articles',
'icon' => 'el-icon-s-finance',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'articles',
'component' => 'cmsArticle',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621216834,
'updated_at' => 1621216834,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 197,
'permission_name' => '列表',
'parent_id' => 196,
'level' => '140-196',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'articles@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621216834,
'updated_at' => 1621216834,
'deleted_at' => 0,
),
1 =>
array (
'id' => 198,
'permission_name' => '保存',
'parent_id' => 196,
'level' => '140-196',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'articles@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621216834,
'updated_at' => 1621216834,
'deleted_at' => 0,
),
2 =>
array (
'id' => 199,
'permission_name' => '更新',
'parent_id' => 196,
'level' => '140-196',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'articles@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621216834,
'updated_at' => 1621216834,
'deleted_at' => 0,
),
3 =>
array (
'id' => 200,
'permission_name' => '删除',
'parent_id' => 196,
'level' => '140-196',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'articles@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621216834,
'updated_at' => 1621216834,
'deleted_at' => 0,
),
),
),
4 =>
array (
'id' => 203,
'permission_name' => '文章详情',
'parent_id' => 140,
'level' => '',
'route' => '/cms/articles/detail/:id?',
'icon' => 'el-icon-s-order',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'articles',
'component' => 'cmsArticleDetail',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 2,
'sort' => 1,
'created_at' => 1621475789,
'updated_at' => 1621475789,
'deleted_at' => 0,
),
5 =>
array (
'id' => 204,
'permission_name' => '标签管理',
'parent_id' => 140,
'level' => '',
'route' => '/cms/tags',
'icon' => 'el-icon-paperclip',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'tags',
'component' => 'cmsTag',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621606711,
'updated_at' => 1621607174,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 205,
'permission_name' => '列表',
'parent_id' => 204,
'level' => '140-204',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'tags@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621606711,
'updated_at' => 1621607174,
'deleted_at' => 0,
),
1 =>
array (
'id' => 206,
'permission_name' => '保存',
'parent_id' => 204,
'level' => '140-204',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'tags@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621606711,
'updated_at' => 1621607174,
'deleted_at' => 0,
),
2 =>
array (
'id' => 207,
'permission_name' => '更新',
'parent_id' => 204,
'level' => '140-204',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'tags@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621606711,
'updated_at' => 1621607174,
'deleted_at' => 0,
),
3 =>
array (
'id' => 208,
'permission_name' => '删除',
'parent_id' => 204,
'level' => '140-204',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'tags@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1621606711,
'updated_at' => 1621607174,
'deleted_at' => 0,
),
),
),
6 =>
array (
'id' => 211,
'permission_name' => '用户管理',
'parent_id' => 140,
'level' => '',
'route' => '/cms/users',
'icon' => 'el-icon-user-solid',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'users',
'component' => 'cmsUsers',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622020257,
'updated_at' => 1622020418,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 212,
'permission_name' => '列表',
'parent_id' => 211,
'level' => '140-211',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'users@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622020257,
'updated_at' => 1622020418,
'deleted_at' => 0,
),
1 =>
array (
'id' => 213,
'permission_name' => '保存',
'parent_id' => 211,
'level' => '140-211',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'users@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622020257,
'updated_at' => 1622020418,
'deleted_at' => 0,
),
2 =>
array (
'id' => 214,
'permission_name' => '更新',
'parent_id' => 211,
'level' => '140-211',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'users@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622020257,
'updated_at' => 1622020418,
'deleted_at' => 0,
),
3 =>
array (
'id' => 215,
'permission_name' => '删除',
'parent_id' => 211,
'level' => '140-211',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'users@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622020257,
'updated_at' => 1622020418,
'deleted_at' => 0,
),
),
),
7 =>
array (
'id' => 216,
'permission_name' => '评论管理',
'parent_id' => 140,
'level' => '',
'route' => '/cms/comments',
'icon' => 'el-icon-s-help',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'comments',
'component' => 'cmsComments',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622022327,
'updated_at' => 1622022327,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 217,
'permission_name' => '列表',
'parent_id' => 216,
'level' => '140-216',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'comments@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622022327,
'updated_at' => 1622022327,
'deleted_at' => 0,
),
1 =>
array (
'id' => 220,
'permission_name' => '删除',
'parent_id' => 216,
'level' => '140-216',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'comments@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622022327,
'updated_at' => 1622022327,
'deleted_at' => 0,
),
),
),
8 =>
array (
'id' => 221,
'permission_name' => '轮播管理',
'parent_id' => 140,
'level' => '',
'route' => '/cms/banners',
'icon' => 'el-icon-picture-outline-round',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'banners',
'component' => 'cmsBanners',
'redirect' => '',
'keepalive' => 1,
'type' => 1,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622073776,
'updated_at' => 1622073776,
'deleted_at' => 0,
'children' =>
array (
0 =>
array (
'id' => 222,
'permission_name' => '列表',
'parent_id' => 221,
'level' => '140-221',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'banners@index',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622073776,
'updated_at' => 1622073776,
'deleted_at' => 0,
),
1 =>
array (
'id' => 223,
'permission_name' => '保存',
'parent_id' => 221,
'level' => '140-221',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'banners@save',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622073776,
'updated_at' => 1622073776,
'deleted_at' => 0,
),
2 =>
array (
'id' => 224,
'permission_name' => '更新',
'parent_id' => 221,
'level' => '140-221',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'banners@update',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622073776,
'updated_at' => 1622073776,
'deleted_at' => 0,
),
3 =>
array (
'id' => 225,
'permission_name' => '删除',
'parent_id' => 221,
'level' => '140-221',
'route' => '',
'icon' => '',
'module' => 'cms',
'creator_id' => 1,
'permission_mark' => 'banners@delete',
'component' => '',
'redirect' => '',
'keepalive' => 1,
'type' => 2,
'hidden' => 1,
'sort' => 1,
'created_at' => 1622073776,
'updated_at' => 1622073776,
'deleted_at' => 0,
),
),
),
),
),
);
}
}

View File

@@ -0,0 +1,24 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
declare(strict_types=1);
namespace catchAdmin\cms\exceptions;
use catcher\exceptions\CatchException;
class ColumnException extends CatchException
{
protected $code = 20002;
}

View File

@@ -0,0 +1,23 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
declare(strict_types=1);
namespace catchAdmin\cms\exceptions;
use catcher\exceptions\CatchException;
class TableException extends CatchException
{
protected $code = 20001;
}

View File

@@ -0,0 +1,196 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\events\ArticlesEvent;
use catchAdmin\cms\model\search\ArticlesSearch;
/**
* Class Articles
* @package catchAdmin\cms\model
* @auth CatchAdmin
* @time 2021年05月22日
*
* @property Articles category_id
* @property Articles id
* @property Articles title
* @property Articles cover
* @property Articles images
* @property Articles tags
* @property Articles url
* @property Articles content
* @property Articles keywords
* @property Articles description
* @property Articles pv
* @property Articles likes
* @property Articles comments
* @property Articles is_top
* @property Articles is_recommend
* @property Articles status
* @property Articles weight
* @property Articles is_can_comment
* @property Articles creator_id
* @property Articles created_at
* @property Articles updated_at
* @property Articles deleted_at
*
*/
class Articles extends BaseModel
{
use ArticlesEvent, ArticlesSearch;
// 表名
public $name = 'cms_articles';
// 数据库字段映射
public $field = array(
'id',
// 文章标题
'title',
// 分类ID
'category_id',
'cover', // 封面
// 多图集合
'images',
// 自定义URL
'url',
// 内容
'content',
// 关键字
'keywords',
// 描述
'description',
// 浏览量
'pv',
// 喜欢
'likes',
// 评论数
'comment_num',
// 1 置顶 2 非置顶
'is_top',
// 1 推荐 2 不推荐
'is_recommend',
// 1 展示 2 隐藏
'status',
'weight', // 权重
// 1 允许 2 不允许
'is_can_comment',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
const TOP = 1; // 置顶
const UN_TOP = 2; // 不置顶
const RECOMMEND = 1; // 推荐
const UN_RECOMMEND = 2; // 不推荐
const CAN_COMMENT = 1; // 评论允许
const UN_CAN_COMMENT = 2; // 评论不允许
/**
* 列表
*
* @auth CatchAdmin
* @time 2021年05月22日
* @return mixed
*/
public function getList()
{
// 分页列表
return $this->catchSearch()
->field($this->aliasField('*'))
->catchJoin(Category::class, 'id', 'category_id', ['name as category'])
->catchOrder()
->creator()
->paginate();
}
/**
* 查询
*
* @auth CatchAdmin
* @time 2021年05月22日
* @param $id
* @param array|string[] $field
* @param bool $trash
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @return array|mixed|\think\Model|null
*/
public function findBy($id, array $field = ['*'], bool $trash = false)
{
return $this->where('id', $id)
->with(['tag'])
->field('*')
->find();
}
/**
* 文章标签
*
* @time 2021年05月17日
* @return \think\model\relation\BelongsToMany
*/
public function tag(): \think\model\relation\BelongsToMany
{
return $this->belongsToMany(Tags::class, 'cms_article_relate_tags',
'tag_id', 'article_id'
);
}
/**
* 删除标签
*
* @param array $ids
* @return int
* @author CatchAdmin
* @time 2021年05月22日
*/
public function detachTags(array $ids = []): int
{
return $this->tag()->detach($ids);
}
/**
* 新增标签
*
* @author CatchAdmin
* @time 2021年05月22日
* @param array $ids
* @throws \think\db\exception\DbException
* @return array|\think\model\Pivot
*/
public function attachTags(array $ids)
{
return $this->tag()->attach($ids);
}
/**
* 文章评论
*
* @time 2021年05月27日
* @return \think\model\relation\HasMany
*/
public function comments(): \think\model\relation\HasMany
{
return $this->hasMany(Comments::class, 'article_id', 'id');
}
}

View File

@@ -0,0 +1,54 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\events\BannersEvent;
class Banners extends BaseModel
{
use BannersEvent;
// 表名
public $name = 'cms_banners';
// 数据库字段映射
public $field = array(
'id',
// banner 标题
'title',
// banner 图片
'banner_img',
// 默认 0 代表首页展示
'category_id',
// 链接地址
'link_to',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
public function getList()
{
return $this->catchSearch()
->field($this->aliasField('*'))
->catchLeftJoin(Category::class, 'id', 'category_id', ['name as category'])
->catchOrder()
->creator()
->paginate();
}
}

View File

@@ -0,0 +1,27 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catcher\base\CatchModel as Model;
use catcher\Utils;
class BaseModel extends Model
{
public function __construct($data = [])
{
parent::__construct($data);
$this->field = $this->getTableFields(Utils::tableWithPrefix($this->name));
}
}

View File

@@ -0,0 +1,105 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\events\CategoryEvent;
use catchAdmin\cms\model\scopes\CategoryScope;
class Category extends BaseModel
{
use CategoryEvent, CategoryScope;
// 表名
public $name = 'cms_category';
// 数据库字段映射
public $field = array(
'id',
// 分类名称
'name',
// 父级ID
'parent_id',
// seo标题
'title',
// seo关键词
'keywords',
// 描述
'description',
// 自定义 URL
'url',
// 1 显示 2 隐藏
'status',
// 是否可以投稿
'is_can_contribute',
// 是否可以评论
'is_can_comment',
// 是否是单页面 1 是 2 否
'type',
// 权重
'weight',
// 1 是 2 否
'is_link_out',
// 链接外部地址
'link_to',
// 创建人
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
protected $updateChildrenFields = ['status'];
const LIST_TYPE = 1; // 列表
const PAGE_TYPE = 2; // 单页
const COVER_TYPE = 3; // 封面
const CAN_COMMENT = 1; // 可以评论
const CAN_NOT_COMMENT = 2; // 不可以评论
const CAN_CONTRIBUTE = 1; // 可以投稿
const CAN_NOT_CONTRIBUTE = 2; // 不可以投稿
/**
* 列表
*
* @time 2021年03月03日
* @return mixed
*/
public function getList()
{
return $this->quickSearch()
->field(['*'])
->catchOrder()
->articlesCount()
->select()->toTree();
}
/**
* 是否存在下级
*
* @time 2021年03月03日
* @param int $id
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @return array|\think\Model|null
*/
public function hasNextLevel($id = 0)
{
return $this->where('parent_id', $id ? :$this->getKey())->find();
}
}

View File

@@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\search\CommentsSearch;
class Comments extends BaseModel
{
use CommentsSearch;
// 表名
public $name = 'cms_comments';
// 数据库字段映射
public $field = array(
'id',
// 文章ID
'article_id',
// 内容
'content',
// 父ID
'parent_id',
// 评论者ID
'user_id',
// ip 地址
'ip',
// agent
'user_agent',
// 1 展示 2 隐藏
'status',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
public function getList()
{
return $this->catchJoin(Articles::class, 'id', 'article_id', ['title'])
->catchJoin(Users::class, 'id', 'user_id', ['username'])
->field($this->aliasField('*'))
->catchSearch()
->catchOrder()
->paginate();
}
}

View File

@@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
class FormData extends BaseModel
{
// 表名
public $name = 'cms_form_data';
// 数据库字段映射
public $field = array(
'id',
// 表单ID
'form_id',
// json字段
'data',
// 用户ID
'user_id',
// ip 地址
'ip',
// agent
'user_agent',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
}

View File

@@ -0,0 +1,50 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
class FormFields extends BaseModel
{
// 表名
public $name = 'cms_form_fields';
// 数据库字段映射
public $field = array(
'id',
// form id
'form_id',
// 字段 label
'label',
// 表单字段name
'name',
// 默认值
'default_value',
// 类型
'type',
// 验证规则
'rule',
// 字段长度
'length',
// 验证失败信息
'failed_message',
// 1 展示 2 隐藏
'status',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
}

41
catch/cms/model/Forms.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
namespace catchAdmin\cms\model;
class Forms extends BaseModel
{
// 表名
public $name = 'cms_forms';
// 数据库字段映射
public $field = array(
'id',
// 表单名称
'name',
// 表单别名
'alias',
// 表单提交的 URL
'submit_url',
// 表单标题
'title',
// 关键词
'keywords',
// 描述
'description',
// 成功提示信息
'success_message',
// 失败提示信息
'failed_message',
// 成功后跳转
'success_link_to',
// 1 需要 2 不需要
'is_login_to_submit',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
}

View File

@@ -0,0 +1,104 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catcher\exceptions\FailedException;
class ModelAuxiliaryTable extends BaseModel
{
// 表名
public $name = 'cms_model_auxiliary_table';
// 数据库字段映射
public $field = array(
'id',
// 模型ID
'model_id',
// 副表名称
'table_name',
// 默认使用
'used',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
const USED = 1;
const NOT_USE = 2;
/**
* 获取默认使用的副表
*
* @time 2021年03月08日
* @param $modelId
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @return array|\think\Model|null
*/
public static function getDefaultUsed(int $modelId)
{
return self::where('model_id', $modelId)
->where('used', self::USED)
->find();
}
/**
* 默认使用
*
* @time 2021年03月08日
* @param int $id
* @return mixed
*/
public function used(int $id)
{
$t = $this->findBy($id);
$t->used = self::USED;
if ($t->save()) {
self::where('id', '<>', $id)
->where('model_id', $t->model_id)
->update([
'used' => self::NOT_USE,
]);
return $t;
}
throw new FailedException('启用失败');
}
/**
* 获取使用
*
* @time 2021年03月08日
* @param $modelId
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @return array|\think\Model|null
*/
public function getUsed($modelId)
{
return $this->where('model_id', $modelId)
->where('used', self::USED)
->find();
}
}

View File

@@ -0,0 +1,112 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\events\ModelFieldsEvent;
use catchAdmin\cms\support\Helper;
use catcher\Utils;
class ModelFields extends BaseModel
{
use ModelFieldsEvent;
// 表名
public $name = 'cms_model_fields';
// 数据库字段映射
public $field = array(
'id',
// 字段中文名称
'title',
// 表单字段名称
'name',
// 类型
'type',
// 长度
'length',
// 默认值
'default_value',
'is_index', // 是否是索引
'is_unique', // 是否是唯一
'options', // 列表
'rules', // 验证规则
'pattern', // 字段正则
// 模型ID
'model_id',
// 展示在列表 1 是 2 否
'use_at_list',
// 展示在详情 1 是 2 否
'use_at_detail',
// 用作是否搜索 1 是 2 否
'use_at_search',
// 创建人ID
'creator_id',
'sort',
'status',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
const IS_UNIQUE = 1;
const NOT_UNIQUE = 2;
const IS_INDEX = 1;
const NOT_INDEX = 2;
/**
* 获取模型的动态字段
*
* @time 2021年03月08日
* @param $modelId
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @return \think\Collection
*/
public function getFieldsByModelId($modelId): \think\Collection
{
return $this->withoutField([
'created_at', 'deleted_at', 'updated_at',
])->where('model_id', $modelId)->select();
}
/**
* 获取规则
*
* @time 2021年03月07日
* @param $value
* @return string[]
*/
public function getRulesAttr($value): array
{
return Utils::stringToArrayBy($value);
}
/**
* 获取选项
*
* @time 2021年03月07日
* @param $value
* @return mixed
*/
public function getOptionsAttr($value)
{
// return Helper::getOptions($value);
return $value;
}
}

View File

@@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\events\ModelsEvent;
class Models extends BaseModel
{
use ModelsEvent;
// 表名
public $name = 'cms_models';
// 数据库字段映射
public $field = array(
'id',
// 模型名称
'name',
// 模型别名
'alias',
// 模型关联的表名,数据来源
'table_name',
// 模型描述
'description',
// 列表字段
'used_at_list',
// 搜索字段
'used_at_search',
// 详情字段
'used_at_detail',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
/**
* 模型字段
*
* @time 2021年05月11日
* @return \think\model\relation\HasMany
*/
public function fields(): \think\model\relation\HasMany
{
return $this->hasMany(ModelFields::class, 'model_id', 'id');
}
}

View File

@@ -0,0 +1,56 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
class SiteLinks extends BaseModel
{
// 表名
public $name = 'cms_site_links';
// 数据库字段映射
public $field = array(
'id',
// 友情链接标题
'title',
// 跳转地址
'link_to',
// 权重
'weight',
// 1 展示 2 隐藏
'is_show',
// 网站图标
'icon',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
/**
* 标题搜索
*
* @time 2021年05月09日
* @param $query
* @param $value
* @param $data
* @return mixed
*/
public function searchTitleAttr($query, $value, $data)
{
return $query->whereLike('title', $value);
}
}

90
catch/cms/model/Tags.php Normal file
View File

@@ -0,0 +1,90 @@
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\cms\model;
use catchAdmin\cms\model\events\TagsEvent;
class Tags extends BaseModel
{
use TagsEvent;
// 表名
public $name = 'cms_tags';
// 数据库字段映射
public $field = array(
'id',
// 标签名称
'name',
// seo 标签
'title',
// 关键字
'keywords',
// 描述
'description',
// 创建人ID
'creator_id',
// 创建时间
'created_at',
// 更新时间
'updated_at',
// 软删除
'deleted_at',
);
/**
* 列表
*
* @auth CatchAdmin
* @time 2021年05月22日
* @return mixed
* @throws \think\db\exception\DbException
*/
public function getList()
{
// 分页列表
return $this->catchSearch()
->field($this->aliasField('*'))
->withCount('articles')
->catchOrder()
->paginate();
}
/**
* 标签下的文章
*
* @author CatchAdmin
* @time 2021年05月24日
* @return \think\model\relation\BelongsToMany
*/
public function articles(): \think\model\relation\BelongsToMany
{
return $this->belongsToMany(Articles::class, 'cms_article_relate_tags',
'article_id', 'tag_id'
);
}
/**
* 标签 name 搜索
*
* @author CatchAdmin
* @time 2021年05月24日
* @param $query
* @param $value
* @return void
*/
public function searchNameAttr($query, $value)
{
$query->whereLike('name', $value);
}
}

Some files were not shown because too many files have changed in this diff Show More