浏览代码

test progress bar

ming 3 年之前
父节点
当前提交
a9f72dcc24
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. 2 2
      main.py
  2. 5 4
      script_msg.js

+ 2 - 2
main.py

@@ -117,9 +117,9 @@ async def progress_page():
 async def make_anchor_video_v2(req:request2):
     x = threading.Thread(target=anchor_video_v3, args=(req.name, req.text_content, req.image_urls))
     x.start()
-    #return RedirectResponse("https://www.choozmo.com/progress_page")
+    return RedirectResponse("https://www.choozmo.com/progress_page")
     #return {"https://www.choozmo.com:8888/progress_page"}
-    return {"msg":"製作影片需要時間,請您耐心等候  稍後可以在www.choozmo.com:8168/"+req.name+".mp4 中觀看"} 
+    #return {"msg":"製作影片需要時間,請您耐心等候  稍後可以在www.choozmo.com:8168/"+req.name+".mp4 中觀看"} 
 
 @app.websocket("/progress")
 async def websocket_endpoint(websocket: WebSocket):

+ 5 - 4
script_msg.js

@@ -1,7 +1,7 @@
 //jQuery time
 var current_fs, next_fs, previous_fs; //fieldsets
 var left, opacity, scale; //fieldset properties which we will animate
-var animating; //flag to prevent quick multi-click glitches
+var animating; //flag to prevent quick multi-click glitasdaches
 
 $(".next").click(function(){
   if( !validate() ){
@@ -37,9 +37,10 @@ $(".next").click(function(){
 	type: 'post',
 	data: obj3,
 	success: function(suc_data) {
-		//console.log(suc_data)
-		window.location.replace('www.choozmo.com:8888/progress_page');
-		//showThankyou();
+		if (suc_data.redirect) {
+            // data.redirect contains the string URL to redirect to
+            window.location.href = suc_data.redirect;
+        }
 	  },
 	//data:JSON.stringify({n1:"12",n2:"22"}),
 	error: function (error) {