|
@@ -8,7 +8,7 @@ from fastapi.responses import HTMLResponse
|
|
from fastapi.staticfiles import StaticFiles
|
|
from fastapi.staticfiles import StaticFiles
|
|
import io
|
|
import io
|
|
from starlette.responses import RedirectResponse
|
|
from starlette.responses import RedirectResponse
|
|
-
|
|
|
|
|
|
+import codecs
|
|
app = FastAPI()
|
|
app = FastAPI()
|
|
app.add_middleware(
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
CORSMiddleware,
|
|
@@ -42,9 +42,11 @@ async def submit(request: Request):
|
|
}
|
|
}
|
|
print(result)
|
|
print(result)
|
|
get_db().insert(result)
|
|
get_db().insert(result)
|
|
-
|
|
|
|
- response = RedirectResponse(url='/a1/index_complete.html')
|
|
|
|
- return response
|
|
|
|
|
|
+ fr=codecs.open('static/index_complete.html','r','utf-8')
|
|
|
|
+ lines=fr.read()
|
|
|
|
+ fr.close()
|
|
|
|
+# response = RedirectResponse(url='/a1/index_complete.html')
|
|
|
|
+ return HTMLResponse(content=lines, status_code=200)
|
|
|
|
|
|
# return result
|
|
# return result
|
|
|
|
|