Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kanyxmo
MineAdmin
提交
8164d5c2
M
MineAdmin
项目概览
kanyxmo
/
MineAdmin
10 个月 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MineAdmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8164d5c2
编写于
5月 15, 2023
作者:
kanyxmo
浏览文件
操作
浏览文件
下载
差异文件
refactor
上级
b7172a0c
542ba89c
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
235 addition
and
11684 deletion
+235
-11684
README.md
README.md
+7
-20
app/Setting/config.json
app/Setting/config.json
+13
-1
app/System/config.json
app/System/config.json
+13
-1
bin/reboot.php
bin/reboot.php
+24
-0
composer.lock
composer.lock
+0
-11660
mine/Command/InstallProjectCommand.php
mine/Command/InstallProjectCommand.php
+15
-0
mine/Generator/Stubs/config.stub
mine/Generator/Stubs/config.stub
+13
-1
mine/Helper/SensitiveWordFilter.php
mine/Helper/SensitiveWordFilter.php
+149
-0
mine/Mine.php
mine/Mine.php
+1
-1
未找到文件。
README.md
浏览文件 @
8164d5c2
...
...
@@ -14,7 +14,7 @@
<img
src=
"https://gitee.com/xmo/MineAdmin/badge/star.svg?theme=dark"
/>
<img
src=
"https://gitee.com/xmo/MineAdmin/badge/fork.svg?theme=dark"
/>
<img
src=
"https://svg.hamm.cn/badge.svg?key=License&value=Apache-2.0&color=da4a00"
/>
<img
src=
"https://svg.hamm.cn/badge.svg?key=MineAdmin&value=v1.
1.2
"
/>
<img
src=
"https://svg.hamm.cn/badge.svg?key=MineAdmin&value=v1.
3.0
"
/>
</p>
PHP有很多优秀的后台管理系统,但基于Swoole的后台管理系统没找到合适我自己的。
所以就开发了一套后台管理系统。系统可以用于网站管理后台、CMS、CRM、OA、ERP等。
...
...
@@ -28,27 +28,14 @@ PHP有很多优秀的后台管理系统,但基于Swoole的后台管理系统
-
腾讯云特惠专场:
[
点击进入
](
http://txy.mineadmin.com
)
-
阿里云特惠专场:
[
点击进入
](
http://aly.mineadmin.com
)
## 配置Json来使用Vue完成CRUD操作
在传统的前后端分离架构下,前端必须要配置专业的前端开发人员来完成业务,这对于PHPer习惯前后端一把梭来说比较费事。
在JQuery逐渐没落的大趋势下,使用Vue成为趋势,但从JQ到Vue转变最难的是思想。
MineAdmin强调快速开发,为了适应现代开发模式并且兼顾传统一把梭,特开发出了crud和form两个组件,
只需要像过去配置json的方式即可完成对后端的接口联调,从而快速完成CRUD,大大替开发人员节省了时间。
让刚接触VUE的同学也能上手vue,体验vue的好处。
大神则可以自由发挥是决定使用crud组件,还是使用原生UI库来完成功能。
## 兔小巢
给大家提供一个可以交流的地方:
[
http://ask.mineadmin.com
](
http://ask.mineadmin.com
)
## 前端仓库地址
移步前端仓库
-
[
Github MineAdmin-Vue
](
https://github.com/kanyxmo/MineAdmin-Vue
)
-
[
Gitee MineAdmin-Vue
](
https://gitee.com/xmo/MineAdmin-vue
)
##
非
官方交流群
>
以下QQ群为 MineAdmin 爱好者建立用于交流学习,请勿相信任何收费事项
## 官方交流群
>
QQ群用于交流学习,请勿水群
<img
src=
"https://svg.hamm.cn/badge.svg?key=QQ群&value=150105478"
/>
...
...
@@ -86,6 +73,7 @@ MineAdmin强调快速开发,为了适应现代开发模式并且兼顾传统
-
pcntl
-
Mysql >= 5.7
-
Redis >= 4.0
-
Git >= 2.x
## 下载项目
...
...
@@ -98,7 +86,9 @@ composer config -g repo.packagist composer https://mirrors.tencent.com/composer/
composer
install
```
## 后端安装
## 项目安装
> 从 **`1.3.0`** 版本开始在安装后端项目后,会多一个步骤,询问是否在根目录建立 `web` 目录并下载前端项目代码
打开终端,执行安装命令,按照提示,一步步完成
`.env`
文件的配置
```
shell
...
...
@@ -152,11 +142,8 @@ php bin/hyperf.php mine:install
## 演示图片
<img
src=
"https://s1.ax1x.com/2022/07/31/vklKzR.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vklGdO.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vkl8eK.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vkl1L6.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vklwQI.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vkldSA.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vklNJH.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vklJoD.jpg"
/>
<img
src=
"https://s1.ax1x.com/2022/07/31/vkllsx.jpg"
/>
...
...
app/Setting/config.json
浏览文件 @
8164d5c2
...
...
@@ -5,5 +5,17 @@
"installed"
:
true
,
"enabled"
:
true
,
"version"
:
"1.0.0"
,
"order"
:
99
"order"
:
99
,
"required"
:
{
},
"required-dev"
:
{
},
"dependencies"
:
{
},
"devDependencies"
:
{
}
}
\ No newline at end of file
app/System/config.json
浏览文件 @
8164d5c2
...
...
@@ -5,5 +5,17 @@
"installed"
:
true
,
"enabled"
:
true
,
"version"
:
"1.0.0"
,
"order"
:
99
"order"
:
99
,
"required"
:
{
},
"required-dev"
:
{
},
"dependencies"
:
{
},
"devDependencies"
:
{
}
}
\ No newline at end of file
bin/reboot.php
0 → 100644
浏览文件 @
8164d5c2
<?php
/**
* MineAdmin is committed to providing solutions for quickly building web applications
* Please view the LICENSE file that was distributed with this source code,
* For the full copyright and license information.
* Thank you very much for using MineAdmin.
*
* @Author X.Mo<root@imoi.cn>
* @Link https://gitee.com/xmo/MineAdmin
*/
/**
* 强制重启服务脚本,并清理缓存代理类
*/
$pid
=
shell_exec
(
sprintf
(
'cat %s/../runtime/hyperf.pid'
,
__DIR__
));
$rebootCmd
=
sprintf
(
'rm -rf %s/../runtime/container/* && php %s/hyperf.php start > /dev/null 2>/dev/null &'
,
__DIR__
,
__DIR__
);
if
(
shell_exec
(
sprintf
(
'ps -ef | grep -v grep | grep %s'
,
$pid
)))
{
shell_exec
(
"kill -9
{
$pid
}
"
);
shell_exec
(
$rebootCmd
);
}
else
{
shell_exec
(
$rebootCmd
);
}
composer.lock
已删除
100644 → 0
浏览文件 @
b7172a0c
此差异已折叠。
点击以展开。
mine/Command/InstallProjectCommand.php
浏览文件 @
8164d5c2
...
...
@@ -41,6 +41,7 @@ class InstallProjectCommand extends MineCommand
protected
array
$redis
=
[];
public
function
configure
()
{
parent
::
configure
();
...
...
@@ -294,6 +295,20 @@ class InstallProjectCommand extends MineCommand
{
$this
->
line
(
PHP_EOL
.
' MineAdmin set others items...'
.
PHP_EOL
,
'comment'
);
$this
->
call
(
'mine:update'
);
$this
->
call
(
'mine:jwt-gen'
,
[
'--jwtSecret'
=>
'JWT_SECRET'
]);
$this
->
call
(
'mine:jwt-gen'
,
[
'--jwtSecret'
=>
'JWT_API_SECRET'
]);
$downloadFrontCode
=
$this
->
confirm
(
'Do you downloading the front-end code to "./web" directory?'
,
true
);
// 下载前端代码
if
(
$downloadFrontCode
)
{
$this
->
line
(
PHP_EOL
.
' Now about to start downloading the front-end code'
.
PHP_EOL
,
'comment'
);
if
(
shell_exec
(
'which git'
))
{
system
(
'git clone https://gitee.com/mineadmin/mineadmin-vue.git ./web/'
);
}
else
{
$this
->
warn
(
'Your server does not have the `git` command installed and will skip downloading the front-end project'
);
}
}
}
protected
function
initUserData
()
...
...
mine/Generator/Stubs/config.stub
浏览文件 @
8164d5c2
...
...
@@ -5,5 +5,17 @@
"installed": true,
"enabled": true,
"version": "{VERSION}",
"order": 0
"order": 0,
"required": {
},
"required-dev": {
},
"dependencies": {
},
"devDependencies": {
}
}
\ No newline at end of file
mine/Helper/SensitiveWordFilter.php
0 → 100644
浏览文件 @
8164d5c2
<?php
/**
* MineAdmin is committed to providing solutions for quickly building web applications
* Please view the LICENSE file that was distributed with this source code,
* For the full copyright and license information.
* Thank you very much for using MineAdmin.
*
* @Author X.Mo<root@imoi.cn>
* @Link https://gitee.com/xmo/MineAdmin
*/
namespace
Mine\Helper
;
class
SensitiveWordFilter
{
protected
array
$dict
=
[];
/**
* 加载词库数据,通过闭包形式,加载词库
* @param \Closure|null $closure
* @return $this
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws \RedisException
*/
public
function
loadDictData
(
\
Closure
$closure
=
null
)
:
self
{
$key
=
config
(
'cache.default.prefix'
)
.
':sensitiveWords'
;
$redis
=
redis
();
if
(
$redis
->
exists
(
$key
))
{
$this
->
dict
=
$redis
->
get
(
$key
);
}
else
if
(
$closure
instanceof
\
Closure
){
$this
->
dict
=
$closure
(
$this
);
$redis
->
rPush
(
$key
,
$this
->
dict
);
}
if
(
$this
->
dict
)
foreach
(
$this
->
dict
as
$dict
)
{
$this
->
addWords
(
trim
(
$dict
));
}
return
$this
;
}
/**
* 设置字典词库
* @param array $dict
* @return $this
*/
public
function
setDict
(
array
$dict
):
self
{
$this
->
dict
=
$dict
;
return
$this
;
}
public
function
getDict
():
array
{
return
$this
->
dict
;
}
/**
* 分割文本(注意ascii占1个字节, unicode...)
* @param string $str
* @return string[]
*/
protected
function
splitStr
(
string
$str
):
array
{
return
preg_split
(
"//u"
,
$str
,
-
1
,
PREG_SPLIT_NO_EMPTY
);
}
/**
* 添加敏感词
*/
public
function
addWords
(
string
$words
):
void
{
$wordArr
=
$this
->
splitStr
(
$words
);
$curNode
=
&
$this
->
dict
;
foreach
(
$wordArr
as
$char
)
{
if
(
!
isset
(
$curNode
))
{
$curNode
[
$char
]
=
[];
}
$curNode
=
&
$curNode
[
$char
];
}
// 标记到达当前节点完整路径为"敏感词"
$curNode
[
'end'
]
++
;
}
/**
* 过滤文本
*
* @param string $str 原始文本
* @param string $replace 敏感字替换字符
* @param int $skipDistance 严格程度: 检测时允许跳过的间隔
*
* @return string 返回过滤后的文本
*/
public
function
filter
(
string
$str
,
string
$replace
=
'*'
,
int
$skipDistance
=
0
):
string
{
$maxDistance
=
max
(
$skipDistance
,
0
)
+
1
;
$strArr
=
$this
->
splitStr
(
$str
);
$length
=
count
(
$strArr
);
for
(
$i
=
0
;
$i
<
$length
;
$i
++
)
{
$char
=
$strArr
[
$i
];
if
(
!
isset
(
$this
->
dict
[
$char
]))
{
continue
;
}
$curNode
=
&
$this
->
dict
[
$char
];
$dist
=
0
;
$matchIndex
=
[
$i
];
for
(
$j
=
$i
+
1
;
$j
<
$length
&&
$dist
<
$maxDistance
;
$j
++
)
{
if
(
!
isset
(
$curNode
[
$strArr
[
$j
]]))
{
$dist
++
;
continue
;
}
$matchIndex
[]
=
$j
;
$curNode
=
&
$curNode
[
$strArr
[
$j
]];
}
// 匹配
if
(
isset
(
$curNode
[
'end'
]))
{
foreach
(
$matchIndex
as
$index
)
{
$strArr
[
$index
]
=
$replace
;
}
$i
=
max
(
$matchIndex
);
}
}
return
implode
(
''
,
$strArr
);
}
/**
* 检查是否包含敏感词
* @param array|string $strArr
* @return bool
*/
public
function
checkText
(
array
|
string
$strArr
):
bool
{
$strArr
=
is_array
(
$strArr
)
?
$strArr
:
$this
->
splitStr
(
$strArr
);
$curNode
=
&
$this
->
dict
;
foreach
(
$strArr
as
$char
)
{
if
(
!
isset
(
$curNode
[
$char
]))
{
return
false
;
}
}
return
$curNode
[
'end'
]
??
false
;
}
}
\ No newline at end of file
mine/Mine.php
浏览文件 @
8164d5c2
...
...
@@ -21,7 +21,7 @@ class Mine
/**
* @var string
*/
private
static
string
$version
=
'1.
1.2
'
;
private
static
string
$version
=
'1.
3.0
'
;
/**
* @var string
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录