perf: 优化系统用户生成密码的复杂度 (#5648)

* perf: 优化系统用户生成密码的复杂度

* perf: 修改 common.random_string

Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: Bai <bugatti_it@163.com>
This commit is contained in:
fit2bot
2021-03-01 18:40:07 +08:00
committed by GitHub
parent 1036d1c132
commit 6f3ead3c42
5 changed files with 37 additions and 14 deletions

View File

@@ -7,6 +7,8 @@ import logging
import datetime
import uuid
from functools import wraps
import string
import random
import time
import ipaddress
import psutil
@@ -191,14 +193,6 @@ def with_cache(func):
return wrapper
def random_string(length):
import string
import random
charset = string.ascii_letters + string.digits
s = [random.choice(charset) for i in range(length)]
return ''.join(s)
logger = get_logger(__name__)