浏览代码

static page

ming 3 年之前
父节点
当前提交
1213fee796
共有 2 个文件被更改,包括 15 次插入3 次删除
  1. 11 0
      main.py
  2. 4 3
      script_msg.js

+ 11 - 0
main.py

@@ -39,6 +39,11 @@ class request(BaseModel):
     text_content: str
     image_urls: List[str]
 
+class QQ(BaseModel):
+    n1: str
+    n2: str
+
+
 class request2(BaseModel):
     name: str
     text_content: List[str]
@@ -63,6 +68,12 @@ async def index2():
 async def index2():
     return FileResponse('style.css')
 
+@app.post("/qqreq")
+async def qqreq(qq:QQ):
+    print(qq.n1)
+    print(qq.n2)
+    return {"msg":"製作影片需要時間,請您耐心等候"} 
+
 @app.post("/make_video_req")
 async def make_video_req(req:request):
     x = threading.Thread(target=make_video, args=(req.name, req.text_content, req.image_urls))

+ 4 - 3
script_msg.js

@@ -30,10 +30,11 @@ $(".next").click(function(){
   console.log(obj3);
 
   $.ajax({
-	url: 'http://www.choozmo.com:8888/make_anchor_video_v2',
+	//url: 'http://www.choozmo.com:8888/make_anchor_video_v2',
+	url: 'http://www.choozmo.com:8888/qqreq',
 	type: 'post',
-	data: obj3,
-	
+	//data: obj3,
+	data:JSON.stringify({n1:"12",n2:"22"}),
 	error: function (error) {
 		console.error(error)
 	}