|
@@ -155,8 +155,8 @@ class ProductsSchemeManageView(View):
|
|
|
current_time = datetime.datetime.now()
|
|
|
date_part = current_time.strftime("%Y%m%d%H%M%S")
|
|
|
# 使用string.ascii_uppercase生成大写随机字符
|
|
|
- random_part = ''.join(secrets.choice(string.ascii_uppercase) for _ in range(6))
|
|
|
- return f"PC{device_type}{date_part}-{random_part}"
|
|
|
+ random_part = ''.join(secrets.choice(string.ascii_uppercase) for _ in range(3))
|
|
|
+ return f"{date_part}-{device_type}-{random_part}"
|
|
|
except Exception as e:
|
|
|
LOGGER.error(f"生成编码失败: {repr(e)}")
|
|
|
raise
|