feat(system): 实现注册码功能并优化用户注册流程
- 新增注册码生成和验证功能- 实现系统设置管理,包括注册功能开关 - 更新前端界面,增加系统管理和注册码相关功能 - 修改数据库结构,添加系统设置和注册码表
This commit is contained in:
32
sql/system.sql
Normal file
32
sql/system.sql
Normal file
@@ -0,0 +1,32 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for system_settings
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS "system_settings";
|
||||
CREATE TABLE "system_settings" (
|
||||
"setting_key" TEXT NOT NULL,
|
||||
"setting_value" TEXT,
|
||||
"description" TEXT,
|
||||
PRIMARY KEY ("setting_key")
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of system_settings
|
||||
-- ----------------------------
|
||||
INSERT INTO "system_settings" ("setting_key", "setting_value", "description") VALUES ('registration.enabled', 'true', '是否开放用户注册功能');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for registration_codes
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS "registration_codes";
|
||||
CREATE TABLE "registration_codes" (
|
||||
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"code" TEXT NOT NULL,
|
||||
"expiry_time" TEXT NOT NULL,
|
||||
"created_by" TEXT,
|
||||
"created_at" TEXT DEFAULT (datetime('now','localtime'))
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "uk_code"
|
||||
ON "registration_codes" (
|
||||
"code" ASC
|
||||
);
|
||||
Reference in New Issue
Block a user