From 619ebeacf14e83022f4c04e8cbaad0a9712a89f4 Mon Sep 17 00:00:00 2001 From: ahhui Date: Mon, 31 Jul 2023 14:43:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?build:=20=20=E5=A2=9E=E5=8A=A0pillow?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/requirements.txt b/backend/requirements.txt index 64fee45..5500c27 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -28,3 +28,4 @@ psycopg2==2.9.5 uvicorn==0.20.0 gunicorn==20.1.0 gevent==22.10.2 +Pillow==8.3.1 From 936928e854d5f95aa9b53a5b59a04acb130b638d Mon Sep 17 00:00:00 2001 From: ahhui Date: Mon, 31 Jul 2023 14:45:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?perf:=20=20=E5=BE=AE=E8=B0=83=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/application/settings.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/backend/application/settings.py b/backend/application/settings.py index f98615b..17453c8 100644 --- a/backend/application/settings.py +++ b/backend/application/settings.py @@ -13,6 +13,9 @@ https://docs.djangoproject.com/en/4.1/ref/settings/ import os import sys from pathlib import Path +from datetime import timedelta + +from conf.env import * # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -21,8 +24,6 @@ BASE_DIR = Path(__file__).resolve().parent.parent # ******************** 动态配置 ******************** # # ================================================= # -from conf.env import * - # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ @@ -303,8 +304,6 @@ AUTHENTICATION_BACKENDS = ["dvadmin.utils.backends.CustomBackend"] # ================================================= # # ****************** simplejwt配置 ***************** # # ================================================= # -from datetime import timedelta - SIMPLE_JWT = { # token有效时长 "ACCESS_TOKEN_LIFETIME": timedelta(minutes=120), @@ -343,11 +342,11 @@ SWAGGER_SETTINGS = { # ================================================= # # **************** 验证码配置 ******************* # # ================================================= # -CAPTCHA_IMAGE_SIZE = (160, 60) # 设置 captcha 图片大小 +CAPTCHA_IMAGE_SIZE = (160, 46) # 设置 captcha 图片大小 CAPTCHA_LENGTH = 4 # 字符个数 CAPTCHA_TIMEOUT = 1 # 超时(minutes) CAPTCHA_OUTPUT_FORMAT = "%(image)s %(text_field)s %(hidden_field)s " -CAPTCHA_FONT_SIZE = 40 # 字体大小 +CAPTCHA_FONT_SIZE = 36 # 字体大小 CAPTCHA_FOREGROUND_COLOR = "#64DAAA" # 前景色 CAPTCHA_BACKGROUND_COLOR = "#F5F7F4" # 背景色 CAPTCHA_NOISE_FUNCTIONS = (