Your Name 3 years ago
parent
commit
f7d8831e60
1 changed files with 6 additions and 4 deletions
  1. 6 4
      step_question/apis/main.py

+ 6 - 4
step_question/apis/main.py

@@ -8,7 +8,7 @@ from fastapi.responses import HTMLResponse
 from fastapi.staticfiles import StaticFiles
 import io
 from starlette.responses import RedirectResponse
-
+import codecs
 app = FastAPI()
 app.add_middleware(
     CORSMiddleware,
@@ -42,9 +42,11 @@ async def submit(request: Request):
     }
     print(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