摘要: # # 1. Python 编译文件与缓存 # __pycache__/ *.py[cod] *$py.class *.so .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ va 阅读全文
posted @ 2026-10-07 22:31 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要: containers页面,打开每个实例,在ports列可以看到打开的端口 阅读全文
posted @ 2026-10-07 16:50 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要: 修改了 docker-compose.yml 配置文件后,直接使用 docker restart 或重启 Docker 服务不会生效 。因为 restart 只是把现有的容器停止并重新启动,而容器的端口映射、环境变量、挂载目录等底层配置是在容器“创建”时就写入的 。 要让修改后的 docker-co 阅读全文
posted @ 2026-10-07 16:30 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要: 一,安装第三方库 % pip install python-multipart 二,代码 schema: from fastapi import UploadFile from pydantic import BaseModel, Field class AssetUploadRequest(Bas 阅读全文
posted @ 2026-10-05 23:29 刘宏缔的架构森林 阅读(3) 评论(0) 推荐(0)
摘要: 一,安装用到的第三方库 % pip install fastapi uvicorn captcha 二,代码 库 from captcha.image import ImageCaptcha # 模拟 Redis 或 Session 存储,实际生产中应使用 Redis 并设置过期时间 captcha 阅读全文
posted @ 2026-10-04 21:26 刘宏缔的架构森林 阅读(5) 评论(0) 推荐(0)
摘要: 一,报错信息 % npm run serve > my-vue-app@0.1.0 serve > vue-cli-service serve node:internal/modules/cjs/loader:1568 throw err; ^ Error: Cannot find module ' 阅读全文
posted @ 2026-10-03 21:12 刘宏缔的架构森林 阅读(5) 评论(0) 推荐(0)
摘要: 一,安装用到的库 % pip install nanoid 二,代码 from nanoid import generate router = APIRouter(tags=["前台-首页"]) @router.get("/index", summary="首页") async def index( 阅读全文
posted @ 2026-10-02 22:54 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要: 在 JWT(JSON Web Token)认证中,access_token(访问令牌)和 refresh_token(刷新令牌)的核心区别在于用途、有效期以及安全性设计,两者配合可以在保证安全的同时提供良好的用户体验。 详细解析 1. Access Token(访问令牌) 角色:类似于你的“办公室门 阅读全文
posted @ 2026-10-01 21:49 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要: 两个要注意的环节: 一:alembic/env.py 要有这一行把models下的类引入: from app.models import * 如下: from app.db.dbbase import MyBaseModel from app.models import * # noqa: F401 阅读全文
posted @ 2026-09-30 22:30 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要: 一,代码 1,middleware """request_id 中间件。 优先沿用调用方传入的 ``X-Request-Id``,否则生成一个;把它绑进 contextvars 供日志使用,并在响应头回写。 """ from collections.abc import Awaitable, Cal 阅读全文
posted @ 2026-09-28 20:00 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)