zhangwei 3 rokov pred
rodič
commit
f48df4ecc6
1 zmenil súbory, kde vykonal 11 pridanie a 7 odobranie
  1. 11 7
      server/main.py

+ 11 - 7
server/main.py

@@ -37,8 +37,9 @@ def build_mini_program(branch):
     "cd "+current_path+ ";"
     "cd longVideoFactory;"
     "rm -rf dist;"
-    "git pull;"
     "git checkout "+branch+";"
+    "git fetch --all;"
+    "git reset --hard origin/"+branch+";"
     "git pull;"
     "cnpm install && npm install ;"
     "npm run build;"
@@ -62,10 +63,12 @@ def create_preview(project,page):
     code_img_path =  os.path.join(current_path,'1.png')
     
     path = """ '{"pathName":"%s"}' """ % page
-
+    os.system(wx_cli+ " open ")
     os.system(wx_cli+ " open --project " + dist_path)
-    os.system(wx_cli+ " reset-fileutils --project " + dist_path)
+    os.system(wx_cli+ " reset-fileutils --project " + dist_path)    
     f_read = os.popen(wx_cli+" preview  --project "+dist_path+"  --compile-condition "+path+"   --qr-output "+code_img_path+" --qr-format image").read()
+    print(f_read)
+    os.system(wx_cli+ " cache --clean all --project " + dist_path)    
     os.system(wx_cli+ " quit")
     if "[error]" in f_read:
         res_json["code"] = 3
@@ -104,7 +107,7 @@ def upload_img_by_feishu():
     headers = {
         "Authorization":"Bearer "+token,
     }
-    res = requests.post(url,headers=headers,files=files).json()
+    res = requests.post(url,headers=headers,files=files,verify=False).json()
     if res["code"] == 0:
         global_params["img_key"] = res["data"]["image_key"]
         res_json["code"] = 0
@@ -119,7 +122,8 @@ def tenant_access_token_by_feishu():
         "app_id":"cli_a1ec07458838d00c",
         "app_secret":"Ngm0kfaLkZnpM2T2DH7L8cM5hdAqY0hI"
     }
-    res = requests.post(url,data=params).json()
+    res = requests.post(url,data=params,verify=False).json()
+    print(res)
     if res["code"] == 0:
         global_params["token"] = res["tenant_access_token"]
         res_json["msg"] = "获取飞书签名成功"
@@ -165,7 +169,7 @@ def send_msg_by_feishu(chat_id,project_name,mode_name,branch):
                 }
         })
     }
-    res = requests.post(url,headers=headers,data=json.dumps(params)).json()
+    res = requests.post(url,headers=headers,data=json.dumps(params),verify=False).json()
     if res["code"] == 0:
         res_json["code"] = 0
         res_json["msg"] = "飞书消息发送成功"
@@ -182,7 +186,7 @@ def get_group_by_feishu():
         "Content-Type": "application/json;charset=UTF-8"
     }
     url = "https://open.feishu.cn/open-apis/im/v1/chats"
-    res = requests.get(url,headers=headers).json()
+    res = requests.get(url,headers=headers,verify=False).json()
     data = []
     for item in res["data"]["items"]:
         if item["name"]  != '':