Your Name 3 years ago
parent
commit
e5cd1a8be4
2 changed files with 6 additions and 2 deletions
  1. 5 1
      step_question/apis/main.py
  2. 1 1
      step_question/apis/static/index2.html

+ 5 - 1
step_question/apis/main.py

@@ -41,7 +41,11 @@ async def submit(request: Request):
         'decoration_size': ','.join(form_data.getlist('q8')),
     }
     get_db().insert(result)
-    return result
+
+    response = RedirectResponse(url='/a1/index_complete.html')
+    return response
+
+#    return result
 
 
 app.mount("/a1", StaticFiles(directory="static"), name="static")

+ 1 - 1
step_question/apis/static/index2.html

@@ -27,7 +27,7 @@
     <span style="text-align: center;display: block; font-weight: 700;">送五萬元裝潢折抵券</span>
   </div> -->
 <iframe name="dummyframe" id="dummyframe" style="display: none;"></iframe>
-<form action="http://127.0.0.1:8000/step_questions/submit" method="post" id="msform" target="dummyframe">
+<form action="/step_questions/submit" method="post" id="msform" target="dummyframe">
   <div class="notice_card">
     您好,我們是幸福空間,想要進行裝修市場調查。只要填寫完畢就送您 City Cafe 或 Cama 咖啡乙杯及裝修折價卷五萬元!
     贈送方式將以LINE寄送數位條碼,可直接至全省 City Cafe 或 Cama 門市兌換,為確保兌換權益,請務必填寫真實資訊,感謝您的配合。