From 60f93316ab8db03697d11c2b501f5f4587345524 Mon Sep 17 00:00:00 2001 From: nick2wang Date: Sat, 30 Apr 2022 17:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=8F=E6=84=9F=E5=AD=97=E6=AE=B5=E5=8A=A0?= =?UTF-8?q?=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/models.py | 8 ++++---- src/init_sql/v1.8.4.sql | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/models.py b/sql/models.py index af182b99b7..3053575aea 100755 --- a/sql/models.py +++ b/sql/models.py @@ -71,10 +71,10 @@ class TwoFactorAuthConfig(models.Model): ('totp', 'Google身份验证器'), ) - username = models.CharField('用户名', max_length=150) - auth_type = models.CharField('认证类型', max_length=16, choices=auth_type_choice) - secret_key = models.CharField('用户密钥', max_length=64, null=True) - qrcode = models.CharField('二维码图片', max_length=128, null=True) + username = fields.EncryptedCharField(verbose_name='用户名', max_length=200) + auth_type = fields.EncryptedCharField(verbose_name='认证类型', max_length=128, choices=auth_type_choice) + secret_key = fields.EncryptedCharField(verbose_name='用户密钥', max_length=256, null=True) + qrcode = fields.EncryptedCharField(verbose_name='二维码图片', max_length=256, null=True) user = models.OneToOneField(Users, on_delete=models.CASCADE) def __int__(self): diff --git a/src/init_sql/v1.8.4.sql b/src/init_sql/v1.8.4.sql index d5cd3f5244..d46cb89c07 100644 --- a/src/init_sql/v1.8.4.sql +++ b/src/init_sql/v1.8.4.sql @@ -5,10 +5,10 @@ INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('菜单 Op -- 新增2fa配置表 CREATE TABLE `2fa_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `username` varchar(150) NOT NULL, - `auth_type` varchar(16) NOT NULL, - `secret_key` varchar(64) DEFAULT NULL, - `qrcode` varchar(128) DEFAULT NULL, + `username` varchar(200) NOT NULL, + `auth_type` varchar(128) NOT NULL, + `secret_key` varchar(256) DEFAULT NULL, + `qrcode` varchar(256) DEFAULT NULL, `user_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `user_id` (`user_id`),