Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 222c0d1

Browse files
author
jxxghp
authored
Merge pull request NAStool#3592 from NAStool/dev
Dev
2 parents 77c7225 + 83e7d95 commit 222c0d1

5 files changed

+10
-0
lines changed

web/backend/user.cp310-win_amd64.pyd

8.5 KB
Binary file not shown.
17.3 KB
Binary file not shown.
54.3 KB
Binary file not shown.

web/security.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
import hashlib
23
from functools import wraps
34
from cryptography.fernet import Fernet
45

@@ -126,3 +127,10 @@ def encrypt_message(message, key):
126127
f = Fernet(key)
127128
encrypted_message = f.encrypt(message.encode())
128129
return encrypted_message.decode()
130+
131+
132+
def hash_sha256(message):
133+
"""
134+
对字符串做hash运算
135+
"""
136+
return hashlib.sha256(message.encode()).hexdigest()

web/templates/navigation.html

+2
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ <h5 class="modal-title">用户认证</h5>
884884
{% for SiteId, SiteAttr in CooperationSites.items() %}
885885
<div class="row user_auth_params" id="user_auth_{{ SiteId }}_params" style="{% if loop.index0 != 0 %}display:none{% endif %}">
886886
{% for ParamId, ParamAttr in SiteAttr.params.items() %}
887+
{% if ParamAttr.name %}
887888
<div class="col-12 col-lg">
888889
<div class="mb-3">
889890
<label class="form-label">{{ ParamAttr.name }} <span class="form-help"
@@ -892,6 +893,7 @@ <h5 class="modal-title">用户认证</h5>
892893
<input type="{{ ParamAttr.type }}" id="{{ SiteId }}_{{ ParamId }}" class="form-control" placeholder="{{ ParamAttr.placeholder }}">
893894
</div>
894895
</div>
896+
{% endif %}
895897
{% endfor %}
896898
</div>
897899
{% endfor %}

0 commit comments

Comments
 (0)