Skip to content

Commit 1994ba5

Browse files
committed
update:关闭docs,redoc
1 parent 68175f9 commit 1994ba5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

depends.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def check_ip(self, ip):
3434
self.ips.pop(ip)
3535
return True
3636

37-
def add_ip(cls, ip):
38-
ip_info = cls.ips.get(ip, {'count': 0, 'time': datetime.now()})
37+
def add_ip(self, ip):
38+
ip_info = self.ips.get(ip, {'count': 0, 'time': datetime.now()})
3939
ip_info['count'] += 1
40-
cls.ips[ip] = ip_info
40+
self.ips[ip] = ip_info
4141
return ip_info['count']
4242

4343
async def remove_expired_ip(self):

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import asyncio
44
from pathlib import Path
55

6-
from fastapi import FastAPI, Depends, UploadFile, Form, File, HTTPException, BackgroundTasks, Header
6+
from fastapi import FastAPI, Depends, UploadFile, Form, File, HTTPException, BackgroundTasks
77
from starlette.responses import HTMLResponse, FileResponse
88
from starlette.staticfiles import StaticFiles
99

@@ -16,7 +16,7 @@
1616
from depends import admin_required
1717

1818
# 实例化FastAPI
19-
app = FastAPI(debug=settings.DEBUG)
19+
app = FastAPI(debug=settings.DEBUG, docs_url=None, redoc_url=None)
2020

2121
# 数据存储文件夹
2222
DATA_ROOT = Path(settings.DATA_ROOT)

0 commit comments

Comments
 (0)