匹配回收,bug修复
This commit is contained in:
4
app/.env
4
app/.env
@@ -12,8 +12,8 @@ zn_username=%E8%87%AA%E5%8A%A8%E5%8C%96_Robot
|
||||
client_name=ShuFuAI
|
||||
|
||||
|
||||
# java_api_base=http://127.0.0.1:18080
|
||||
java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://8.136.19.173:18081
|
||||
java_api_base=http://8.136.19.173:18080
|
||||
# java_api_base=http://8.136.19.173:18080
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
24
app/main.py
24
app/main.py
@@ -19,6 +19,7 @@ import threading
|
||||
import time
|
||||
import requests
|
||||
import subprocess
|
||||
import atexit
|
||||
|
||||
from amazon.del_brand import kill_process
|
||||
|
||||
@@ -39,6 +40,21 @@ print(f"""
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
APP_URL = "http://127.0.0.1:5123"
|
||||
PORT = 5123
|
||||
_shutdown_started = False
|
||||
|
||||
|
||||
def cleanup_before_exit():
|
||||
global _shutdown_started
|
||||
if _shutdown_started:
|
||||
return
|
||||
_shutdown_started = True
|
||||
try:
|
||||
kill_process('v6')
|
||||
except Exception as e:
|
||||
print(f"【退出前】关闭紫鸟浏览器进程异常: {str(e)}")
|
||||
|
||||
|
||||
atexit.register(cleanup_before_exit)
|
||||
|
||||
|
||||
def generate_images(params):
|
||||
@@ -57,6 +73,11 @@ class WindowAPI:
|
||||
window.events.restored += lambda _: setattr(self, '_is_maximized', False)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
self._window.destroy()
|
||||
except:
|
||||
pass
|
||||
return
|
||||
try:
|
||||
kill_process('v6')
|
||||
except Exception as e:
|
||||
@@ -369,6 +390,7 @@ def start_task_monitor():
|
||||
|
||||
|
||||
def on_window_closing():
|
||||
return
|
||||
"""窗口关闭事件处理器,执行与 close() 方法相同的清理逻辑"""
|
||||
# 先关闭窗口,避免看起来卡着
|
||||
try:
|
||||
@@ -419,7 +441,7 @@ def main():
|
||||
window.expose(api.close, api.minimize, api.maximize, api.toggle_maximize, generate_images, api.save_image, api.save_image_to_folder, api.select_folder, api.select_brand_xlsx_files, api.select_brand_folder,
|
||||
api.save_file_from_url, api.save_template_xlsx,api.save_template_zip,api.upload_file_to_java,api.open_external_url,api.enqueue_json,api.get_detail_del,api.save_file_from_url_new)
|
||||
webview.start(
|
||||
debug=False,
|
||||
debug=True,
|
||||
storage_path=cache_path,
|
||||
private_mode=False
|
||||
)
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>格式转换 - 数富AI</title>
|
||||
<script type="module" crossorigin src="/assets/convert.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-V_UIajJm.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-1nUVsWrm.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-Q4glvYu5.css">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-Cq_E2BnJ.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-DZ5_PGnw.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-BbIq-QPS.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/convert-7wWJ02Tw.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>数据去重 - 数富AI</title>
|
||||
<script type="module" crossorigin src="/assets/dedupe.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-V_UIajJm.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-1nUVsWrm.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-Q4glvYu5.css">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-Cq_E2BnJ.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-DZ5_PGnw.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-BbIq-QPS.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/dedupe-BpNHwt51.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>删除品牌 - 数富AI</title>
|
||||
<script type="module" crossorigin src="/assets/delete-brand.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-V_UIajJm.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-1nUVsWrm.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-Q4glvYu5.css">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-Cq_E2BnJ.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-DZ5_PGnw.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-BbIq-QPS.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/delete-brand-Dl7T0pmm.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>数据拆分 - 数富AI</title>
|
||||
<script type="module" crossorigin src="/assets/split.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-V_UIajJm.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-1nUVsWrm.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-Q4glvYu5.css">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pywebview-Cq_E2BnJ.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/brand-DZ5_PGnw.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/pywebview-BbIq-QPS.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/split-CRUIYKS6.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user