mom上传图片

This commit is contained in:
2025-09-15 16:56:04 +08:00
parent 035a0ffc16
commit 72c432d7fe
3 changed files with 7 additions and 1 deletions

View File

@@ -647,4 +647,5 @@ def start_loop():
if __name__ == '__main__':
# pyinstaller main_cy.py --add-data config_cy.ini:.
# 冲压
start_loop()

View File

@@ -458,4 +458,5 @@ def start_loop():
if __name__ == '__main__':
# pyinstaller main_pb.py --add-data config_pb.ini:.
# 平板
start_loop()

View File

@@ -6,7 +6,9 @@ from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
# 加载配置
with open("config_mom.json", encoding="utf-8") as f:
current_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(current_dir, 'config_mom.json')
with open(config_path, encoding="utf-8") as f:
config = json.load(f)
MOM_UPLOAD_URL = f"{config['mom_prefix']}/cams-service/openapi/hotwater/file/upload"
@@ -49,6 +51,8 @@ class ImageHandler(FileSystemEventHandler):
if __name__ == "__main__":
# pyinstaller upload_pict_mom.py --add-data config_mom.json:.
# 给mom上传图片
for folder in WATCH_FOLDERS:
os.makedirs(folder, exist_ok=True)