Skip to content

Commit 013c087

Browse files
committed
Merge branch 'develop'
2 parents f0a7d0c + 3854cdb commit 013c087

File tree

29 files changed

+139
-435
lines changed

29 files changed

+139
-435
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ Thumbs.db
88
/.vscode
99
/.settings
1010
/.buildpath
11-
/.project
11+
/.project
12+
/addons/*
13+
node_modules

LICENSE.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

2-
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
3-
版权所有Copyright © 2006-2023 by ThinkPHP (http://thinkphp.cn)
2+
YznCMS遵循Apache2开源协议发布,并提供免费使用。
3+
版权所有Copyright © 2017-2024 by YznCMS (https://www.yzncms.com)
44
All rights reserved。
5-
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
65

76
Apache Licence是著名的非盈利开源组织Apache采用的协议。
87
该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
### 系统基于ThinkPHP8.x后端+(Layui2.9.x+RequireJS)前端框架,承诺后台框架永久免费且商业授权无限制,更可移除前台版权信息,是个人和企业专享、高度自定义的理想后台管理系统选择。
33

44
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://gitee.com/ken678/YZNCMS/blob/master/LICENSE.txt)
5-
[![Version](https://img.shields.io/badge/YznCMS-2.0.0-brightgreen.svg)](https://gitee.com/ken678/YZNCMS/)
5+
[![Version](https://img.shields.io/badge/YznCMS-2.0.1-brightgreen.svg)](https://gitee.com/ken678/YZNCMS/)
66
[![star](https://gitee.com/ken678/YZNCMS/badge/star.svg?theme=dark)](https://gitee.com/ken678/YZNCMS/stargazers)
77
[![fork](https://gitee.com/ken678/YZNCMS/badge/fork.svg?theme=dark)](https://gitee.com/ken678/YZNCMS/members)
88

@@ -16,6 +16,10 @@
1616
- PHP版本:php >= 8.0 (推荐8.1+)
1717
- 数据库:MySQL >= 5.6 (需支持 innodb 引擎)
1818

19+
## [官方仓库]
20+
- Gitee:https://gitee.com/ken678/YZNCMS
21+
- GitHub:https://github.com/ken678/yzncms
22+
1923
## [插件版权]
2024
- 插件可用于个人或企业自营网站或为客户定制开发
2125
- 插件(包含免费和付费插件)禁止二次转售,复制和传播等形式分发插件源码
@@ -76,6 +80,7 @@
7680
|地区管理|省市区三级联动|免费|
7781
|图片处理|支持图片裁剪、旋转、水印等功能,图片处理必备插件|免费|
7882
|频率限制|限定用户在一段时间内的访问次数,用于保护接口防爬防爆破|免费|
83+
|TinyMCE富文本编辑器|一款易用、且功能强大的所见即所得的富文本编辑器|免费|
7984
|评论插件|类似多说,一段JS即可调用的强大评论|付费|
8085
|会员推广|生成推广链接,后台生成邀请码注册|付费|
8186
|通用数据导出|支持任意表和关联表导出excel等格式|付费|

app/admin/command/Crud.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ class Crud extends Command
109109
'auth_rule',
110110
'config',
111111
'field_type',
112-
'model',
113-
'model_field',
114112
'terms',
115113
'ems',
116114
'sms',

app/admin/command/Install/yzncms.sql

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -284,54 +284,6 @@ INSERT INTO `yzn_field_type` VALUES ('color', '颜色值', 21, 'varchar(7) NOT N
284284
INSERT INTO `yzn_field_type` VALUES ('city', '城市地区', 22, 'varchar(255) NOT NULL', 0, 0);
285285
INSERT INTO `yzn_field_type` VALUES ('custom', '自定义', 23, 'text NOT NULL', 1, 0);
286286

287-
-- ----------------------------
288-
-- Table structure for `yzn_model`
289-
-- ----------------------------
290-
DROP TABLE IF EXISTS `yzn_model`;
291-
CREATE TABLE `yzn_model` (
292-
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
293-
`module` varchar(15) NOT NULL DEFAULT '' COMMENT '所属模块',
294-
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '模型名称',
295-
`tablename` varchar(20) NOT NULL DEFAULT '' COMMENT '表名',
296-
`description` varchar(100) NOT NULL DEFAULT '' COMMENT '描述',
297-
`setting` text NOT NULL COMMENT '配置信息',
298-
`type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '模型类别:1-独立表,2-主附表',
299-
`create_time` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
300-
`update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
301-
`listorder` tinyint(3) NOT NULL DEFAULT '0' COMMENT '排序',
302-
`status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态',
303-
PRIMARY KEY (`id`)
304-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模型列表';
305-
306-
-- ----------------------------
307-
-- Table structure for `yzn_model_field`
308-
-- ----------------------------
309-
DROP TABLE IF EXISTS `yzn_model_field`;
310-
CREATE TABLE `yzn_model_field` (
311-
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
312-
`modelid` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '模型ID',
313-
`name` varchar(20) NOT NULL DEFAULT '' COMMENT '字段名',
314-
`title` varchar(30) NOT NULL DEFAULT '' COMMENT '别名',
315-
`remark` tinytext NULL COMMENT '字段提示',
316-
`pattern` varchar(255) NOT NULL DEFAULT '' COMMENT '数据校验正则',
317-
`errortips` varchar(255) NOT NULL DEFAULT '' COMMENT '数据校验未通过的提示信息',
318-
`type` varchar(20) NOT NULL DEFAULT '' COMMENT '字段类型',
319-
`extend` varchar(255) DEFAULT '' COMMENT '扩展信息',
320-
`setting` mediumtext NULL COMMENT '字段配置',
321-
`ifsystem` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否主表字段 1 是',
322-
`iscore` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否内部字段',
323-
`iffixed` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否固定不可修改',
324-
`ifrequire` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否必填',
325-
`ifsearch` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '作为搜索条件',
326-
`isadd` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '在投稿中显示',
327-
`create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
328-
`update_time` int(10) unsigned DEFAULT NULL COMMENT '更新时间',
329-
`listorder` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
330-
`status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态',
331-
PRIMARY KEY (`id`),
332-
KEY `name` (`name`,`modelid`)
333-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模型字段列表';
334-
335287
-- ----------------------------
336288
-- Table structure for `yzn_terms`
337289
-- ----------------------------

app/admin/controller/Index.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
class Index extends Backend
2929
{
30-
protected $noNeedLogin = ['login'];
31-
protected $noNeedRight = ['index', 'cache', 'logout'];
30+
protected $noNeedLogin = ['login', 'captcha'];
31+
protected $noNeedRight = ['index', 'cache', 'logout', 'captcha'];
3232

3333
//初始化
3434
protected function initialize()
@@ -163,4 +163,10 @@ public function cache()
163163
Event::trigger("wipecache_after");
164164
$this->success('清理缓存');
165165
}
166+
167+
//验证码
168+
public function captcha()
169+
{
170+
return \think\captcha\facade\Captcha::create();
171+
}
166172
}

app/admin/view/index/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<i class="layui-icon layui-icon-vercode"></i>
6161
</div>
6262
<input type="text" name="verify" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
63-
<img id="verify" src="{:rtrim('__PUBLIC__', '/')}/index.php/captcha" alt="验证码" class="captcha">
63+
<img id="verify" src="{:url('admin/index/captcha')}" alt="验证码" class="captcha">
6464
</div>
6565
</div>
6666
<!--@CaptchaEnd-->

app/common.php

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ function parse_attr(string $value = '')
213213
if (strpos($value, ':')) {
214214
$value = [];
215215
foreach ($array as $val) {
216-
[$k, $v] = explode(':', $val);
217-
$value[$k] = $v;
216+
[$k, $v] = explode(':', $val);
217+
$value[$k] = $v;
218218
}
219219
} else {
220220
$value = $array;
@@ -261,7 +261,7 @@ function human_date($time, $local = null)
261261
* @param string $delimiter 数字和单位分隔符
262262
* @return string 格式化后的带单位的大小
263263
*/
264-
function format_bytes(float|int $size, string $delimiter = ''): string
264+
function format_bytes(float | int $size, string $delimiter = ''): string
265265
{
266266
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
267267
for ($i = 0; $size >= 1024 && $i < 5; $i++) {
@@ -334,38 +334,6 @@ function genRandomString(int $len = 6): string
334334
}
335335
}
336336

337-
if (!function_exists('getModel')) {
338-
/**
339-
* 获取模型数据
340-
* @param type $modelid 模型ID
341-
* @param type $name 返回的字段,默认返回全部,数组
342-
* @return boolean
343-
*/
344-
function getModel($modelid, $name = '')
345-
{
346-
if (empty($modelid) || !is_numeric($modelid)) {
347-
return false;
348-
}
349-
$key = 'getModel_' . $modelid;
350-
/* 读取缓存数据 */
351-
$cache = Cache::get($key);
352-
if ($cache === 'false') {
353-
return false;
354-
}
355-
if (empty($cache)) {
356-
//读取数据
357-
$cache = Db::name('Model')->find($modelid);
358-
if (empty($cache)) {
359-
Cache::set($key, 'false', 60);
360-
return false;
361-
} else {
362-
Cache::set($key, $cache, 3600);
363-
}
364-
}
365-
return is_null($name) ? $cache : $cache[$name];
366-
}
367-
}
368-
369337
if (!function_exists('http_down')) {
370338
/**
371339
* 下载远程文件,默认保存在temp下
@@ -564,8 +532,8 @@ function hsv2rgb($h, $s, $v): array
564532
*/
565533
function letter_avatar(string $text): string
566534
{
567-
$total = unpack('L', hash('adler32', $text, true))[1];
568-
$hue = $total % 360;
535+
$total = unpack('L', hash('adler32', $text, true))[1];
536+
$hue = $total % 360;
569537
[$r, $g, $b] = hsv2rgb($hue / 360, 0.3, 0.9);
570538

571539
$bg = "rgb({$r},{$g},{$b})";
@@ -583,11 +551,11 @@ function letter_avatar(string $text): string
583551
* @param ?string $background 背景颜色
584552
* @return string
585553
*/
586-
function build_suffix_image(string $suffix, string $background = null): string
554+
function build_suffix_image(string $suffix, ?string $background = null): string
587555
{
588-
$suffix = mb_substr(strtoupper($suffix), 0, 4);
589-
$total = unpack('L', hash('adler32', $suffix, true))[1];
590-
$hue = $total % 360;
556+
$suffix = mb_substr(strtoupper($suffix), 0, 4);
557+
$total = unpack('L', hash('adler32', $suffix, true))[1];
558+
$hue = $total % 360;
591559
[$r, $g, $b] = hsv2rgb($hue / 360, 0.3, 0.9);
592560

593561
$background = $background ?: "rgb({$r},{$g},{$b})";
@@ -644,7 +612,7 @@ function check_cors_request()
644612
* @param bool $is_image
645613
* @return bool|string|string[]
646614
*/
647-
function xss_clean(array|string $content, bool $is_image = false)
615+
function xss_clean(array | string $content, bool $is_image = false)
648616
{
649617
return \app\common\library\Security::instance()->xss_clean($content, $is_image);
650618
}

0 commit comments

Comments
 (0)