style: 使用ruff格式化验证码模块,优化导入

This commit is contained in:
insistence
2024-07-12 11:06:57 +08:00
parent 91e31cfbf7
commit 380693c66d
2 changed files with 26 additions and 13 deletions

View File

@@ -1,8 +1,8 @@
from PIL import Image, ImageDraw, ImageFont
import base64
import io
import os
import random
import base64
from PIL import Image, ImageDraw, ImageFont
class CaptchaService:
@@ -35,7 +35,7 @@ class CaptchaService:
else:
result = num1 * num2
# 绘制文本
text = f"{num1} {operational_character} {num2} = ?"
text = f'{num1} {operational_character} {num2} = ?'
draw.text((25, 15), text, fill='blue', font=font)
# 将图像数据保存到内存中