diff --git a/.gitignore b/.gitignore index afd3f09..11ecdc7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ apps/__pycache__/fix_up_color_two_a.cpython-310.pyc apps/__pycache__/ps_image_shadow_up_ag_two_a.cpython-310.pyc apps/__pycache__/white_purification_v3.cpython-310.pyc apps/__pycache__/white_purification_v4.cpython-310.pyc +comfyui/util/__pycache__/utils.cpython-311.pyc diff --git a/apps/auto_convert3d_new.py b/apps/auto_convert3d_new.py index 411d552..bfcd238 100644 --- a/apps/auto_convert3d_new.py +++ b/apps/auto_convert3d_new.py @@ -165,7 +165,7 @@ def team_check(r): print(f'{update_repair_status_url}?id={repair_id}') res = requests.get(f'{update_repair_status_url}?id={repair_id}') print('更新团队审核状态:', res.text) - #shutil.rmtree(os.path.join(workdir, 'print', pid,orderId), ignore_errors=True) + shutil.rmtree(os.path.join(workdir, 'print', pid,orderId), ignore_errors=True) print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} 生成团队审核模型 end') def get_p3d_info(pid): diff --git a/openapi/config.toml b/openapi/config.toml index 8e01cfb..e5016cf 100644 --- a/openapi/config.toml +++ b/openapi/config.toml @@ -1,6 +1,9 @@ [account] - appId="1nt7j0w17ecd9duruc48m7050012r5a8" - appSecret="1nt7j0w17ecd9duruc48m70600m2a32r" + #appId="1nt7j0w17ecd9duruc48m7050012r5a8" + #appSecret="1nt7j0w17ecd9duruc48m70600m2a32r" + #shopId="1" + appId="xdezmm02857d9vp1s5j8f3i300r1ige1" + appSecret="xdezmm02857d9vp1s5j8gtd400ml1lwe" shopId="1" [oss] diff --git a/openapi/main.py b/openapi/main.py index d9e8c4a..03edcbe 100644 --- a/openapi/main.py +++ b/openapi/main.py @@ -189,20 +189,22 @@ def main(imagePath = ""): os.remove(imagePath) return data,True - - -if __name__ == "__main__": - #获取请求参数 - args = sys.argv[1:] - if len(args) == 0: - #需要二次确认是否要处理images目录下的所有图片 - confirmV = input("是否要处理images目录下的所有图片? (y/n)") - if confirmV == "y": - imageFolder() - else: - print("请输入图片路径") - sys.exit(1) - else: - for imagePath in args: - main(imagePath) - print(f"{args}") +def test(): + utils.getToken() + +test() +# if __name__ == "__main__": +# #获取请求参数 +# args = sys.argv[1:] +# if len(args) == 0: +# #需要二次确认是否要处理images目录下的所有图片 +# confirmV = input("是否要处理images目录下的所有图片? (y/n)") +# if confirmV == "y": +# imageFolder() +# else: +# print("请输入图片路径") +# sys.exit(1) +# else: +# for imagePath in args: +# main(imagePath) +# print(f"{args}") diff --git a/openapi/token.txt b/openapi/token.txt deleted file mode 100644 index e79f727..0000000 --- a/openapi/token.txt +++ /dev/null @@ -1 +0,0 @@ -xdezmm0291gd9x7z89yj3um2709r55mu|1747365162 \ No newline at end of file diff --git a/openapi/utils.py b/openapi/utils.py index 7648c7f..545cd28 100644 --- a/openapi/utils.py +++ b/openapi/utils.py @@ -5,7 +5,8 @@ def cfg(keyName): try: with open('config.toml', 'r') as f: config = toml.load(f) - + + print(config) if "." in keyName: keyName = keyName.split(".") return config[keyName[0]][keyName[1]] @@ -42,6 +43,7 @@ def getToken(): return token.split("|")[0] #获取token + print(cfg("api.domain")) url = cfg("api.domain")+cfg("api.getToken") params = { "appId":cfg("account.appId"), diff --git a/test/test.py b/test/test.py deleted file mode 100644 index e86355c..0000000 --- a/test/test.py +++ /dev/null @@ -1,33 +0,0 @@ - -import requests -#url -#循环100次 -for i in range(100): - url = "https://mp.api.suwa3d.com/api/oss/putSignURL?key_name=photos/233522/photo2/"+str(i)+".jpg" - #请求url - res = requests.get(url) - #打印结果 - print(res.text) - #转json - res_json = res.json() - ossUrl = res_json['data'] - print(f"当前是第几个:{i}, ossUrl: {ossUrl}") - # data 是一个 oss 的上传连接, 向这个上传连接发送一个文件 - # 上传文件 - try: - #with open("E:/microservice/make2/data/0.jpg", 'rb') as f: - file = open('E:/microservice/make2/data/0.jpg', 'rb') - response = requests.put(ossUrl, data=file, headers={"Content-Type": "application/octet-stream"}) - print(response.status_code) - if response.status_code == 200: - upload_is_ok = True - else: - print(f"上传图片异常,状态码: {response.status_code}") - except RequestException as e: - print(f"上传异常: {str(e)}") - # file = open('E:/microservice/make2/data/0.jpg', 'rb') - # res = requests.put(ossUrl, data=file) - # print(res.text) - - -# url = "https://mp.api.suwa3d.com/api/oss/putSignURL?key_name=objs/photos/233522/a.jpg" \ No newline at end of file