浏览代码

fix gen avatar

ming 3 年之前
父节点
当前提交
f5c0fe958b
共有 1 个文件被更改,包括 30 次插入1 次删除
  1. 30 1
      api/static/script_msg.js

+ 30 - 1
api/static/script_msg.js

@@ -9,6 +9,7 @@ var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
 });
 
 
+
 (function(){
   $('.imgfr').hover(function(){
     $(this).next().css('display', 'block');
@@ -46,7 +47,7 @@ $(".next").click(function(){
 	console.log(dataOBJ)
   //alert('資料已送出! 請耐心等候')
   $.ajax({
-	url: 'http://www.choozmo.com:8888/make_anchor_video_v2',
+	url: 'http://192.168.1.106:8889/make_anchor_video_v2',
 	//url: 'http://www.choozmo.com:8888/qqreq',
 	dataType : 'json', // 預期從server接收的資料型態
   contentType : 'application/json; charset=utf-8', // 要送到server的資料型態
@@ -65,7 +66,35 @@ $(".next").click(function(){
 });
 
 });
+$(".gen_avatar").click(function(){
+  button.setAttribute('disabled', '');
+  setTimeout(function(){
+    button.removeAttribute('disabled')
+  }, 4000);
+  
+	dataOBJ = {"imgurl":$('.img_src').val();}
+	objstr = JSON.stringify(dataOBJ);
+	console.log(dataOBJ)
+  //alert('資料已送出! 請耐心等候')
+  $.ajax({
+	url: 'http://192.168.1.106:8889/swapFace',
+	dataType : 'json', // 預期從server接收的資料型態
+  contentType : 'application/json; charset=utf-8', // 要送到server的資料型態
+	type: 'post',
+	data: objstr,
+	success: function(suc_data) {
+    Swal.fire({
+      title: `${suc_data.msg}`,
+      confirmButtonColor: '#3085d6',
+    }); 
+	  },
+	//data:JSON.stringify({n1:"12",n2:"22"}),
+	error: function (error) {
+	  console.error(error)
+	}
+});
 
+});
 
 
 var loaded_data = ''