From f972b6dca3b5499216a6ccc906d3bd6bafeb0ad4 Mon Sep 17 00:00:00 2001 From: nick2wang Date: Thu, 28 Apr 2022 17:20:33 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=96=B0=E5=A2=9E2FA=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/templates/2fa.html | 122 +++++++++++++++++++++++++++++++ common/templates/base.html | 142 +++++++++++++++++++++++++++++++++++++ common/twofa/__init__.py | 44 ++++++++++++ common/twofa/totp.py | 82 +++++++++++++++++++++ sql/admin.py | 8 ++- sql/models.py | 26 ++++++- sql/urls.py | 1 + sql/views.py | 14 ++++ src/init_sql/v1.8.4.sql | 13 ++++ 9 files changed, 450 insertions(+), 2 deletions(-) create mode 100644 common/templates/2fa.html create mode 100644 common/twofa/__init__.py create mode 100644 common/twofa/totp.py diff --git a/common/templates/2fa.html b/common/templates/2fa.html new file mode 100644 index 0000000000..88cdd4e8ca --- /dev/null +++ b/common/templates/2fa.html @@ -0,0 +1,122 @@ + + + + Archery - 两步验证 + {% load static %} + + + + + + + + + + +
+
+ +
+
+ + +
+

© Archery (v{{ archery_version }})

+
+ + + + + + + diff --git a/common/templates/base.html b/common/templates/base.html index 0b37ef1288..3ad61180cf 100644 --- a/common/templates/base.html +++ b/common/templates/base.html @@ -73,6 +73,7 @@ 管理后台 {% endif %} +
  • 双重认证
  • 修改密码
  • 退出
  • @@ -279,6 +280,59 @@ + + + + + +
    @@ -319,6 +373,94 @@ } }; +