guoyu/Study-Vue-redis/database_init_system_expire_time.sql
2025-12-03 18:58:36 +08:00

14 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 系统有效时间配置初始化SQL
-- 作用:初始化系统有效时间配置,用于控制系统的登录有效期
-- 说明:如果 system.top 配置存在且截止时间小于当前时间,则系统不能登录(系统管理员除外)
-- 系统有效时间配置格式yyyy-MM-dd 或 yyyy-MM-dd HH:mm:ss
-- 如果配置的是日期格式yyyy-MM-dd则系统在该日期的23:59:59之前都可以登录
-- 如果配置的是日期时间格式yyyy-MM-dd HH:mm:ss则系统在该时间之前可以登录
-- 如果当前时间超过配置的截止时间,普通用户将无法登录,提示"系统出现问题,请联系管理员"
-- 系统管理员用户ID=1不受此限制可以正常登录
INSERT INTO `sys_config` (`config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `remark`)
VALUES ('系统有效时间', 'system.top', '', 'Y', 'admin', NOW(), '系统有效时间格式yyyy-MM-dd 或 yyyy-MM-dd HH:mm:ss。如果存在且截止时间小于当前时间则系统不能登录系统管理员除外。为空则不限制。')
ON DUPLICATE KEY UPDATE `config_value` = VALUES(`config_value`), `update_time` = NOW(), `remark` = VALUES(`remark`);