mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 02:10:23 +00:00
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:
@@ -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__)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user