refactor: 重构数据库orm为异步 #I9MRQS
This commit is contained in:
@@ -18,7 +18,7 @@ async def get_captcha_image(request: Request):
|
||||
register_enabled = True if await request.app.state.redis.get(
|
||||
f"{RedisInitKeyConfig.SYS_CONFIG.get('key')}:sys.account.registerUser") == 'true' else False
|
||||
session_id = str(uuid.uuid4())
|
||||
captcha_result = CaptchaService.create_captcha_image_service()
|
||||
captcha_result = await CaptchaService.create_captcha_image_service()
|
||||
image = captcha_result[0]
|
||||
computed_result = captcha_result[1]
|
||||
await request.app.state.redis.set(f"{RedisInitKeyConfig.CAPTCHA_CODES.get('key')}:{session_id}", computed_result, ex=timedelta(minutes=2))
|
||||
|
Reference in New Issue
Block a user