+
角色组
用户管理
图片管理
储存策略
diff --git a/install.sql b/install.sql
index a5b82298..f7897059 100644
--- a/install.sql
+++ b/install.sql
@@ -1,12 +1,3 @@
--- phpMyAdmin SQL Dump
--- version 4.8.2
--- https://www.phpmyadmin.net/
---
--- Host: localhost:3306
--- Generation Time: 2018-09-28 17:54:47
--- 服务器版本: 5.7.21
--- PHP Version: 7.2.7
-
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
@@ -14,82 +5,23 @@ SET time_zone = "+00:00";
-- Database: `lsky`
--
--- --------------------------------------------------------
-
--
-- 表的结构 `lsky_config`
--
DROP TABLE IF EXISTS `lsky_config`;
CREATE TABLE IF NOT EXISTS `lsky_config` (
- `id` smallint(6) UNSIGNED NOT NULL,
+ `id` smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`key` varchar(32) DEFAULT NULL COMMENT 'key',
`type` varchar(32) NOT NULL DEFAULT 'text' COMMENT 'text|bool|textarea|select',
`input_type` varchar(32) NOT NULL DEFAULT 'text' COMMENT 'input type属性',
- `name` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '配置名',
+ `name` varchar(32) CHARACTER SET utf8mb4 NOT NULL UNIQUE COMMENT '配置名',
`title` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '配置标题',
`tip` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '配置描述',
`value` text CHARACTER SET utf8mb4 NOT NULL COMMENT '配置值',
- `extend` text CHARACTER SET utf8mb4 NOT NULL COMMENT '扩展属性'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统配置' ROW_FORMAT=COMPACT;
-
---
--- 转存表中的数据 `lsky_config`
---
-
-INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
-(1, 'basics', 'bool', 'checkbox', 'close_register', '关闭注册', NULL, '0', ''),
-(2, 'basics', 'text', 'text', 'site_name', '网站标题', NULL, 'Lsky Pro', ''),
-(3, 'basics', 'text', 'text', 'site_keywords', '网站关键字', NULL, 'Lsky Pro', ''),
-(4, 'basics', 'text', 'text', 'site_description', '网站描述', NULL, 'Lsky Pro, Your photo album on the cloud.', ''),
-(5, 'basics', 'text', 'text', 'icp_number', '备案号', NULL, '', ''),
-(6, 'upload', 'bool', 'checkbox', 'allowed_tourist_upload', '允许游客上传', '是否允许游客上传', '1', ''),
-(7, 'upload', 'text', 'text', 'upload_max_size', '最大上传大小', '单位:b,默认5242880:5M', '5242880', ''),
-(8, 'upload', 'text', 'number', 'upload_single_num', '单次同时上传数量', NULL, '10', ''),
-(9, 'upload', 'text', 'text', 'upload_allowed_exts', '允许上传的文件后缀', '逗号隔开', 'jpg,jpeg,gif,png,ico', ''),
-(10, 'upload', 'text', 'text', 'path_naming_rule', '文件路径命名规则', '
路径命名变量对照表', '{Y}/{m}/{d}', ''),
-(11, 'upload', 'text', 'text', 'file_naming_rule', '文件命名规则', '
文件命名变量对照表', '{uniqid}', ''),
-(12, 'user', 'text', 'text', 'user_initial_quota', '用户初始配额容量', '单位:b,默认1073741824:1G,最大18位', '1073741824', ''),
-(13, 'mail', 'select', 'text', 'mail_send_mode', '邮件发送方式', NULL, 'smtp', '{\"smtp\":\"SMTP\"}'),
-(14, 'mail', 'select', 'text', 'mail_smtp_secure', 'SMTP验证方式', NULL, 'none', '{\"none\":\"None\",\"tls\":\"TLS\",\"ssl\":\"SSL\"}'),
-(15, 'mail', 'text', 'text', 'mail_smtp_host', 'SMTP主机地址', NULL, '', ''),
-(16, 'mail', 'text', 'text', 'mail_smtp_username', 'SMTP用户名', NULL, '', ''),
-(17, 'mail', 'text', 'password', 'mail_smtp_password', 'SMTP密码', NULL, '', ''),
-(18, 'mail', 'text', 'number', 'mail_smtp_port', 'SMTP端口', '25/465', '25', ''),
-(19, 'mail', 'text', 'email', 'mail_form_email', '发件人邮箱', NULL, '', ''),
-(20, 'other', 'bool', 'checkbox', 'soft_delete', '软删除', '删除图片时不删除源文件,不建议开启', '0', ''),
-
-(21, 'storage_strategy', 'select', 'text', 'storage_strategy', '储存策略', NULL, 'local', ''),
-(22, 'local', 'text', 'text', 'local_cdn_domain', 'CDN加速域名', NULL, '', ''),
-(23, 'oss', 'text', 'text', 'oss_cdn_domain', 'Bucket域名', NULL, '', ''),
-(24, 'oss', 'text', 'text', 'oss_access_key_id', 'AccessKeyId', NULL, '', ''),
-(25, 'oss', 'text', 'text', 'oss_access_key_secret', 'AccessKeySecret', NULL, '', ''),
-(26, 'oss', 'text', 'text', 'oss_endpoint', 'Endpoint', '地域节点', '', ''),
-(27, 'oss', 'text', 'text', 'oss_bucket', 'Bucket', NULL, '', ''),
-(28, 'cos', 'text', 'text', 'cos_cdn_domain', 'CDN加速域名', NULL, '', ''),
-(29, 'cos', 'text', 'text', 'cos_secret_id', 'SecretId', NULL, '', ''),
-(30, 'cos', 'text', 'text', 'cos_secret_key', 'SecretKey', NULL, '', ''),
-(31, 'cos', 'text', 'text', 'cos_region', '所属地域', NULL, '', ''),
-(32, 'cos', 'text', 'text', 'cos_bucket', 'Bucket', '储存桶名称', '', ''),
-(33, 'kodo', 'text', 'text', 'kodo_cdn_domain', 'CDN加速域名', NULL, '', ''),
-(34, 'kodo', 'text', 'text', 'kodo_access_key', 'AccessKey', NULL, '', ''),
-(35, 'kodo', 'text', 'text', 'kodo_secret_key', 'SecretKey', NULL, '', ''),
-(36, 'kodo', 'text', 'text', 'kodo_bucket', 'Bucket', NULL, '', ''),
-(37, 'uss', 'text', 'text', 'uss_cdn_domain', 'CDN加速域名', NULL, '', ''),
-(38, 'uss', 'text', 'text', 'uss_operator_name', 'OperatorName', '操作员账号', '', ''),
-(39, 'uss', 'text', 'password', 'uss_operator_pwd', 'OperatorPwd', '操作员密码', '', ''),
-(40, 'uss', 'text', 'text', 'uss_service_name', 'ServiceName', '云储存服务名称', '', ''),
-(41, '', 'text', 'text', 'system_version', '系统版本', NULL, '1.4.2', ''),
-
-
-(42, 'audit', 'bool', 'checkbox', 'open_audit', '开启图片鉴黄', '接口申请地址:
https://www.moderatecontent.com', '0', ''),
-(43, 'audit', 'text', 'text', 'audit_key', 'Key', NULL, '', ''),
-(44, 'audit', 'select', 'text', 'audit_index', '内容评级', '1=所有人,2=少年,3=成人', '3', '{\"1\": \"所有人\", \"2\": \"少年\", \"3\": \"成人\"}'),
-(45, 'other', 'bool', 'checkbox', 'open_api', '开启API', '是否开放接口', '0', ''),
-(46, 'basics', 'textarea', 'textarea', 'custom_style', '自定义CSS', NULL, '\r\n', ''),
-(47, 'basics', 'textarea', 'textarea', 'statistics_code', '统计代码', NULL, '', '');
-
--- --------------------------------------------------------
+ `extend` text CHARACTER SET utf8mb4 NOT NULL COMMENT '扩展属性',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='系统配置' ROW_FORMAT=COMPACT;
--
-- 表的结构 `lsky_images`
@@ -97,7 +29,7 @@ INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `
DROP TABLE IF EXISTS `lsky_images`;
CREATE TABLE IF NOT EXISTS `lsky_images` (
- `id` int(11) UNSIGNED NOT NULL COMMENT 'ID',
+ `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID,为0表示游客上传',
`folder_id` int(11) NOT NULL DEFAULT 0 COMMENT '文件夹ID',
`strategy` varchar(32) NOT NULL DEFAULT 'local' COMMENT '储存策略,默认本地',
@@ -110,10 +42,9 @@ CREATE TABLE IF NOT EXISTS `lsky_images` (
`md5` varchar(32) NOT NULL COMMENT 'hash md5',
`ip` varchar(128) DEFAULT NULL COMMENT '上传者IP',
`suspicious` tinyint(1) NOT NULL DEFAULT '0' COMMENT '可疑图片',
- `create_time` int(11) NOT NULL COMMENT '创建时间'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='图片表';
-
--- --------------------------------------------------------
+ `create_time` int(11) NOT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='图片表';
--
-- 表的结构 `lsky_users`
@@ -121,10 +52,10 @@ CREATE TABLE IF NOT EXISTS `lsky_images` (
DROP TABLE IF EXISTS `lsky_users`;
CREATE TABLE IF NOT EXISTS `lsky_users` (
- `id` int(11) UNSIGNED NOT NULL,
- `username` varchar(32) NOT NULL COMMENT '用户名',
+ `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `username` varchar(32) NOT NULL UNIQUE COMMENT '用户名',
`nickname` varchar(32) DEFAULT NULL COMMENT '昵称',
- `email` varchar(100) NOT NULL COMMENT '邮箱',
+ `email` varchar(100) NOT NULL UNIQUE COMMENT '邮箱',
`password` varchar(32) NOT NULL COMMENT '密码',
`quota` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '可用配额容量(字节:b)',
`default_folder` varchar(32) DEFAULT NULL COMMENT '默认上传文件夹',
@@ -134,8 +65,9 @@ CREATE TABLE IF NOT EXISTS `lsky_users` (
`reg_ip` varchar(32) DEFAULT NULL COMMENT '注册IP',
`delete_time` int(11) DEFAULT NULL COMMENT '删除时间',
`update_time` int(11) NOT NULL COMMENT '更新时间',
- `create_time` int(11) NOT NULL COMMENT '添加时间'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
+ `create_time` int(11) NOT NULL COMMENT '添加时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='用户表';
--
-- 表的结构 `lsky_folders`
@@ -143,70 +75,88 @@ CREATE TABLE IF NOT EXISTS `lsky_users` (
DROP TABLE IF EXISTS `lsky_folders`;
CREATE TABLE `lsky_folders` (
- `id` int(11) NOT NULL COMMENT 'ID',
+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`user_id` int(11) NOT NULL COMMENT '用户ID',
`parent_id` int(11) NOT NULL DEFAULT '0' COMMENT '上级文件夹ID',
`name` varchar(100) NOT NULL COMMENT '文件夹名称',
`delete_time` int(11) DEFAULT NULL COMMENT '删除时间',
`update_time` int(11) DEFAULT NULL COMMENT '更新时间',
- `create_time` int(11) DEFAULT NULL COMMENT '添加时间'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件夹表';
+ `create_time` int(11) DEFAULT NULL COMMENT '添加时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='文件夹表';
--
--- Indexes for dumped tables
+-- 表的结构 `lsky_users_group`
--
---
--- Indexes for table `lsky_config`
---
-ALTER TABLE `lsky_config`
- ADD PRIMARY KEY (`id`),
- ADD UNIQUE KEY `name` (`name`);
+DROP TABLE IF EXISTS `lsky_group`;
+CREATE TABLE `lsky_group` (
+ `id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID',
+ `strategy` varchar(32) NOT NULL COMMENT '使用策略',
+ `name` varchar(32) NOT NULL COMMENT '组名称',
+ `default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '默认',
+ `update_time` int(11) DEFAULT NULL COMMENT '更新时间',
+ `create_time` int(11) DEFAULT NULL COMMENT '添加时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='文件夹表';
+
+-- --------------------------------------------------------
--
--- Indexes for table `lsky_images`
---
-ALTER TABLE `lsky_images`
- ADD PRIMARY KEY (`id`);
-
---
--- Indexes for table `lsky_users`
---
-ALTER TABLE `lsky_users`
- ADD PRIMARY KEY (`id`),
- ADD UNIQUE KEY `username` (`username`),
- ADD UNIQUE KEY `email` (`email`);
-
---
--- Indexes for table `lsky_folders`
---
-ALTER TABLE `lsky_folders`
-ADD PRIMARY KEY (`id`);
-
---
--- 在导出的表使用AUTO_INCREMENT
+-- 表中的数据 `lsky_config`
--
---
--- 使用表AUTO_INCREMENT `lsky_config`
---
-ALTER TABLE `lsky_config`
- MODIFY `id` smallint(6) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
+INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
+(NULL, 'basics', 'bool', 'checkbox', 'close_register', '关闭注册', NULL, '0', ''),
+(NULL, 'basics', 'text', 'text', 'site_name', '网站标题', NULL, 'Lsky Pro', ''),
+(NULL, 'basics', 'text', 'text', 'site_keywords', '网站关键字', NULL, 'Lsky Pro', ''),
+(NULL, 'basics', 'text', 'text', 'site_description', '网站描述', NULL, 'Lsky Pro, Your photo album on the cloud.', ''),
+(NULL, 'basics', 'textarea', 'textarea', 'custom_style', '自定义CSS', NULL, '\r\n', ''),
+(NULL, 'basics', 'textarea', 'textarea', 'statistics_code', '统计代码', NULL, '', ''),
+(NULL, 'basics', 'text', 'text', 'icp_number', '备案号', NULL, '', ''),
+(NULL, 'upload', 'bool', 'checkbox', 'allowed_tourist_upload', '允许游客上传', '是否允许游客上传', '1', ''),
+(NULL, 'upload', 'text', 'text', 'upload_max_size', '最大上传大小', '单位:b,默认5242880:5M', '5242880', ''),
+(NULL, 'upload', 'text', 'number', 'upload_single_num', '单次同时上传数量', NULL, '10', ''),
+(NULL, 'upload', 'text', 'text', 'upload_allowed_exts', '允许上传的文件后缀', '逗号隔开', 'jpg,jpeg,gif,png,ico', ''),
+(NULL, 'upload', 'text', 'text', 'path_naming_rule', '文件路径命名规则', '
路径命名变量对照表', '{Y}/{m}/{d}', ''),
+(NULL, 'upload', 'text', 'text', 'file_naming_rule', '文件命名规则', '
文件命名变量对照表', '{uniqid}', ''),
+(NULL, 'user', 'text', 'text', 'user_initial_quota', '用户初始配额容量', '单位:b,默认1073741824:1G,最大18位', '1073741824', ''),
+(NULL, 'mail', 'select', 'text', 'mail_send_mode', '邮件发送方式', NULL, 'smtp', '{\"smtp\":\"SMTP\"}'),
+(NULL, 'mail', 'select', 'text', 'mail_smtp_secure', 'SMTP验证方式', NULL, 'none', '{\"none\":\"None\",\"tls\":\"TLS\",\"ssl\":\"SSL\"}'),
+(NULL, 'mail', 'text', 'text', 'mail_smtp_host', 'SMTP主机地址', NULL, '', ''),
+(NULL, 'mail', 'text', 'text', 'mail_smtp_username', 'SMTP用户名', NULL, '', ''),
+(NULL, 'mail', 'text', 'password', 'mail_smtp_password', 'SMTP密码', NULL, '', ''),
+(NULL, 'mail', 'text', 'number', 'mail_smtp_port', 'SMTP端口', '25/465', '25', ''),
+(NULL, 'mail', 'text', 'email', 'mail_form_email', '发件人邮箱', NULL, '', ''),
---
--- 使用表AUTO_INCREMENT `lsky_images`
---
-ALTER TABLE `lsky_images`
- MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID';
+(NULL, 'other', 'bool', 'checkbox', 'soft_delete', '软删除', '删除图片时不删除源文件,不建议开启', '0', ''),
+(NULL, 'other', 'bool', 'checkbox', 'open_api', '开启API', '是否开放接口', '0', ''),
---
--- 使用表AUTO_INCREMENT `lsky_users`
---
-ALTER TABLE `lsky_users`
- MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+(NULL, 'storage_strategy', 'select', 'text', 'storage_strategy', '储存策略', NULL, 'local', ''),
+(NULL, 'local', 'text', 'text', 'local_cdn_domain', 'CDN加速域名', NULL, '', ''),
+(NULL, 'oss', 'text', 'text', 'oss_cdn_domain', 'Bucket域名', NULL, '', ''),
+(NULL, 'oss', 'text', 'text', 'oss_access_key_id', 'AccessKeyId', NULL, '', ''),
+(NULL, 'oss', 'text', 'text', 'oss_access_key_secret', 'AccessKeySecret', NULL, '', ''),
+(NULL, 'oss', 'text', 'text', 'oss_endpoint', 'Endpoint', '地域节点', '', ''),
+(NULL, 'oss', 'text', 'text', 'oss_bucket', 'Bucket', NULL, '', ''),
+(NULL, 'cos', 'text', 'text', 'cos_cdn_domain', 'CDN加速域名', NULL, '', ''),
+(NULL, 'cos', 'text', 'text', 'cos_secret_id', 'SecretId', NULL, '', ''),
+(NULL, 'cos', 'text', 'text', 'cos_secret_key', 'SecretKey', NULL, '', ''),
+(NULL, 'cos', 'text', 'text', 'cos_region', '所属地域', NULL, '', ''),
+(NULL, 'cos', 'text', 'text', 'cos_bucket', 'Bucket', '储存桶名称', '', ''),
+(NULL, 'kodo', 'text', 'text', 'kodo_cdn_domain', 'CDN加速域名', NULL, '', ''),
+(NULL, 'kodo', 'text', 'text', 'kodo_access_key', 'AccessKey', NULL, '', ''),
+(NULL, 'kodo', 'text', 'text', 'kodo_secret_key', 'SecretKey', NULL, '', ''),
+(NULL, 'kodo', 'text', 'text', 'kodo_bucket', 'Bucket', NULL, '', ''),
+(NULL, 'uss', 'text', 'text', 'uss_cdn_domain', 'CDN加速域名', NULL, '', ''),
+(NULL, 'uss', 'text', 'text', 'uss_operator_name', 'OperatorName', '操作员账号', '', ''),
+(NULL, 'uss', 'text', 'password', 'uss_operator_pwd', 'OperatorPwd', '操作员密码', '', ''),
+(NULL, 'uss', 'text', 'text', 'uss_service_name', 'ServiceName', '云储存服务名称', '', ''),
---
--- 使用表AUTO_INCREMENT `lsky_folders`
---
-ALTER TABLE `lsky_folders`
- MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', AUTO_INCREMENT=1;
+(NULL, 'audit', 'bool', 'checkbox', 'open_audit', '开启图片鉴黄', '接口申请地址:
https://www.moderatecontent.com', '0', ''),
+(NULL, 'audit', 'text', 'text', 'audit_key', 'Key', NULL, '', ''),
+(NULL, 'audit', 'select', 'text', 'audit_index', '内容评级', '1=所有人,2=少年,3=成人', '3', '{\"1\": \"所有人\", \"2\": \"少年\", \"3\": \"成人\"}'),
+
+(NULL, '', 'text', 'text', 'system_version', '系统版本', NULL, '1.4.2', '');
+
+INSERT INTO `lsky_group` (`id`, `strategy`, `name`, `default`, `update_time`, `create_time`) VALUES (NULL, 'local', '默认组', '1', '0', '0');
diff --git a/update.sql b/update.sql
index b11a4b5d..e3c1f408 100644
--- a/update.sql
+++ b/update.sql
@@ -53,3 +53,13 @@ UPDATE `lsky_config` SET `tip` = '接口申请地址: