diff --git a/.htaccess b/.htaccess deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 830d302..3fd0dc0 100644 --- a/README.md +++ b/README.md @@ -1,126 +1,42 @@ -目录结构 -========================= -www WEB部署目录(或者子目录) -├─app 应用目录 -│ ├─controller 控制器目录 -│ ├─model 模型目录 -│ ├─ ... 更多类库目录 -│ │ -│ ├─common.php 公共函数文件 -│ └─event.php 事件定义文件 -│ -├─config 配置目录 -│ ├─app.php 应用配置 -│ ├─cache.php 缓存配置 -│ ├─console.php 控制台配置 -│ ├─cookie.php Cookie配置 -│ ├─database.php 数据库配置 -│ ├─filesystem.php 文件磁盘配置 -│ ├─lang.php 多语言配置 -│ ├─log.php 日志配置 -│ ├─middleware.php 中间件配置 -│ ├─route.php URL和路由配置 -│ ├─session.php Session配置 -│ ├─trace.php Trace配置 -│ └─view.php 视图配置 -│ -├─view 视图目录 -├─route 路由定义目录 -│ ├─route.php 路由定义文件 -│ └─ ... -│ -├─public WEB目录(对外访问目录) -│ ├─index.php 入口文件 -│ ├─router.php 快速测试文件 -│ └─.htaccess 用于apache的重写 -│ -├─extend 扩展类库目录 -├─runtime 应用的运行时目录(可写,可定制) -├─vendor Composer类库目录 -├─.example.env 环境变量示例文件 -├─composer.json composer 定义文件 -├─LICENSE.txt 授权说明文件 -├─README.md README 文件 -├─think 命令行入口文件 +# phpAdmin 后台管理-教学版 (admin-thinkphp-layui-learning) +- [官网:http://www.ouyangke.com](http://www.ouyangke.com) +- [演示:admin-thinkphp-layui-learning.ouyangke.com](admin-thinkphp-layui-learning.ouyangke.com) -默认应用文件 -========================= -默认安装后,app目录下会包含下面的文件。 -├─app 应用目录 -│ │ -│ ├─BaseController.php 默认基础控制器类 -│ ├─ExceptionHandle.php 应用异常定义文件 -│ ├─common.php 全局公共函数文件 -│ ├─middleware.php 全局中间件定义文件 -│ ├─provider.php 服务提供定义文件 -│ ├─Request.php 应用请求对象 -│ └─event.php 全局事件定义文件 +## 一、介绍 -配置目录 -========================= -├─config(配置目录) -│ ├─app.php 应用配置 -│ ├─cache.php 缓存配置 -│ ├─console.php 控制台配置 -│ ├─cookie.php Cookie配置 -│ ├─database.php 数据库配置 -│ ├─filesystem.php 文件磁盘配置 -│ ├─lang.php 多语言配置 -│ ├─log.php 日志配置 -│ ├─middleware.php 中间件配置 -│ ├─route.php URL和路由配置 -│ ├─session.php Session配置 -│ ├─trace.php Trace配置 -│ ├─view.php 视图配置 -│ └─ ... 更多配置文件 -│ +- phpAdmin 后台管理,是我在教学时,为了使学生更好的学习,开发出来给学生使用。有不同的版本,请选择适合自己的。 +- [admin-thinkphp-antd-vue-learning 教学版](https://gitee.com/ouyangke_com/admin-thinkphp-antd-vue-learning):用于学习 php 的人群 + - 后端框架:Thinkphp6.1 + - 前端框架:Vue3 + - 前端样式:Ant Design Vue3.0 -ThinkPHP 6.0 -=============== +- [admin-thinkphp-layui-learning 教学版](https://gitee.com/ouyangke_com/admin-thinkphp-layui-learning):用于学习 php 的人群 + - 后端框架:Thinkphp6.1 + - Layui2.8 -> 运行环境要求PHP7.2+,兼容PHP8.1 +- [admin-thinkphp-layui-learning 配置版](https://gitee.com/ouyangke_com/admin-thinkphp-layui-config):快速搭建项目后台,用于各行业,是一个高级版本,适合有基础的人,不适合学习,请学生下载教学版。 + - 后端框架:Thinkphp6.1 + - Layui2.8 -[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api) +## 二、安装教程 -ThinkPHPV6.0版本由[亿速云](https://www.yisu.com/)独家赞助发布。 +- [根据 Thinkphp6 安装](https://www.kancloud.cn/manual/thinkphp6_0/1037479) -## 主要新特性 +## 三、使用说明 -* 采用`PHP7`强类型(严格模式) -* 支持更多的`PSR`规范 -* 原生多应用支持 -* 更强大和易用的查询 -* 全新的事件系统 -* 模型事件和数据库事件统一纳入事件系统 -* 模板引擎分离出核心 -* 内部功能中间件化 -* SESSION/Cookie机制改进 -* 对Swoole以及协程支持改进 -* 对IDE更加友好 -* 统一和精简大量用法 +- 1、域名指向 public 目录下 +- 2、后台管理系统访问网址:http://www.xxx.com/index.php/bews/index/index +## 四、鸣谢 +- [PHP 中文网](https://www.php.cn) +- [Thinkphp](http://www.thinkphp.cn) +- [Layui](https://layui.dev) -## 文档 +## 五、技术支持 -[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content) - -## 参与开发 - -请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。 - -## 版权信息 - -ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 - -本项目包含的第三方源码和二进制文件之版权信息另行标注。 - -版权所有Copyright © 2006-2021 by ThinkPHP (http://thinkphp.cn) - -All rights reserved。 - -ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 - -更多细节参阅 [LICENSE.txt](LICENSE.txt) +- QQ:428188207 +- 所有版本都是免费的,有问题可以及时向我反馈 +- 请珍惜劳动成果 diff --git a/admin-thinkphp-layui-learning.sql b/admin-thinkphp-layui-learning.sql new file mode 100644 index 0000000..ddc9eee --- /dev/null +++ b/admin-thinkphp-layui-learning.sql @@ -0,0 +1,354 @@ +/* + Navicat MySQL Data Transfer + + Source Server : php + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : 127.0.0.1:3306 + Source Schema : admin-thinkphp-layui-learning + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 28/04/2022 14:37:03 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for bew_admin_config +-- ---------------------------- +DROP TABLE IF EXISTS `bew_admin_config`; +CREATE TABLE `bew_admin_config` ( + `config_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '系统设置ID', + `config_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '功能名,代码参照使用', + `config_info` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '中文名', + `config_type` tinyint(4) UNSIGNED NOT NULL DEFAULT 1 COMMENT '类型 1文本 2图片 3富文本', + `config_value` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '值', + `config_desc` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述', + `config_sort` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `config_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态 1启用 0禁用', + PRIMARY KEY (`config_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '配置表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of bew_admin_config +-- ---------------------------- +INSERT INTO `bew_admin_config` VALUES (1, 'admin_domain', '本地域名', 1, 'http://admin-thinkphp-layui-learning.ouyangke.com', '项目域名', 0, 1); +INSERT INTO `bew_admin_config` VALUES (2, 'admin_route', '项目路径', 1, '/index.php/bews/', '后台项目路径', 0, 1); +INSERT INTO `bew_admin_config` VALUES (3, 'admin_name', '系统名称', 1, 'phpAdmin后台管理', '后台系统名称,在后台显示', 0, 1); +INSERT INTO `bew_admin_config` VALUES (4, 'admin_page', '每页数量', 1, '10', '列表数据,每页数量', 0, 1); +INSERT INTO `bew_admin_config` VALUES (5, 'logo', 'logo', 2, '/static/bews/images/logo.jpg', '请上传logo', 0, 1); +INSERT INTO `bew_admin_config` VALUES (6, 'admin_info', '系统介绍', 3, '', '系统介绍', 0, 1); + +-- ---------------------------- +-- Table structure for bew_admin_sys_menu +-- ---------------------------- +DROP TABLE IF EXISTS `bew_admin_sys_menu`; +CREATE TABLE `bew_admin_sys_menu` ( + `smid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', + `label` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '菜单名称', + `type` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '菜单类型,0:分组,1:内部链接,2:超链接,3:隐藏按钮', + `src` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接源', + `parent_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级菜单ID', + `icon_class` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标class', + `sort` mediumint(6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序值,升序', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态 1开启 0关闭', + PRIMARY KEY (`smid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 8003 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '左侧菜单' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of bew_admin_sys_menu +-- ---------------------------- +INSERT INTO `bew_admin_sys_menu` VALUES (1, '项目核心', 0, '', 0, 'layui-icon-template-1', 999999, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (2, '项目配置', 1, 'bew/configvalue', 1, 'layui-icon-set-fill', 100, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (3, '配置管理', 3, 'bew/configlist', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (4, '配置添加', 3, 'bew/configadd', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5, '配置修改', 3, 'bew/configedit', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (6, '配置删除', 3, 'bew/configdel', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (10, '导航管理', 1, 'bew/menuinfo', 1, 'layui-icon-layer', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (11, '导航添加', 3, 'bew/menuadd', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (12, '导航修改', 3, 'bew/menuedit', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (13, '导航删除', 3, 'bew/menudel', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (14, '按钮列表', 3, 'bew/buttoninfo', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (15, '按钮添加', 3, 'bew/buttonadd', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (16, '按钮修改', 3, 'bew/buttonedit', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (17, '按钮删除', 3, 'bew/buttondel', 1, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5000, '系统配置', 0, '', 0, 'layui-icon-set', 999996, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5002, '部门管理', 1, 'bewadmin/groupinfo', 5000, 'layui-icon-group', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5003, '管理员管理', 1, 'bewadmin/userinfo', 5000, 'layui-icon-username', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5004, '个人中心', 1, 'bewadmin/admininfo', 5000, 'layui-icon-edit', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5005, '部门添加', 3, 'bewadmin/groupadd', 5000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5006, '部门修改', 3, 'bewadmin/groupedit', 5000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5007, '部门删除', 3, 'bewadmin/groupdel', 5000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5008, '管理员添加', 3, 'bewadmin/useradd', 5000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5009, '管理员修改', 3, 'bewadmin/useredit', 5000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (5010, '管理员删除', 3, 'bewadmin/userdel', 5000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7000, '代码示例', 0, '', 0, 'layui-icon-app', 999995, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7001, '图标', 1, 'bewtest/icon_list', 7000, 'layui-icon-theme', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7002, '演示列表-方法渲染', 1, 'bewtest/test_list', 7000, 'layui-icon-list', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7003, '演示列表-静态表格', 1, 'bewtest/test_static_list', 7000, 'layui-icon-list', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7004, '演示添加-方法渲染', 3, 'bewtest/test_add', 7000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7005, '演示修改-方法渲染', 3, 'bewtest/test_edit', 7000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7006, '演示添加-静态表格', 3, 'bewtest/test_static_add', 7000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (7007, '演示修改-静态表格', 3, 'bewtest/test_static_edit', 7000, NULL, 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (8000, '友情链接', 0, NULL, 0, 'layui-icon-link', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (8001, '欧阳克博客', 2, 'http://www.ouyangke.com', 8000, 'layui-icon-link', 0, 1); +INSERT INTO `bew_admin_sys_menu` VALUES (8002, 'php中文网', 2, 'https://www.php.cn', 8000, 'layui-icon-link', 0, 1); + +-- ---------------------------- +-- Table structure for bew_admin_user +-- ---------------------------- +DROP TABLE IF EXISTS `bew_admin_user`; +CREATE TABLE `bew_admin_user` ( + `uid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `account` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账号邮箱', + `password` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码', + `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '姓名', + `phone` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号', + `qq` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'QQ号', + `sex` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别 0未知 1男 2女', + `group_id` int(10) UNSIGNED NOT NULL COMMENT '分组ID', + `times_login` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登陆次数', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态 1开启 0禁用', + `time_add` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `time_last` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '最后更新时间', + PRIMARY KEY (`uid`) USING BTREE, + UNIQUE INDEX `one_account`(`account`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of bew_admin_user +-- ---------------------------- +INSERT INTO `bew_admin_user` VALUES (1, '428188207@qq.com', 'e10adc3949ba59abbe56e057f20f883e', '欧阳克', '0', '428188207', 1, 1, 274, 1, 1564124524, 1651804007); + +-- ---------------------------- +-- Table structure for bew_admin_user_group +-- ---------------------------- +DROP TABLE IF EXISTS `bew_admin_user_group`; +CREATE TABLE `bew_admin_user_group` ( + `group_id` int(11) NOT NULL AUTO_INCREMENT, + `group_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '部门名', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否生效', + `time_add` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', + `rights` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '角色权限,json', + PRIMARY KEY (`group_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组管理' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of bew_admin_user_group +-- ---------------------------- +INSERT INTO `bew_admin_user_group` VALUES (1, '管理', 1, 1564124524, '[1,2,10,3,4,5,6,15,11,12,13,14,17,16,5000,5004,5003,5002,5010,5009,5008,5007,5006,5005,8000,8002,8001,7000,7003,7002,7001,7007,7006,7005,7004]'); + +-- ---------------------------- +-- Table structure for bew_z_iconfont +-- ---------------------------- +DROP TABLE IF EXISTS `bew_z_iconfont`; +CREATE TABLE `bew_z_iconfont` ( + `icon_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '图标ID', + `icon_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标名称', + `icon_css` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标css', + `icon_html` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图标html', + `icon_source` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '来源 1layui', + `status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态 1开启 0关闭', + PRIMARY KEY (`icon_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 169 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '图标库' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of bew_z_iconfont +-- ---------------------------- +INSERT INTO `bew_z_iconfont` VALUES (1, '实心', 'layui-icon-heart-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (2, '空心', 'layui-icon-heart', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (3, '亮度/晴', 'layui-icon-light', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (4, '时间/历史', 'layui-icon-time', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (5, '蓝牙', 'layui-icon-bluetooth', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (6, '@艾特', 'layui-icon-at', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (7, '静音', 'layui-icon-mute', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (8, '录音/麦克风', 'layui-icon-mike', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (9, '密钥/钥匙', 'layui-icon-key', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (10, '礼物/活动', 'layui-icon-gift', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (11, '邮箱', 'layui-icon-email', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (12, 'RSS', 'layui-icon-rss', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (13, 'WiFi', 'layui-icon-wifi', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (14, '退出/注销', 'layui-icon-logout', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (15, 'Android 安卓', 'layui-icon-android', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (16, 'Apple IOS 苹果', 'layui-icon-ios', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (17, 'Windows', 'layui-icon-windows', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (18, '穿梭框', 'layui-icon-transfer', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (19, '客服', 'layui-icon-service', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (20, '减', 'layui-icon-subtraction', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (21, '加', 'layui-icon-addition', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (22, '滑块', 'layui-icon-slider', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (23, '打印', 'layui-icon-print', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (24, '导出', 'layui-icon-export', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (25, '列', 'layui-icon-cols', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (26, '退出全屏', 'layui-icon-screen-restore', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (27, '全屏', 'layui-icon-screen-full', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (28, '半星', 'layui-icon-rate-half', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (29, '星星-空心', 'layui-icon-rate', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (30, '星星-实心', 'layui-icon-rate-solid', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (31, '手机', 'layui-icon-cellphone', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (32, '验证码', 'layui-icon-vercode', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (33, '微信', 'layui-icon-login-wechat', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (34, 'QQ', 'layui-icon-login-qq', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (35, '微博', 'layui-icon-login-weibo', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (36, '密码', 'layui-icon-password', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (37, '用户名', 'layui-icon-username', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (38, '刷新-粗', 'layui-icon-refresh-3', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (39, '授权', 'layui-icon-auz', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (40, '左向右伸缩菜单', 'layui-icon-spread-left', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (41, '右向左伸缩菜单', 'layui-icon-shrink-right', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (42, '雪花', 'layui-icon-snowflake', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (43, '提示说明', 'layui-icon-tips', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (44, '便签', 'layui-icon-note', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (45, '主页', 'layui-icon-home', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (46, '高级', 'layui-icon-senior', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (47, '刷新', 'layui-icon-refresh', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (48, '刷新', 'layui-icon-refresh-1', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (49, '旗帜', 'layui-icon-flag', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (50, '主题', 'layui-icon-theme', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (51, '消息-通知', 'layui-icon-notice', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (52, '网站', 'layui-icon-website', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (53, '控制台', 'layui-icon-console', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (54, '表情-惊讶', 'layui-icon-face-surprised', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (55, '设置-空心', 'layui-icon-set', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (56, '模板', 'layui-icon-template-1', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (57, '应用', 'layui-icon-app', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (58, '模板', 'layui-icon-template', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (59, '赞', 'layui-icon-praise', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (60, '踩', 'layui-icon-tread', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (61, '男', 'layui-icon-male', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (62, '女', 'layui-icon-female', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (63, '相机-空心', 'layui-icon-camera', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (64, '相机-实心', 'layui-icon-camera-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (65, '菜单-水平', 'layui-icon-more', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (66, '菜单-垂直', 'layui-icon-more-vertical', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (67, '金额-人民币', 'layui-icon-rmb', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (68, '金额-美元', 'layui-icon-dollar', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (69, '钻石-等级', 'layui-icon-diamond', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (70, '火', 'layui-icon-fire', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (71, '返回', 'layui-icon-return', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (72, '位置-地图', 'layui-icon-location', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (73, '办公-阅读', 'layui-icon-read', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (74, '调查', 'layui-icon-survey', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (75, '表情-微笑', 'layui-icon-face-smile', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (76, '表情-哭泣', 'layui-icon-face-cry', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (77, '购物车', 'layui-icon-cart-simple', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (78, '购物车', 'layui-icon-cart', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (79, '下一页', 'layui-icon-next', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (80, '上一页', 'layui-icon-prev', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (81, '上传-空心-拖拽', 'layui-icon-upload-drag', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (82, '上传-实心', 'layui-icon-upload', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (83, '下载-圆圈', 'layui-icon-download-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (84, '组件', 'layui-icon-component', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (85, '文件-粗', 'layui-icon-file-b', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (86, '用户', 'layui-icon-user', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (87, '发现-实心', 'layui-icon-find-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (88, 'loading', 'layui-icon-loading', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (89, 'loading', 'layui-icon-loading-1', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (90, '添加', 'layui-icon-add-1', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (91, '播放', 'layui-icon-play', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (92, '暂停', 'layui-icon-pause', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (93, '音频-耳机', 'layui-icon-headset', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (94, '视频', 'layui-icon-video', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (95, '语音-声音', 'layui-icon-voice', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (96, '消息-通知-喇叭', 'layui-icon-speaker', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (97, '删除线', 'layui-icon-fonts-del', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (98, '代码', 'layui-icon-fonts-code', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (99, 'HTML', 'layui-icon-fonts-html', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (100, '字体加粗', 'layui-icon-fonts-strong', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (101, '删除链接', 'layui-icon-unlink', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (102, '图片', 'layui-icon-picture', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (103, '链接', 'layui-icon-link', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (104, '表情-笑-粗', 'layui-icon-face-smile-b', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (105, '左对齐', 'layui-icon-align-left', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (106, '右对齐', 'layui-icon-align-right', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (107, '居中对齐', 'layui-icon-align-center', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (108, '字体-下划线', 'layui-icon-fonts-u', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (109, '字体-斜体', 'layui-icon-fonts-i', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (110, 'Tabs 选项卡', 'layui-icon-tabs', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (111, '单选框-选中', 'layui-icon-radio', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (112, '单选框-候选', 'layui-icon-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (113, '编辑', 'layui-icon-edit', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (114, '分享', 'layui-icon-share', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (115, '删除', 'layui-icon-delete', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (116, '表单', 'layui-icon-form', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (117, '手机-细体', 'layui-icon-cellphone-fine', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (118, '聊天 对话 沟通', 'layui-icon-dialogue', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (119, '文字格式化', 'layui-icon-fonts-clear', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (120, '窗口', 'layui-icon-layer', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (121, '日期', 'layui-icon-date', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (122, '水 下雨', 'layui-icon-water', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (123, '代码-圆圈', 'layui-icon-code-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (124, '轮播组图', 'layui-icon-carousel', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (125, '翻页', 'layui-icon-prev-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (126, '布局', 'layui-icon-layouts', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (127, '工具', 'layui-icon-util', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (128, '选择模板', 'layui-icon-templeate-1', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (129, '上传-圆圈', 'layui-icon-upload-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (130, '树', 'layui-icon-tree', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (131, '表格', 'layui-icon-table', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (132, '图表', 'layui-icon-chart', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (133, '图标 报表 屏幕', 'layui-icon-chart-screen', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (134, '引擎', 'layui-icon-engine', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (135, '下三角', 'layui-icon-triangle-d', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (136, '右三角', 'layui-icon-triangle-r', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (137, '文件', 'layui-icon-file', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (138, '设置-小型', 'layui-icon-set-sm', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (139, '减少-圆圈', 'layui-icon-reduce-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (140, '添加-圆圈', 'layui-icon-add-circle', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (141, '404', 'layui-icon-404', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (142, '关于', 'layui-icon-about', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (143, '箭头 向上', 'layui-icon-up', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (144, '箭头 向下', 'layui-icon-down', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (145, '箭头 向左', 'layui-icon-left', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (146, '箭头 向右', 'layui-icon-right', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (147, '圆点', 'layui-icon-circle-dot', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (148, '搜索', 'layui-icon-search', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (149, '设置-实心', 'layui-icon-set-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (150, '群组', 'layui-icon-group', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (151, '好友', 'layui-icon-friends', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (152, '回复 评论 实心', 'layui-icon-reply-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (153, '菜单 隐身 实心', 'layui-icon-menu-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (154, '记录', 'layui-icon-log', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (155, '图片-细体', 'layui-icon-picture-fine', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (156, '表情-笑-细体', 'layui-icon-face-smile-fine', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (157, '列表', 'layui-icon-list', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (158, '发布 纸飞机', 'layui-icon-release', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (159, '对 OK', 'layui-icon-ok', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (160, '帮助', 'layui-icon-help', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (161, '客服', 'layui-icon-chat', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (162, 'top 置顶', 'layui-icon-top', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (163, '收藏-空心', 'layui-icon-star', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (164, '收藏-实心', 'layui-icon-star-fill', '', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (165, '关闭-实心', 'layui-icon-close-fill', 'ဇ', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (166, '关闭-空心', 'layui-icon-close', 'ဆ', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (167, '正确', 'layui-icon-ok-circle', 'စ', 1, 1); +INSERT INTO `bew_z_iconfont` VALUES (168, '添加-圆圈-细体', 'layui-icon-add-circle-fine', '', 1, 1); + +-- ---------------------------- +-- Table structure for bew_z_test +-- ---------------------------- +DROP TABLE IF EXISTS `bew_z_test`; +CREATE TABLE `bew_z_test` ( + `test_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', + `test_input` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文本', + `test_rich` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '富文本', + `test_rich_baidu` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '百度富文本', + `test_img` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '图片', + `test_reference` tinyint(1) UNSIGNED NULL DEFAULT NULL COMMENT '参照', + `test_time` int(10) UNSIGNED NULL DEFAULT NULL COMMENT '时间戳', + `test_data` date NULL DEFAULT NULL COMMENT '日期', + `test_datatime` datetime NULL DEFAULT NULL COMMENT '日期时间', + `test_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网址', + PRIMARY KEY (`test_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '演示表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of bew_z_test +-- ---------------------------- +INSERT INTO `bew_z_test` VALUES (1, '输入框', '富文本', '百度富文本', '/static/bews/images/logo.jpg', 1, 1618848000, '2021-04-21', '2021-04-22 00:00:00', 'http://www.ouyangke.cn'); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/app/AppApi.php b/app/AppApi.php new file mode 100644 index 0000000..e0076b4 --- /dev/null +++ b/app/AppApi.php @@ -0,0 +1,38 @@ + '系统错误,请稍后重试', + #############系统后台使用############## + '90000001' => '管理员账户不能为空', + '90000002' => '真实姓名不能为空', + '90000003' => '手机号不能为空', + '90000004' => '角色不能为空', + '90000005' => '密码不能为空', + '90000006' => '管理员账户要用邮箱', + '90000007' => '管理员账户已存在', + '90000008' => '角色名称不能为空', + '90000009' => '导航名称不能为空', + '90000010' => '导航下还有数据', + '90000011' => '请选择类型', + '90000012' => '内部代码不能为空', + '90000013' => '链接地址不能为空', + '90000015' => '按钮名称不能为空', + '90000029' => '管理员账户不存在', + '90000030' => '管理员已被禁用', + '90000031' => '密码不正确', + + '91000001' => '添加失败', + '91000002' => '修改失败', + '91000003' => '删除失败', + '91000004' => '未改变数据', + '91000005' => '未查询到数据', + '91000006' => '失败', + ); + return $array[$code]; + } +} \ No newline at end of file diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php new file mode 100644 index 0000000..400bf09 --- /dev/null +++ b/app/admin/controller/Base.php @@ -0,0 +1,180 @@ +config = $YzAdminConfig->getAll(); + # 获取账户,账户判断 + $this->adminId = Cookie::get('admin_id'); + if(empty($this->adminId)){ + header('Location:'.$this->config['admin_route'].'Login/index'); + exit; + } + $this->aUser = Db::table('yz_admin_user')->where('uid',$this->adminId)->find(); + + if (empty($this->aUser)) { + Cookie::delete('admin_id'); + $this->error('管理员账户不存在'); + } + if ($this->aUser['status'] != 1) { + Cookie::delete('admin_id'); + $this->error('管理员已被禁用'); + } + # 获取用户组权限 + $group = Db::table('yz_admin_user_group')->where(['group_id'=>$this->aUser['group_id']])->find(); + if(empty($group)){ + $this->error('对不起,您没有权限'); + } + # 获取当前链接,查询是否有权限 + $controller = request()->controller(); + $action = request()->action(); + $key = $controller.'/'.$action; + + // // 演示站专用 + // if(Request::isPost()){ + // if( + // $key == 'Yunzer/configvalue' || + // $key == 'Yunzer/configadd' || + // $key == 'Yunzer/configedit' || + // $key == 'Yunzer/configdel' || + // $key == 'Yunzer/menuadd' || + // $key == 'Yunzer/menuedit' || + // $key == 'Yunzer/menudel' || + // $key == 'Yunzer/buttonadd' || + // $key == 'Yunzer/buttonedit' || + // $key == 'Yunzer/buttondel' || + // $key == 'Yunzeradmin/groupadd' || + // $key == 'Yunzeradmin/groupedit' || + // $key == 'Yunzeradmin/groupdel' || + // $key == 'Yunzeradmin/useradd' || + // $key == 'Yunzeradmin/useredit' || + // $key == 'Yunzeradmin/userdel' || + // $key == 'Yunzeradmin/admininfo' || + // $key == 'Yunzeradmin/test_add' || + // $key == 'Yunzeradmin/test_edit' || + // $key == 'Yunzeradmin/test_static_add' || + // $key == 'Yunzeradmin/test_static_edit' || + // $key == 'Index/upload_img' || + // $key == 'Index/upload_img_s' || + // $key == 'Index/upload_imgs_kin' + // ){ + // $this->returnCode(1,'演示站,不能操作'); + // } + // } + // // 演示站专用 + + // if($key == 'Index/index' || $key == 'Index/welcome'){ + + // }else{ + // $aMenu = Db::table('yz_admin_sys_menu')->where('src',$key)->find(); + // if(empty($aMenu)){ + // $this->error('对不起,您访问的功能不存在'); + // } + // $rights = json_decode($group['rights']); + // if(!in_array($aMenu['smid'],$rights)){ + // $this->error('对不起,您没有权限'); + // } + // } + View::assign([ + 'aUser' => $this->aUser, + 'config' => $this->config + ]); + } + /** + * 返回json对象 + */ + protected function returnCode($code,$data=[],$count=10){ + header('Content-type:application/json'); + if($code == 0){ + $arr = array( + 'code'=>$code, + 'msg'=>'成功', + 'count'=> $count, + 'data' => $data + ); + }else if($code >= 1 && $code <= 100){ + $arr = array( + 'code' => $code, + 'msg' => $data + ); + }else{ + $appapi = new AppApi(); + $arr = array( + 'code'=>$code, + 'msg'=>$appapi::errorTip($code) + ); + } + echo json_encode($arr); + if($code != 0){ + exit; + } + } + + /** + * 操作成功跳转的快捷方法 + * @access protected + * @param mixed $msg 提示信息 + * @return void + */ + protected function success($msg = '') + { + $result = [ + 'code' => 1, + 'msg' => $msg + ]; + + $type = $this->getResponseType(); + if ($type == 'html'){ + $response = view(Config::get('app.dispatch_success_tmpl'), $result); + } else if ($type == 'json') { + $response = json($result); + } + throw new HttpResponseException($response); + } + + /** + * 操作错误跳转的快捷方法 + * @access protected + * @param mixed $msg 提示信息 + * @return void + */ + protected function error($msg = '') + { + $result = [ + 'code' => 0, + 'msg' => $msg + ]; + $response = view(Config::get('app.dispatch_error_tmpl'), $result); + throw new HttpResponseException($response); + } + + /** + * 获取当前的response 输出类型 + * @access protected + * @return string + */ + protected function getResponseType() + { + return Request::isJson() || Request::isAjax() ? 'json' : 'html'; + } +} \ No newline at end of file diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 263ccdd..d851ffa 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -1,17 +1,206 @@ $this->aUser['group_id']]; + $role = Db::table('yz_admin_user_group')->where($where)->find(); + if($role){ + $role['rights'] = (isset($role['rights']) && $role['rights']) ? json_decode($role['rights'],true) : []; + } + if($role['rights']){ + $where = [ + ['smid','in',implode(',',$role['rights']) ], + ['status','=',1] + ]; + // 获取所有菜单 + $menus = Db::table('yz_admin_sys_menu')->order('type,sort desc')->where($where)->select()->toArray(); + + // 构建树形结构菜单 + $menuTree = []; + $menuMap = []; + + // 先将所有菜单项映射到一个关联数组中 + foreach($menus as $item){ + $item['children'] = []; + $menuMap[$item['smid']] = $item; + } + + // 构建树形结构 + foreach($menus as $item){ + if($item['parent_id'] == 0){ + // 顶级菜单 + $menuTree[$item['smid']] = &$menuMap[$item['smid']]; + }else{ + // 子菜单,添加到父菜单的children数组中 + if(isset($menuMap[$item['parent_id']])){ + $menuMap[$item['parent_id']]['children'][] = &$menuMap[$item['smid']]; + } + } + } + + $menu = $menuTree; + } + + View::assign([ + 'role' => $role, + 'menu' => $menu + ]); + return View::fetch(); + } + # 欢迎页面 + public function welcome(){ + View::assign([ + 'time' => date('Y-m-d',$_SERVER['REQUEST_TIME']), + ]); + return View::fetch(); + } -class Index extends BaseController -{ - public function index() - { - return '

:)

ThinkPHP V' . \think\facade\App::version() . '
16载初心不改 - 你值得信赖的PHP框架 Admin模块

[ V6.0 版本由 亿速云 独家赞助发布 ]
'; - } + /** + * 保存附件信息到数据库 + * @param string $name 文件名 + * @param int $type 附件类型 + * @param int $size 文件大小 + * @param string $src 文件路径 + * @return int 附件ID + */ + private function saveAttachment($name, $type, $size, $src) { + $data = [ + 'name' => $name, + 'type' => $type, + 'size' => $size, + 'src' => $src, + 'create_time' => time(), + 'update_time' => time() + ]; + return Db::table('yz_attachments')->insertGetId($data); + } - public function hello($name = 'ThinkPHP6') - { - return 'hello,' . $name; - } -} + # 图片上传 + public function upload_img(){ + // 获取上传的文件 + $file = request()->file(); + $files = request()->file('file'); + + // 检查是否有文件上传 + if(empty($file)){ + return json(['code'=>1, 'msg'=>'没有文件上传'])->send(); + } + + try { + // 验证上传的文件 + validate([ + 'image'=>'filesize:10240|fileExt:jpg,png,gif,jpeg' + ])->check($file); + + // 存储文件到public磁盘的uploads目录 + $info = \think\facade\Filesystem::disk('public')->putFile('uploads', $files); + + // 处理文件路径,统一使用正斜杠 + $info = str_replace("\\", "/", $info); + $img = '/storage/'.$info; + + // 保存附件信息 + $fileName = $files->getOriginalName(); + $fileSize = $files->getSize(); + $attachmentId = $this->saveAttachment($fileName, 1, $fileSize, $img); + + // 返回成功信息 + return json([ + 'code' => 0, + 'data' => $img, + 'url' => $this->config['admin_domain'].$img, + 'attachment_id' => $attachmentId + ])->send(); + + } catch (\think\exception\ValidateException $e) { + // 捕获验证异常并返回错误信息 + return json(['code'=>1, 'msg'=>$e->getMessage()])->send(); + } catch (\Exception $e) { + // 捕获其他异常 + return json(['code'=>1, 'msg'=>'上传失败:'.$e->getMessage()])->send(); + } + } + # 富文本图片上传 + public function upload_imgs(){ + $file = request()->file(); + $files = request()->file('file'); + if(empty($file)){ + return json(['code'=>1, 'msg'=>'没有文件上传'])->send(); + } + try { + validate(['image'=>'filesize:10240|fileExt:jpg,png,gif,jpeg'])->check($file); + $info = \think\facade\Filesystem::disk('public')->putFile('uploads', $files); + + // 处理文件路径 + $info = str_replace("\\", "/", $info); + $img = '/storage/'.$info; + + // 保存附件信息 + $fileName = $files->getOriginalName(); + $fileSize = $files->getSize(); + $attachmentId = $this->saveAttachment($fileName, 2, $fileSize, $img); + + return json([ + 'code' => 0, + 'data' => [ + 'src' => $img, + 'attachment_id' => $attachmentId + ] + ])->send(); + } catch (\think\exception\ValidateException $e) { + return json(['code'=>1, 'msg'=>$e->getMessage()])->send(); + } + } + # 富文本图片上传 + public function upload_imgs_kin(){ + $file = request()->file(); + $files = request()->file('imgFile'); + + if(empty($file)){ + return json(['error'=>1, 'message'=>'没有文件上传'])->send(); + } + try { + validate(['image'=>'filesize:10240|fileExt:jpg,png,gif,jpeg'])->check($file); + $info = \think\facade\Filesystem::disk('public')->putFile('uploads', $files); + + // 处理文件路径 + $info = str_replace("\\", "/", $info); + $img = '/storage/'.$info; + + // 保存附件信息 + $fileName = $files->getOriginalName(); + $fileSize = $files->getSize(); + $attachmentId = $this->saveAttachment($fileName, 3, $fileSize, $img); + + return json([ + 'error' => 0, + 'url' => $img, + 'attachment_id' => $attachmentId + ])->send(); + } catch (\think\exception\ValidateException $e) { + return json(['error'=>1, 'message'=>$e->getMessage()])->send(); + } + } + # 清除缓存 + public function clear(){ + $a = delete_dir_file(Env::get('runtime_path').'cache/'); + $b = delete_dir_file(Env::get('runtime_path').'temp/'); + if ($a || $b) { + $this->returnCode(0); + } else { + $this->returnCode('91000006'); + } + } +} \ No newline at end of file diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php new file mode 100644 index 0000000..d57aae1 --- /dev/null +++ b/app/admin/controller/Login.php @@ -0,0 +1,104 @@ +config = $YzAdminConfig->getAll(); + View::assign([ + 'config' => $this->config + ]); + return View::fetch(); + } + public function login() + { + if (Request::isPost()) { + $account = trim(input('post.account')); + if (empty($account)) { + $this->returnCode('90000001'); + } + $pattern = "/^([0-9A-Za-z-_.]+)@([0-9a-z]+.[a-z]{2,3}(.[a-z]{2})?)$/i"; + if (!preg_match($pattern, $account)) { + $this->returnCode('90000006'); + } + $password = trim(input('post.password')); + if (empty($password)) { + $this->returnCode(1, '密码不能为空'); + } + $code = trim(input('post.code')); + if ($code == '') { + $this->returnCode(1, '验证码不能为空'); + } + if (!captcha_check($code)) { + $this->returnCode(1, '验证码错误'); + } + $aUser = Db::table('yz_admin_user')->where('account', $account)->find(); + if (empty($aUser)) { + $this->returnCode('90000029'); + } + if ($aUser['status'] != 1) { + $this->returnCode('90000030'); + } + if ($aUser['password'] != md5($password)) { + $this->returnCode('90000031'); + } + $remember = input('post.remember'); + if (!empty($remember)) { + Cookie::set('admin_id', $aUser['uid'], 60 * 60 * 24 * 7); + Cookie::set('admin_name', $aUser['name'], 60 * 60 * 24 * 7); + } else { + Cookie::set('admin_id', $aUser['uid']); + Cookie::set('admin_name', $aUser['name']); + } + Db::table('yz_admin_user')->where('uid', $aUser['uid'])->update( + ['login_count' => $aUser['login_count'] + 1, 'update_time' => time()] + ); + $this->returnCode(0, [], '登陆成功'); + } + } + public function logout() + { + Cookie::delete('admin_id'); + Cookie::delete('admin_name'); + $this->returnCode(0, [], '退出成功'); + } + protected function returnCode($code, $data = [], $msg = '') + { + header('Content-type:application/json'); + if ($code == 0) { + $arr = array( + 'code' => $code, + 'msg' => $msg, + 'data' => $data + ); + } else if ($code == 1) { + $arr = array( + 'code' => 1, + 'msg' => $data + ); + } else { + $appapi = new AppApi(); + $arr = array( + 'code' => $code, + 'msg' => $appapi::errorTip($code) + ); + } + echo json_encode($arr); + if ($code != 0) { + exit; + } + } +} \ No newline at end of file diff --git a/app/admin/controller/Yunzer.php b/app/admin/controller/Yunzer.php new file mode 100644 index 0000000..f39435b --- /dev/null +++ b/app/admin/controller/Yunzer.php @@ -0,0 +1,345 @@ +where('parent_id',0)->order('sort DESC,smid DESC')->select(); + View::assign([ + 'lists' => $lists + ]); + return View::fetch(); + } + # 菜单添加 + public function menuadd(){ + $req = request(); + if($req->isPost()){ + $data['label'] = trim(input('post.label')); + if(empty($data['label'])){ + View::returnCode('90000009'); + } + $data['icon_class'] = trim(input('post.icon_class')); + $data['sort'] = (int)trim(input('post.sort')); + $data['status'] = (int)trim(input('post.status')); + $data['type'] = (int)trim(input('post.type',0)); + if($data['type'] == 1){ + $data['src'] = trim(input('post.src1')); + if(empty($data['src'])){ + $this->returnCode('90000012'); + } + }else if($data['type'] == 2){ + $data['src'] = trim(input('post.src2')); + if(empty($data['src'])){ + $this->returnCode('90000013'); + } + }else{ + $data['src'] = ''; + } + // 保存用户 + $res = Db::table('yz_admin_sys_menu')->insert($data); + if(!$res){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + $iconfont = Db::table('yz_z_iconfont')->where('status',1)->select(); + View::assign([ + 'iconfont' => $iconfont + ]); + return View::fetch(); + } + } + # 菜单修改 + public function menuedit(){ + $req = request(); + if($req->isPost()){ + $smid = (int)input('post.smid'); + $data['label'] = trim(input('post.label')); + if(!$data['label']){ + $this->returnCode('90000009'); + } + $data['icon_class'] = trim(input('post.icon_class')); + $data['sort'] = (int)trim(input('post.sort')); + $data['status'] = (int)trim(input('post.status')); + $data['type'] = (int)trim(input('post.type',0)); + if($data['type'] == 1){ + $data['src'] = trim(input('post.src1')); + if(empty($data['src'])){ + $this->returnCode('90000012'); + } + }else if($data['type'] == 2){ + $data['src'] = trim(input('post.src2')); + if(empty($data['src'])){ + $this->returnCode('90000013'); + } + }else{ + $data['src'] = ''; + } + // 保存用户 + $res = Db::table('yz_admin_sys_menu')->where('smid',$smid)->update($data); + if(!$res){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $smid = (int)input('get.smid'); + $lists = Db::table('yz_admin_sys_menu')->where('smid',$smid)->find(); + $iconfont = Db::table('yz_z_iconfont')->where('status',1)->select(); + View::assign([ + 'lists' => $lists, + 'iconfont' => $iconfont + ]); + return View::fetch(); + } + } + # 菜单删除 + public function menudel(){ + $smid = (int)input('post.smid'); + $count = Db::table('yz_admin_sys_menu')->where('parent_id',$smid)->count(); + if($count > 0){ + $this->returnCode('90000010'); + } + $res = Db::table('yz_admin_sys_menu')->where('smid',$smid)->delete(); + if(empty($res)){ + $this->returnCode('91000003'); + } + $this->returnCode(0); + } + # 按钮管理 + public function buttoninfo(){ + $smid = (int)input('get.smid'); + $lists = Db::table('yz_admin_sys_menu')->where('parent_id',$smid)->order('sort DESC')->select()->toArray(); + if(!empty($lists)){ + foreach($lists as &$v){ + switch ($v['type']) { + case 0: + $v['type_name'] = '顶级菜单'; + break; + case 1: + $v['type_name'] = '内部跳转'; + break; + case 2: + $v['type_name'] = '超链接'; + break; + default: + $v['type_name'] = '未规划类型'; + break; + } + } + } + View::assign([ + 'lists' => $lists, + 'smid' => $smid + ]); + return View::fetch(); + } + # 按钮添加 + public function buttonadd(){ + $req = request(); + if($req->isPost()){ + $smid = (int)input('post.smid'); + $data['label'] = trim(input('post.label')); + if(!$data['label']){ + $this->returnCode('90000015'); + } + $data['icon_class'] = trim(input('post.icon_class')); + $data['sort'] = (int)trim(input('post.sort')); + $data['status'] = (int)trim(input('post.status')); + $data['type'] = (int)trim(input('post.type')); + if(empty($data['type'])){ + $this->returnCode('90000011'); + } + if($data['type'] == 1){ + $data['src'] = trim(input('post.src1')); + if(empty($data['src'])){ + $this->returnCode('90000012'); + } + }else if($data['type'] == 2){ + $data['src'] = trim(input('post.src2')); + if(empty($data['src'])){ + $this->returnCode('90000013'); + } + } + $data['parent_id'] = $smid; + $res = Db::table('yz_admin_sys_menu')->insert($data); + if(!$res){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + $smid = (int)input('get.smid'); + $iconfont = Db::table('yz_z_iconfont')->where('status',1)->select(); + View::assign([ + 'smid' => $smid, + 'iconfont' => $iconfont + ]); + return View::fetch(); + } + } + # 按钮修改 + public function buttonedit(){ + $req = request(); + if($req->isPost()){ + $smid = (int)input('post.smid'); + $data['label'] = trim(input('post.label')); + if(!$data['label']){ + $this->returnCode('90000015'); + } + $data['icon_class'] = trim(input('post.icon_class')); + $data['sort'] = (int)trim(input('post.sort')); + $data['status'] = (int)trim(input('post.status')); + $data['type'] = (int)trim(input('post.type')); + if(empty($data['type'])){ + $this->returnCode('90000011'); + } + if($data['type'] == 1){ + $data['src'] = trim(input('post.src1')); + if(empty($data['src'])){ + $this->returnCode('90000012'); + } + }else if($data['type'] == 2){ + $data['src'] = trim(input('post.src2')); + if(empty($data['src'])){ + $this->returnCode('90000013'); + } + } + $res = Db::table('yz_admin_sys_menu')->where('smid',$smid)->update($data); + if(!$res){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $smid = (int)input('get.smid'); + $lists = Db::table('yz_admin_sys_menu')->where('smid',$smid)->find(); + $iconfont = Db::table('yz_z_iconfont')->where('status',1)->select(); + View::assign([ + 'lists' => $lists, + 'iconfont' => $iconfont + ]); + return View::fetch(); + } + } + # 按钮删除 + public function buttondel(){ + $smid = (int)input('post.smid'); + $res = Db::table('yz_admin_sys_menu')->where('smid',$smid)->delete(); + if(empty($res)){ + $this->returnCode('91000003'); + } + $this->returnCode(0); + } + # 配置列表 + public function configlist(){ + $req = request(); + if($req->isPost()){ + $page = (int)input('post.page',1); + $limit = (int)input('post.limit',$this->config['admin_page']); + $count = Db::table('yz_admin_config')->count(); + $lists = Db::table('yz_admin_config')->page($page,$limit)->order('config_sort DESC,config_id DESC')->select(); + $this->returnCode(0,$lists,$count); + }else{ + return View::fetch(); + } + } + # 配置添加 + public function configadd(){ + $req = request(); + if($req->isPost()){ + $data['config_name'] = trim(input('post.config_name')); + if(empty($data['config_name'])){ + $this->returnCode(1,'请输入关键词'); + } + $data['config_info'] = trim(input('post.config_info')); + if(empty($data['config_info'])){ + $this->returnCode(1,'请输入作用'); + } + $data['config_type'] = trim(input('post.config_type')); + $data['config_desc'] = trim(input('post.config_desc')); + $data['config_status'] = trim(input('post.config_status')); + $data['config_sort'] = trim(input('post.config_sort')); + $res = Db::table('yz_admin_config')->insert($data); + if(empty($res)){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + return View::fetch(); + } + } + # 配置修改 + public function configedit(){ + $req = request(); + if($req->isPost()){ + $config_id = (int)input('post.config_id'); + if(empty($config_id)){ + $this->returnCode(1,'请选择一条数据'); + } + $data['config_name'] = trim(input('post.config_name')); + if(empty($data['config_name'])){ + $this->returnCode(1,'请输入关键词'); + } + $data['config_info'] = trim(input('post.config_info')); + if(empty($data['config_info'])){ + $this->returnCode(1,'请输入作用'); + } + $data['config_type'] = trim(input('post.config_type')); + $data['config_desc'] = trim(input('post.config_desc')); + $data['config_status'] = trim(input('post.config_status')); + $data['config_sort'] = trim(input('post.config_sort')); + $res = Db::table('yz_admin_config')->where('config_id',$config_id)->update($data); + if(empty($res)){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $config_id = (int)input('get.config_id'); + $find = Db::table('yz_admin_config')->where('config_id',$config_id)->find(); + View::assign([ + 'find' => $find + ]); + return View::fetch(); + } + } + # 配置删除 + public function configdel(){ + $config_id = (int)input('post.config_id'); + if(empty($config_id)){ + $this->returnCode(1,'请选择一条数据'); + } + $res = Db::table('yz_admin_config')->where('config_id',$config_id)->delete(); + if(empty($res)){ + $this->returnCode('91000003'); + } + $this->returnCode(0); + } + # 配置值 + public function configvalue(){ + $req = request(); + if($req->isPost()){ + $post = input('post.'); + if(empty($post)){ + $this->returnCode(1,'数据不能为空'); + } + $oConfig = new YzAdminConfig(); + $updateAll = $oConfig->updateAll($post); + if(empty($updateAll)){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $lists = Db::table('yz_admin_config')->order('config_sort DESC,config_id')->select(); + View::assign([ + 'lists' => $lists + ]); + return View::fetch(); + } + } +} \ No newline at end of file diff --git a/app/admin/controller/Yunzeradmin.php b/app/admin/controller/Yunzeradmin.php new file mode 100644 index 0000000..1655fda --- /dev/null +++ b/app/admin/controller/Yunzeradmin.php @@ -0,0 +1,262 @@ +select(); + View::assign([ + 'group' => $group + ]); + return View::fetch(); + } + public function groupadd(){ + if(Request::isPost()){ + $data['group_name'] = trim(input('post.group_name')); + if(!$data['group_name']){ + $this->returnCode('90000008'); + } + $data['status'] = (int)trim(input('post.status')); + $data['create_time'] = time(); + $menus = input('post.menu/a'); + if($menus){ + $data['rights'] = json_encode(array_keys($menus)); + } + $res = Db::table('yz_admin_user_group')->insert($data); + if(!$res){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + $menus = Db::table('yz_admin_sys_menu')->order('type,sort desc')->where('status','=',1)->select(); + $menu = []; + + // 先处理所有父菜单 + foreach($menus as $menus_v){ + if($menus_v['parent_id'] == 0){ + $menu[$menus_v['smid']] = $menus_v; + $menu[$menus_v['smid']]['children'] = []; // 初始化 children 数组 + } + } + + // 再处理子菜单 + foreach($menus as $menus_v){ + if($menus_v['parent_id'] != 0 && isset($menu[$menus_v['parent_id']])){ + $menu[$menus_v['parent_id']]['children'][] = $menus_v; + } + } + + View::assign([ + 'menus' => $menu + ]); + return View::fetch(); + } + } + public function groupedit(){ + if(Request::isPost()){ + $group_id = (int)trim(input('post.group_id')); + $data['group_name'] = trim(input('post.group_name')); + if(!$data['group_name']){ + $this->returnCode('90000008'); + } + $data['status'] = (int)trim(input('post.status')); + $menus = input('post.menu/a'); + if($menus){ + $data['rights'] = json_encode(array_keys($menus)); + }else{ + $data['rights'] = ''; + } + $res = Db::table('yz_admin_user_group')->where('group_id',$group_id)->update($data); + if(!$res){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $group_id = (int)input('get.group_id'); + $group = Db::table('yz_admin_user_group')->where('group_id',$group_id)->find(); + if($group && $group['rights']){ + $group['rights'] = json_decode($group['rights']); + } + + $menus = Db::table('yz_admin_sys_menu')->order('type,sort desc')->where('status','=',1)->select(); + $menu = []; + + // 先处理所有父菜单 + foreach($menus as $menus_v){ + if($menus_v['parent_id'] == 0){ + $menu[$menus_v['smid']] = $menus_v; + $menu[$menus_v['smid']]['children'] = []; // 初始化 children 数组 + } + } + + // 再处理子菜单 + foreach($menus as $menus_v){ + if($menus_v['parent_id'] != 0 && isset($menu[$menus_v['parent_id']])){ + $menu[$menus_v['parent_id']]['children'][] = $menus_v; + } + } + + View::assign([ + 'group' => $group, + 'menus' => $menu + ]); + return View::fetch(); + } + } + public function groupdel(){ + $group_id = (int)input('post.group_id'); + $res = Db::table('yz_admin_user_group')->where('group_id',$group_id)->delete(); + if(empty($res)){ + $this->returnCode('91000003'); + } + $this->returnCode(0); + } + public function userinfo(){ + $lists = Db::table('yz_admin_user')->select(); + $group = []; + $groups = Db::table('yz_admin_user_group')->select(); + foreach ($groups as $key => $value) { + $group[$value['group_id']] = $value; + } + View::assign([ + 'lists' => $lists, + 'group' => $group + ]); + return View::fetch(); + } + public function useradd(){ + if(Request::isPost()){ + $data['account'] = trim(input('post.account')); + if(empty($data['account'])){ + $this->returnCode('90000001'); + } + $pattern = "/^([0-9A-Za-z-_.]+)@([0-9a-z]+.[a-z]{2,3}(.[a-z]{2})?)$/i"; + if(!preg_match($pattern,$data['account'])){ + $this->returnCode('90000006'); + } + $item = Db::table('yz_admin_user')->where('account',$data['account'])->find(); + if($item){ + $this->returnCode('90000007'); + } + $data['name'] = trim(input('post.name')); + $data['phone'] = trim(input('post.phone')); + $data['qq'] = (int)trim(input('post.qq')); + $data['group_id'] = (int)input('post.group_id'); + $data['sex'] = (int)(input('post.sex')); + $data['status'] = (int)(input('post.status')); + $password = trim(input('post.password')); + if(empty($data['name'])){ + $this->returnCode('90000002'); + } + if(empty($data['phone'])){ + $this->returnCode('90000003'); + } + if(empty($data['group_id'])){ + $this->returnCode('90000004'); + } + if(empty($password)){ + $this->returnCode('90000005'); + }else{ + $data['password'] = md5($password); + } + $data['create_time'] = time(); + $data['update_time'] = time(); + $res = Db::table('yz_admin_user')->insert($data); + if(!$res){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + $group = []; + $groups = Db::table('yz_admin_user_group')->select(); + foreach ($groups as $key => $value) { + $group[$value['group_id']] = $value; + } + View::assign([ + 'group' => $group + ]); + return View::fetch(); + } + } + # 修改管理员 + public function useredit(){ + if(Request::isPost()){ + $uid = (int)trim(input('post.uid')); + $data['name'] = trim(input('post.name')); + $data['phone'] = trim(input('post.phone')); + $data['qq'] = (int)trim(input('post.qq')); + $data['group_id'] = (int)input('post.group_id'); + $data['sex'] = (int)(input('post.sex')); + $data['status'] = (int)(input('post.status')); + if(empty($data['name'])){ + $this->returnCode('90000002'); + } + if(empty($data['phone'])){ + $this->returnCode('90000003'); + } + if(empty($data['group_id'])){ + $this->returnCode('90000004'); + } + // 保存用户 + $res = Db::table('yz_admin_user')->where('uid',$uid)->update($data); + if(!$res){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $uid = (int)input('get.uid'); + // 加载管理员 + $lists = Db::table('yz_admin_user')->where('uid',$uid)->find(); + // 加载角色 + $group = []; + $groups = Db::table('yz_admin_user_group')->select(); + foreach ($groups as $key => $value) { + $group[$value['group_id']] = $value; + } + View::assign([ + 'lists' => $lists, + 'group' => $group + ]); + return View::fetch(); + } + } + # 删除管理员 + public function userdel(){ + $uid = (int)input('post.uid'); + $res = Db::table('yz_admin_user')->where('uid',$uid)->delete(); + if(empty($res)){ + $this->returnCode('91000003'); + } + $this->returnCode(0); + } + # 管理员信息 + public function admininfo(){ + if(Request::isPost()){ + $find = Db::table('yz_admin_user')->where('uid',$this->adminId)->find(); + if(empty($find)){ + $this->returnCode(1,'当前账户不存在'); + } + $data['name'] = trim(input('post.name')); + $data['phone'] = trim(input('post.phone')); + $data['qq'] = (int)trim(input('post.qq')); + $data['sex'] = (int)(input('post.sex')); + if(empty($data['name'])){ + $this->returnCode('90000002'); + } + if(empty($data['phone'])){ + $this->returnCode('90000003'); + } + // 保存用户 + $res = Db::table('yz_admin_user')->where('uid',$this->adminId)->update($data); + if(!$res){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + return View::fetch(); + } + } +} \ No newline at end of file diff --git a/app/admin/controller/Yunzertest.php b/app/admin/controller/Yunzertest.php new file mode 100644 index 0000000..1deeaa0 --- /dev/null +++ b/app/admin/controller/Yunzertest.php @@ -0,0 +1,167 @@ +where('status','=',1)->select(); + View::assign([ + 'lists' => $lists + ]); + return View::fetch(); + } + public function test_list(){ + if(Request::isPost()){ + $count = Db::table('yz_z_test')->count(); + $page = (int)input('post.page',1); + $limit = (int)input('post.limit',10); + $lists = Db::table('yz_z_test')->order('test_id DESC')->page($page,$limit)->select()->each(function($item, $key){ + if($item['test_reference'] == 1){ + $item['test_reference'] = '开启'; + }else{ + $item['test_reference'] = '关闭'; + } + $item['test_time'] = date('Y-m-d H:i:s',$item['test_time']); + return $item; + }); + $this->returnCode(0,$lists,$count); + }else{ + return View::fetch(); + } + } + public function test_add(){ + if(Request::isPost()){ + $data['test_input'] = input('post.test_input'); + $data['test_reference'] = input('post.test_reference'); + $data['test_time'] = input('post.test_time'); + if(!empty($data['test_time'])){ + $data['test_time'] = strtotime($data['test_time']); + } + $data['test_data'] = input('post.test_data'); + $data['test_datatime'] = input('post.test_datatime'); + $data['test_img'] = input('post.test_img'); + $data['test_rich_baidu'] = input('post.test_rich_baidu'); + $data['test_url'] = input('post.test_url'); + + $insert = Db::table('yz_z_test')->insert($data); + if(empty($insert)){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + return View::fetch(); + } + } + public function test_edit(){ + if(Request::isPost()){ + $test_id = input('post.test_id'); + $data['test_input'] = input('post.test_input'); + $data['test_reference'] = input('post.test_reference'); + $data['test_time'] = input('post.test_time'); + if(!empty($data['test_time'])){ + $data['test_time'] = strtotime($data['test_time']); + } + $data['test_data'] = input('post.test_data'); + $data['test_datatime'] = input('post.test_datatime'); + $data['test_img'] = input('post.test_img'); + $data['test_rich'] = input('post.test_rich'); + $data['test_rich_baidu'] = input('post.test_rich_baidu'); + $data['test_url'] = input('post.test_url'); + + $update = Db::table('yz_z_test')->where('test_id',$test_id)->update($data); + if(empty($update)){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $test_id = input('get.test_id'); + $find = Db::table('yz_z_test')->where('test_id',$test_id)->find(); + if(!empty($find)){ + $find['test_time'] = date('Y-m-d H:i:s',$find['test_time']); + } + View::assign([ + 'find' => $find + ]); + return View::fetch(); + } + } + public function test_del(){ + $test_id = (int)input('post.test_id'); + $res = Db::table('yz_z_test')->where('test_id',$test_id)->delete(); + if(empty($res)){ + $this->returnCode('91000003'); + } + $this->returnCode(0); + } + public function test_static_list(){ + $lists = Db::table('yz_z_test') + ->order('test_id DESC') + ->paginate(); + View::assign([ + 'lists' => $lists + ]); + return View::fetch(); + } + public function test_static_add(){ + if(Request::isPost()){ + $data['test_input'] = input('post.test_input'); + $data['test_reference'] = input('post.test_reference'); + $data['test_time'] = input('post.test_time'); + if(!empty($data['test_time'])){ + $data['test_time'] = strtotime($data['test_time']); + } + $data['test_data'] = input('post.test_data'); + $data['test_datatime'] = input('post.test_datatime'); + $data['test_img'] = input('post.test_img'); + $data['test_rich_baidu'] = input('post.test_rich_baidu'); + $data['test_url'] = input('post.test_url'); + + $insert = Db::table('yz_z_test')->insert($data); + if(empty($insert)){ + $this->returnCode('91000001'); + } + $this->returnCode(0); + }else{ + return View::fetch(); + } + } + public function test_static_edit(){ + if(Request::isPost()){ + $test_id = input('post.test_id'); + $data['test_input'] = input('post.test_input'); + $data['test_reference'] = input('post.test_reference'); + $data['test_time'] = input('post.test_time'); + if(!empty($data['test_time'])){ + $data['test_time'] = strtotime($data['test_time']); + } + $data['test_data'] = input('post.test_data'); + $data['test_datatime'] = input('post.test_datatime'); + $data['test_img'] = input('post.test_img'); + $data['test_rich'] = input('post.test_rich'); + $data['test_rich_baidu'] = input('post.test_rich_baidu'); + $data['test_url'] = input('post.test_url'); + + $update = Db::table('yz_z_test')->where('test_id',$test_id)->update($data); + if(empty($update)){ + $this->returnCode('91000002'); + } + $this->returnCode(0); + }else{ + $test_id = input('get.test_id'); + $find = Db::table('yz_z_test')->where('test_id',$test_id)->find(); + if(!empty($find)){ + $find['test_time'] = date('Y-m-d H:i:s',$find['test_time']); + if(!empty($find['test_img'])){ + $find['test_img_s'] = explode(';',$find['test_img']); + } + } + View::assign([ + 'find' => $find + ]); + return View::fetch(); + } + } +} \ No newline at end of file diff --git a/app/admin/model/Base.php b/app/admin/model/Base.php new file mode 100644 index 0000000..55a4243 --- /dev/null +++ b/app/admin/model/Base.php @@ -0,0 +1,37 @@ + logs($data,$fileName); + } + } + $info = ['data'=>$data]; + $content = json_encode($info, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL; + if(empty($fileName)){ + $filePath = $path . "/" . date("Ymd",time()).'.info.log'; + }else{ + $filePath = $path . "/" . $fileName . '.info.log'; + } + $time = "[".date("Y-m-d H:i:s",time())."]"; + $re = file_put_contents($filePath, $time." ".$content , FILE_APPEND); + if(!$re){ + $this -> logs($data,$fileName); + }else{ + return true; + } + } +} \ No newline at end of file diff --git a/app/admin/model/YzAdminConfig.php b/app/admin/model/YzAdminConfig.php new file mode 100644 index 0000000..5886655 --- /dev/null +++ b/app/admin/model/YzAdminConfig.php @@ -0,0 +1,43 @@ +order('config_sort DESC')->select()->toArray(); + if(empty($aList)){ + return []; + }else{ + $return = []; + foreach($aList as $k=>$v){ + $return[$v['config_name']] = $v['config_value']; + } + } + return $return; + } + /** + * 多条数据更新 + */ + public function updateAll($data){ + $lists = static::order('config_sort DESC,config_id')->select()->toArray(); + if(empty($lists)){ + return false; + }else{ + foreach($lists as &$lists_v){ + $lists_v['config_value'] = $data[$lists_v['config_name']]; + } + $save = static::saveAll($lists); + if(empty($save)){ + return false; + } + } + return true; + } +} \ No newline at end of file diff --git a/app/admin/view/index/index.php b/app/admin/view/index/index.php new file mode 100644 index 0000000..6607cde --- /dev/null +++ b/app/admin/view/index/index.php @@ -0,0 +1,173 @@ + + + + + + {$config['admin_name']} + + + + + + + + + + + +
+
+
+ +
+ + +
+
+ +
+
+ +
    + {volist name="menu" id="vo"} +
  • + + + {$vo['label']} + + {if (isset($vo['children']) && $vo['children'])} +
    + {volist name="vo.children" id="cvo"} +
    + {if $cvo['type'] == 1} + + {$cvo.label} + + {elseif $cvo['type'] == 2 /} + + {$cvo.label} + + {/if} +
    + {/volist} +
    + {/if} +
  • + {/volist} +
+
+ POWER BY 云泽网 +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+ + + + + + \ No newline at end of file diff --git a/app/admin/view/index/welcome.php b/app/admin/view/index/welcome.php new file mode 100644 index 0000000..c34e231 --- /dev/null +++ b/app/admin/view/index/welcome.php @@ -0,0 +1,149 @@ +{include file="public/header" /} + + +
+
+

欢迎使用{$config['admin_name']}

+

今天是 ,祝您工作愉快

+
+ +
+
+
用户总数
+
1,234
+
+
+
今日访问
+
256
+
+
+
数据总量
+
8,642
+
+
+
系统消息
+
12
+
+
+ +
+

快捷操作

+
+ + + + + +
+
+
+ + + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/login/index.php b/app/admin/view/login/index.php new file mode 100644 index 0000000..cd3d85b --- /dev/null +++ b/app/admin/view/login/index.php @@ -0,0 +1,129 @@ + + + + + 后台管理系统 + + + + + + + + + +
+
+ + +
+
+ + + + \ No newline at end of file diff --git a/app/admin/view/public/header.php b/app/admin/view/public/header.php new file mode 100644 index 0000000..0191020 --- /dev/null +++ b/app/admin/view/public/header.php @@ -0,0 +1,93 @@ + + + + {$config['admin_name']} + + + + + + + + + + \ No newline at end of file diff --git a/app/admin/view/public/tail.php b/app/admin/view/public/tail.php new file mode 100644 index 0000000..8738b98 --- /dev/null +++ b/app/admin/view/public/tail.php @@ -0,0 +1,30 @@ + + + \ No newline at end of file diff --git a/app/admin/view/yunzer/buttonadd.php b/app/admin/view/yunzer/buttonadd.php new file mode 100644 index 0000000..85d6c25 --- /dev/null +++ b/app/admin/view/yunzer/buttonadd.php @@ -0,0 +1,94 @@ +{include file="public/header" /} +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/buttonedit.php b/app/admin/view/yunzer/buttonedit.php new file mode 100644 index 0000000..b2f49ba --- /dev/null +++ b/app/admin/view/yunzer/buttonedit.php @@ -0,0 +1,98 @@ +{include file="public/header" /} +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/buttoninfo.php b/app/admin/view/yunzer/buttoninfo.php new file mode 100644 index 0000000..9d36b1e --- /dev/null +++ b/app/admin/view/yunzer/buttoninfo.php @@ -0,0 +1,155 @@ +{include file="public/header" /} +
+
+
+ +
+ +
+
+
+
+
+
+
+
菜单结构
+ +
+
+
+ + + + + + + + + + + + + {volist name="lists" id='vo'} + + + + + + + + + {/volist} + +
排序类型按钮名图标状态操作
{$vo['sort']} + {if($vo['type']==1)} + 功能模块 {$vo['src']} + {elseif($vo['type']==2)/} + 超链接 {$vo['src']} + {/if} + {$vo['label']} {$vo['icon_class']} + {if($vo['status']==1)} + 开启 + {else/} + 禁用 + {/if} + +
+ + +
+
+
+
+
+
+ + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/configadd.php b/app/admin/view/yunzer/configadd.php new file mode 100644 index 0000000..fb1ffb1 --- /dev/null +++ b/app/admin/view/yunzer/configadd.php @@ -0,0 +1,47 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/configedit.php b/app/admin/view/yunzer/configedit.php new file mode 100644 index 0000000..a14d7e3 --- /dev/null +++ b/app/admin/view/yunzer/configedit.php @@ -0,0 +1,47 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/configlist.php b/app/admin/view/yunzer/configlist.php new file mode 100644 index 0000000..aff625b --- /dev/null +++ b/app/admin/view/yunzer/configlist.php @@ -0,0 +1,286 @@ +{include file="public/header" /} + + +
+
+ 站点管理 + +
+ + +
+
+ + + +
+
+
+
+ + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/configvalue.php b/app/admin/view/yunzer/configvalue.php new file mode 100644 index 0000000..5d59038 --- /dev/null +++ b/app/admin/view/yunzer/configvalue.php @@ -0,0 +1,189 @@ +{include file="public/header" /} + + +
+
+ 站点配置 + +
+ +
+ {foreach($lists as $lists_v)} + {if($lists_v['config_type'] == 1)} +
+ +
+ +
+
{$lists_v['config_desc']}
+
+ {elseif($lists_v['config_type'] == 2)/} +
+ +
+ +
+
{$lists_v['config_desc']}
+
+
+ +
+
+ {if !empty($lists_v['config_value'])} +
+ + +
+ {/if} +
+
+
+ + {elseif($lists_v['config_type'] == 3)/} +
+ +
+ +
+
+ {/if} + {/foreach} +
+ +
+ +
+
+ + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/menuadd.php b/app/admin/view/yunzer/menuadd.php new file mode 100644 index 0000000..9fe8528 --- /dev/null +++ b/app/admin/view/yunzer/menuadd.php @@ -0,0 +1,95 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/menuedit.php b/app/admin/view/yunzer/menuedit.php new file mode 100644 index 0000000..6b53a4a --- /dev/null +++ b/app/admin/view/yunzer/menuedit.php @@ -0,0 +1,58 @@ +{include file="public/header" /} +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzer/menuinfo.php b/app/admin/view/yunzer/menuinfo.php new file mode 100644 index 0000000..fe36433 --- /dev/null +++ b/app/admin/view/yunzer/menuinfo.php @@ -0,0 +1,116 @@ +{include file="public/header" /} +
+
+
+ 菜单管理 +
+
+ + +
+
+ +
+ + + + + + + + + + + + + {volist name="lists" id='vo'} + + + + + + + + + {/volist} + +
类型菜单名图标排序状态操作
+ {if($vo['type']==1)} + 功能模块:{$vo['src']} + {elseif($vo['type']==2)/} + 超链接:{$vo['src']} + {else/} + 顶级 + {/if} + {$vo['label']} {$vo['icon_class']}{$vo['sort']}{$vo['status']==1?'开启':'禁用'} + {if($vo['type'] == 0)} + + {/if} + + +
+ +
+ + + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/admininfo.php b/app/admin/view/yunzeradmin/admininfo.php new file mode 100644 index 0000000..e5dba55 --- /dev/null +++ b/app/admin/view/yunzeradmin/admininfo.php @@ -0,0 +1,109 @@ +{include file="public/header" /} +
+
+ +
+
+
+ +
+
{$aUser['account']}
+
+
+
+ +
+
账户用于登录系统的账号,不能修改
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
{$aUser['login_count']}次
+
+
+
+ +
+
{:date('Y-m-d H:i:s',$aUser['create_time'])}
+
+
+
+ +
+
{:date('Y-m-d H:i:s',$aUser['update_time'])}
+
+
+
+
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/groupadd.php b/app/admin/view/yunzeradmin/groupadd.php new file mode 100644 index 0000000..36dbd7c --- /dev/null +++ b/app/admin/view/yunzeradmin/groupadd.php @@ -0,0 +1,53 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ + {volist name="menus" id="vo"} +
+
+ +
+ {volist name="vo.children" id="cvo"} + + {/volist} +
+ {/volist} +
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/groupedit.php b/app/admin/view/yunzeradmin/groupedit.php new file mode 100644 index 0000000..8decfef --- /dev/null +++ b/app/admin/view/yunzeradmin/groupedit.php @@ -0,0 +1,54 @@ +{include file="public/header" /} +
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ + {volist name="menus" id="vo"} +
+
+ +
+ {volist name="vo.children" id="cvo"} + + {/volist} +
+ {/volist} +
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/groupinfo.php b/app/admin/view/yunzeradmin/groupinfo.php new file mode 100644 index 0000000..3413a62 --- /dev/null +++ b/app/admin/view/yunzeradmin/groupinfo.php @@ -0,0 +1,97 @@ +{include file="public/header" /} +
+
+
+ 角色列表 +
+
+ + +
+ +
+ + + + + + + + + + + + {volist name="group" id='vo'} + + + + + + + {/volist} + +
角色名状态添加时间操作
{$vo.group_name}{$vo.status==1?'开启':'禁用'}{:date('Y-m-d H:i:s',$vo.create_time)} + + +
+ +
+ + + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/useradd.php b/app/admin/view/yunzeradmin/useradd.php new file mode 100644 index 0000000..c8b051d --- /dev/null +++ b/app/admin/view/yunzeradmin/useradd.php @@ -0,0 +1,84 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/useredit.php b/app/admin/view/yunzeradmin/useredit.php new file mode 100644 index 0000000..a5159bb --- /dev/null +++ b/app/admin/view/yunzeradmin/useredit.php @@ -0,0 +1,76 @@ +{include file="public/header" /} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzeradmin/userinfo.php b/app/admin/view/yunzeradmin/userinfo.php new file mode 100644 index 0000000..2525954 --- /dev/null +++ b/app/admin/view/yunzeradmin/userinfo.php @@ -0,0 +1,112 @@ +{include file="public/header" /} +
+
+
+ 用户列表 +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + {volist name="lists" id='vo'} + + + + + + + + + + + + + {/volist} + +
真实姓名账户手机QQ角色性别状态登陆次数登陆时间操作
{$vo.name}{$vo.account}{$vo.phone}{$vo.qq}{:isset($group[$vo.group_id])?$group[$vo.group_id]['group_name']:''} + {if $vo['sex']==1} + + {elseif $vo['sex'] == 2 /} + + {else /} + 未知 + {/if} + {$vo.status==1?'开启':'禁用'}{$vo.login_count}{:date('Y-m-d H:i:s',$vo.update_time)} + + +
+
+ + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/icon_list.php b/app/admin/view/yunzertest/icon_list.php new file mode 100644 index 0000000..fde0872 --- /dev/null +++ b/app/admin/view/yunzertest/icon_list.php @@ -0,0 +1,82 @@ +{include file="public/header" /} + +
+ 图标 +
+
+
+	
+	
+	
+	
+	
+	
+
+ + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/test_add.php b/app/admin/view/yunzertest/test_add.php new file mode 100644 index 0000000..692cb42 --- /dev/null +++ b/app/admin/view/yunzertest/test_add.php @@ -0,0 +1,136 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
支持png,jpg,gif
+
+
+ +
+
+
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+
+
+{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/test_edit.php b/app/admin/view/yunzertest/test_edit.php new file mode 100644 index 0000000..36e79b1 --- /dev/null +++ b/app/admin/view/yunzertest/test_edit.php @@ -0,0 +1,144 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
支持png,jpg,gif
+
+
+ +
+
+ {if(!empty($find['test_img']))} +
+ + + +
+ {/if} +
+
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+
+
+{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/test_list.php b/app/admin/view/yunzertest/test_list.php new file mode 100644 index 0000000..bd79f92 --- /dev/null +++ b/app/admin/view/yunzertest/test_list.php @@ -0,0 +1,193 @@ +{include file="public/header" /} +
+ 演示列表-方法渲染 +
+
+
+ +
+ +
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/test_static_add.php b/app/admin/view/yunzertest/test_static_add.php new file mode 100644 index 0000000..061377f --- /dev/null +++ b/app/admin/view/yunzertest/test_static_add.php @@ -0,0 +1,140 @@ +{include file="public/header" /} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
支持png,jpg,gif
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/test_static_edit.php b/app/admin/view/yunzertest/test_static_edit.php new file mode 100644 index 0000000..403b6cf --- /dev/null +++ b/app/admin/view/yunzertest/test_static_edit.php @@ -0,0 +1,149 @@ +{include file="public/header" /} +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
支持png,jpg,gif
+
+
+ +
+
+ {if(!empty($find['test_img']))} +
+ + + +
+ {/if} +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + + +{include file="public/tail" /} \ No newline at end of file diff --git a/app/admin/view/yunzertest/test_static_list.php b/app/admin/view/yunzertest/test_static_list.php new file mode 100644 index 0000000..12d240a --- /dev/null +++ b/app/admin/view/yunzertest/test_static_list.php @@ -0,0 +1,104 @@ +{include file="public/header" /} +
+ 演示列表-静态表格 + +
+
+ + + + + + + + + + + + + + + + + + {volist name="lists" id='vo'} + + + + + + + + + + + + + + {/volist} + +
ID文本富文本百度文本图片参照时间戳日期日期时间网址链接操作
{$vo['test_id']}{$vo['test_input']}{$vo['test_rich']}{$vo['test_rich_baidu']} + + + {if($vo['test_reference'] == 1)} + 开启 + {else/} + 关闭 + {/if} + {:date('Y-m-d H:i:s',$vo.test_time)}{$vo['test_data']}{$vo['test_datatime']}{$vo['test_url']} + + +
+
{$lists|raw}
+ +{include file="public/tail" /} \ No newline at end of file diff --git a/app/common.php b/app/common.php index 57cb6d8..6eb6540 100644 --- a/app/common.php +++ b/app/common.php @@ -1,2 +1,60 @@ + + + 跳转提示 + + + + +
+ +

+ +

+ +

+
+ + \ No newline at end of file diff --git a/composer.json b/composer.json index a650e61..7cda252 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,11 @@ "php": ">=7.2.5", "topthink/framework": "^6.1.0", "topthink/think-orm": "^2.0", - "topthink/think-filesystem": "^1.0" + "topthink/think-filesystem": "^1.0", + "topthink/think-multi-app": "^1.0", + "topthink/think-view": "^1.0", + "topthink/think-captcha": "^3.0", + "phpoffice/phpspreadsheet": "^1.25" }, "require-dev": { "symfony/var-dumper": "^4.2", diff --git a/composer.lock b/composer.lock index 0c0508b..3b224aa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,160 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "66559480dea8532df6a457e4e313a236", + "content-hash": "8970cf0ed350dfcc74fde0c4e3fee12f", "packages": [ + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.18.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "cb56001e54359df7ae76dc522d08845dc741621b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/cb56001e54359df7ae76dc522d08845dc741621b", + "reference": "cb56001e54359df7ae76dc522d08845dc741621b", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" + }, + "type": "library", + "autoload": { + "files": [ + "library/HTMLPurifier.composer.php" + ], + "psr-0": { + "HTMLPurifier": "library/" + }, + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.18.0" + }, + "time": "2024-11-01T03:51:45+00:00" + }, { "name": "league/flysystem", "version": "1.1.10", @@ -225,6 +377,390 @@ ], "time": "2024-01-28T23:22:08+00:00" }, + { + "name": "maennchen/zipstream-php", + "version": "2.2.6", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f", + "reference": "30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "myclabs/php-enum": "^1.5", + "php": "^7.4 || ^8.0", + "psr/http-message": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "require-dev": { + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.9", + "guzzlehttp/guzzle": "^6.5.3 || ^7.2.0", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.4", + "phpunit/phpunit": "^8.5.8 || ^9.4.2", + "vimeo/psalm": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.6" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], + "time": "2022-11-25T18:57:19+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, + "time": "2022-12-06T16:21:08+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, + "time": "2022-12-02T22:17:43+00:00" + }, + { + "name": "myclabs/php-enum", + "version": "1.8.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^4.6.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.4" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", + "type": "tidelift" + } + ], + "time": "2022-08-04T09:53:51+00:00" + }, + { + "name": "phpoffice/phpspreadsheet", + "version": "1.29.10", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "c80041b1628c4f18030407134fe88303661d4e4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c80041b1628c4f18030407134fe88303661d4e4e", + "reference": "c80041b1628c4f18030407134fe88303661d4e4e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "composer/pcre": "^1||^2||^3", + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.15", + "maennchen/zipstream-php": "^2.1 || ^3.0", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^7.4 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^1.0 || ^2.0 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.2", + "mitoteam/jpgraph": "^10.3", + "mpdf/mpdf": "^8.1.1", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.7", + "tecnickcom/tcpdf": "^6.5" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "ext-intl": "PHP Internationalization Functions", + "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.10" + }, + "time": "2025-02-08T02:56:14+00:00" + }, { "name": "psr/cache", "version": "1.0.1", @@ -334,6 +870,125 @@ }, "time": "2021-11-05T16:50:12+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, + "time": "2023-04-10T20:10:41+00:00" + }, { "name": "psr/http-message", "version": "1.1", @@ -506,6 +1161,92 @@ }, "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, { "name": "topthink/framework", "version": "v6.1.5", @@ -577,6 +1318,65 @@ }, "time": "2024-04-16T02:01:19+00:00" }, + { + "name": "topthink/think-captcha", + "version": "v3.0.11", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-captcha.git", + "reference": "4f24f560a31011329e3d144732e5370d7676b3fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-captcha/zipball/4f24f560a31011329e3d144732e5370d7676b3fb", + "reference": "4f24f560a31011329e3d144732e5370d7676b3fb", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "topthink/framework": "^6.0|^8.0" + }, + "type": "library", + "extra": { + "think": { + "config": { + "captcha": "src/config.php" + }, + "services": [ + "think\\captcha\\CaptchaService" + ] + } + }, + "autoload": { + "files": [ + "src/helper.php" + ], + "psr-4": { + "think\\captcha\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "description": "captcha package for thinkphp", + "support": { + "issues": "https://github.com/top-think/think-captcha/issues", + "source": "https://github.com/top-think/think-captcha/tree/v3.0.11" + }, + "time": "2024-11-22T12:59:35+00:00" + }, { "name": "topthink/think-filesystem", "version": "v1.0.3", @@ -683,6 +1483,60 @@ }, "time": "2025-04-07T06:55:59+00:00" }, + { + "name": "topthink/think-multi-app", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-multi-app.git", + "reference": "f93c604d5cfac2b613756273224ee2f88e457b88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/f93c604d5cfac2b613756273224ee2f88e457b88", + "reference": "f93c604d5cfac2b613756273224ee2f88e457b88", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/framework": "^6.0|^8.0" + }, + "type": "library", + "extra": { + "think": { + "services": [ + "think\\app\\Service" + ] + } + }, + "autoload": { + "psr-4": { + "think\\app\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "thinkphp multi app support", + "support": { + "issues": "https://github.com/top-think/think-multi-app/issues", + "source": "https://github.com/top-think/think-multi-app/tree/v1.1.1" + }, + "time": "2024-11-25T08:52:44+00:00" + }, { "name": "topthink/think-orm", "version": "v2.0.62", @@ -743,21 +1597,19 @@ "source": "https://github.com/top-think/think-orm/tree/v2.0.62" }, "time": "2024-09-22T06:17:47+00:00" - } - ], - "packages-dev": [ + }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "name": "topthink/think-template", + "version": "v2.0.10", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "url": "https://github.com/top-think/think-template.git", + "reference": "2b28c9f787c94f6c22312c9fe97dd3d926c03e1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/top-think/think-template/zipball/2b28c9f787c94f6c22312c9fe97dd3d926c03e1c", + "reference": "2b28c9f787c94f6c22312c9fe97dd3d926c03e1c", "shasum": "", "mirrors": [ { @@ -767,71 +1619,81 @@ ] }, "require": { - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": ">=7.1.0", + "psr/simple-cache": "^1.0" }, "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "think\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "liu21st", + "email": "liu21st@gmail.com" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], + "description": "the php template engine", "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "issues": "https://github.com/top-think/think-template/issues", + "source": "https://github.com/top-think/think-template/tree/v2.0.10" }, - "funding": [ + "time": "2024-08-12T05:48:57+00:00" + }, + { + "name": "topthink/think-view", + "version": "v1.0.14", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-view.git", + "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d", + "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/think-template": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "think\\view\\driver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "name": "liu21st", + "email": "liu21st@gmail.com" } ], - "time": "2024-09-09T11:45:10+00:00" - }, + "description": "thinkphp template driver", + "support": { + "issues": "https://github.com/top-think/think-view/issues", + "source": "https://github.com/top-think/think-view/tree/v1.0.14" + }, + "time": "2019-11-06T11:40:13+00:00" + } + ], + "packages-dev": [ { "name": "symfony/polyfill-php72", "version": "v1.31.0", diff --git a/config/app.php b/config/app.php index 348c96c..0e93a82 100644 --- a/config/app.php +++ b/config/app.php @@ -10,20 +10,13 @@ return [ 'app_namespace' => '', // 是否启用路由 'with_route' => true, - // 是否启用事件 - 'with_event' => true, - // 自动多应用模式 - 'auto_multi_app' => true, // 默认应用 - 'default_app' => 'index', + 'default_app' => 'admin', // 默认时区 'default_timezone' => 'Asia/Shanghai', // 应用映射(自动多应用模式有效) - 'app_map' => [ - 'admin' => 'admin', - 'pc' => 'pc' - ], + 'app_map' => [], // 域名绑定(自动多应用模式有效) 'domain_bind' => [], // 禁止URL访问的应用列表(自动多应用模式有效) @@ -31,6 +24,8 @@ return [ // 异常页面的模板文件 'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', + 'dispatch_success_tmpl' => app()->getRootPath() . 'app/tpl/think_exception.tpl', + 'dispatch_error_tmpl' => app()->getRootPath() . 'app/tpl/think_exception.tpl', // 错误显示信息,非调试模式有效 'error_message' => '页面错误!请稍后再试~', diff --git a/config/captcha.php b/config/captcha.php new file mode 100644 index 0000000..420fc39 --- /dev/null +++ b/config/captcha.php @@ -0,0 +1,39 @@ + 4, + // 验证码字符集合 + 'codeSet' => '1234567890', + // 验证码过期时间 + 'expire' => 1800, + // 是否使用中文验证码 + 'useZh' => false, + // 是否使用算术验证码 + 'math' => false, + // 是否使用背景图 + 'useImgBg' => false, + //验证码字符大小 + 'fontSize' => 25, + // 是否使用混淆曲线 + 'useCurve' => false, + //是否添加杂点 + 'useNoise' => false, + // 验证码字体 不设置则随机 + 'fontttf' => '', + //背景颜色 + 'bg' => [243, 251, 254], + // 验证码图片高度 + 'imageH' => 0, + // 验证码图片宽度 + 'imageW' => 0, + + // 添加额外的验证码设置 + // verify => [ + // 'length'=>4, + // ... + //], +]; diff --git a/config/console.php b/config/console.php index a818a98..b43991d 100644 --- a/config/console.php +++ b/config/console.php @@ -5,5 +5,6 @@ return [ // 指令定义 'commands' => [ + ], ]; diff --git a/config/cookie.php b/config/cookie.php index d3b3aab..8d6086c 100644 --- a/config/cookie.php +++ b/config/cookie.php @@ -3,6 +3,8 @@ // | Cookie设置 // +---------------------------------------------------------------------- return [ + // cookie 名称前缀 + 'prefix' => '', // cookie 保存时间 'expire' => 0, // cookie 保存路径 diff --git a/config/database.php b/config/database.php index ba2ae8c..c987721 100644 --- a/config/database.php +++ b/config/database.php @@ -24,13 +24,13 @@ return [ // 数据库类型 'type' => env('database.type', 'mysql'), // 服务器地址 - 'hostname' => env('database.hostname', '127.0.0.1'), + 'hostname' => env('database.hostname', '121.36.243.179'), // 数据库名 - 'database' => env('database.database', ''), + 'database' => env('database.database', 'yunzertest'), // 用户名 - 'username' => env('database.username', 'root'), + 'username' => env('database.username', 'yunzertest'), // 密码 - 'password' => env('database.password', ''), + 'password' => env('database.password', 'zKMDMEs7YP3SLDEF'), // 端口 'hostport' => env('database.hostport', '3306'), // 数据库连接参数 diff --git a/config/route.php b/config/route.php index 2f4cd12..9032ffc 100644 --- a/config/route.php +++ b/config/route.php @@ -4,42 +4,42 @@ // +---------------------------------------------------------------------- return [ - // pathinfo分隔符 - 'pathinfo_depr' => '/', - // URL伪静态后缀 - 'url_html_suffix' => 'html', - // URL普通方式参数 用于自动生成 - 'url_common_param' => true, - // 是否开启路由延迟解析 - 'url_lazy_route' => false, - // 是否强制使用路由 - 'url_route_must' => false, - // 合并路由规则 - 'route_rule_merge' => false, - // 路由是否完全匹配 - 'route_complete_match' => false, - // 访问控制器层名称 - 'controller_layer' => 'controller', - // 空控制器名 - 'empty_controller' => 'Error', - // 是否使用控制器后缀 - 'controller_suffix' => false, - // 默认的路由变量规则 - 'default_route_pattern' => '[\w\.]+', - // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则 - 'request_cache_key' => false, - // 请求缓存有效期 - 'request_cache_expire' => null, - // 全局请求缓存排除规则 - 'request_cache_except' => [], - // 默认控制器名 - 'default_controller' => 'Index', - // 默认操作名 - 'default_action' => 'index', - // 操作方法后缀 - 'action_suffix' => '', - // 默认JSONP格式返回的处理方法 - 'default_jsonp_handler' => 'jsonpReturn', - // 默认JSONP处理方法 - 'var_jsonp_handler' => 'callback', + // pathinfo分隔符 + 'pathinfo_depr' => '/', + // URL伪静态后缀 + 'url_html_suffix' => '', + // URL普通方式参数 用于自动生成 + 'url_common_param' => true, + // 是否开启路由延迟解析 + 'url_lazy_route' => false, + // 是否强制使用路由 + 'url_route_must' => false, + // 合并路由规则 + 'route_rule_merge' => false, + // 路由是否完全匹配 + 'route_complete_match' => true, + // 访问控制器层名称 + 'controller_layer' => 'controller', + // 空控制器名 + 'empty_controller' => 'Error', + // 是否使用控制器后缀 + 'controller_suffix' => false, + // 默认的路由变量规则 + 'default_route_pattern' => '[\w\.]+', + // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则 + 'request_cache_key' => false, + // 请求缓存有效期 + 'request_cache_expire' => null, + // 全局请求缓存排除规则 + 'request_cache_except' => [], + // 默认控制器名 + 'default_controller' => 'Index', + // 默认操作名 + 'default_action' => 'index', + // 操作方法后缀 + 'action_suffix' => '', + // 默认JSONP格式返回的处理方法 + 'default_jsonp_handler' => 'jsonpReturn', + // 默认JSONP处理方法 + 'var_jsonp_handler' => 'callback', ]; diff --git a/config/session.php b/config/session.php index c1ef6e1..6288764 100644 --- a/config/session.php +++ b/config/session.php @@ -4,16 +4,16 @@ // +---------------------------------------------------------------------- return [ - // session name - 'name' => 'PHPSESSID', - // SESSION_ID的提交变量,解决flash上传跨域 - 'var_session_id' => '', - // 驱动方式 支持file cache - 'type' => 'file', - // 存储连接标识 当type使用cache的时候有效 - 'store' => null, - // 过期时间 - 'expire' => 1440, - // 前缀 - 'prefix' => '', + // session name + 'name' => 'PHPSESSID', + // SESSION_ID的提交变量,解决flash上传跨域 + 'var_session_id' => '', + // 驱动方式 支持file cache + 'type' => 'file', + // 存储连接标识 当type使用cache的时候有效 + 'store' => null, + // 过期时间 + 'expire' => 60*60*24*7, + // 前缀 + 'prefix' => '', ]; diff --git a/config/view.php b/config/view.php index 01259a0..13d4e75 100644 --- a/config/view.php +++ b/config/view.php @@ -11,7 +11,7 @@ return [ // 模板目录名 'view_dir_name' => 'view', // 模板后缀 - 'view_suffix' => 'html', + 'view_suffix' => 'php', // 模板文件名分隔符 'view_depr' => DIRECTORY_SEPARATOR, // 模板引擎普通标签开始标记 diff --git a/nginx.htaccess b/nginx.htaccess deleted file mode 100644 index 250ba18..0000000 --- a/nginx.htaccess +++ /dev/null @@ -1,8 +0,0 @@ -location ~* (runtime|application)/{ - return 403; -} -location / { - if (!-e $request_filename){ - rewrite ^(.*)$ /index.php?s=$1 last; break; - } -} \ No newline at end of file diff --git a/public/.htaccess_mac b/public/.htaccess_mac new file mode 100644 index 0000000..d0d5125 --- /dev/null +++ b/public/.htaccess_mac @@ -0,0 +1,8 @@ + + Options +FollowSymlinks -Multiviews + RewriteEngine On + + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] + \ No newline at end of file diff --git a/public/.htaccess_win b/public/.htaccess_win new file mode 100644 index 0000000..87f952d --- /dev/null +++ b/public/.htaccess_win @@ -0,0 +1,8 @@ + + Options +FollowSymlinks -Multiviews + RewriteEngine On + + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] + \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico index e71815a..3b21cd4 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/nginx.htaccess b/public/nginx.htaccess index 250ba18..e69de29 100644 --- a/public/nginx.htaccess +++ b/public/nginx.htaccess @@ -1,8 +0,0 @@ -location ~* (runtime|application)/{ - return 403; -} -location / { - if (!-e $request_filename){ - rewrite ^(.*)$ /index.php?s=$1 last; break; - } -} \ No newline at end of file diff --git a/public/storage/uploads/20250424/48bf53df92855c12c85ae32643c1191e.png b/public/storage/uploads/20250424/48bf53df92855c12c85ae32643c1191e.png new file mode 100644 index 0000000..0be157c Binary files /dev/null and b/public/storage/uploads/20250424/48bf53df92855c12c85ae32643c1191e.png differ diff --git a/public/storage/uploads/20250424/c23ee545646904966c949ce3dea4304e.png b/public/storage/uploads/20250424/c23ee545646904966c949ce3dea4304e.png new file mode 100644 index 0000000..bb82ef3 Binary files /dev/null and b/public/storage/uploads/20250424/c23ee545646904966c949ce3dea4304e.png differ diff --git a/route/app.php b/route/app.php index d8e09e3..a44512f 100644 --- a/route/app.php +++ b/route/app.php @@ -9,9 +9,3 @@ // | Author: liu21st // +---------------------------------------------------------------------- use think\facade\Route; - -Route::get('think', function () { - return 'hello,ThinkPHP6!'; -}); - -Route::get('hello/:name', 'index/hello'); diff --git a/view/README.md b/view/README.md deleted file mode 100644 index 360eb24..0000000 --- a/view/README.md +++ /dev/null @@ -1 +0,0 @@ -如果不使用模板,可以删除该目录 \ No newline at end of file