This commit is contained in:
2025-07-04 14:18:16 +08:00
parent 72e4e9ef6f
commit 35d50305c8
+6 -1
View File
@@ -10,6 +10,11 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# 获取当前时间,格式化为字符串
now_str = datetime.now().strftime("%Y%m%d%H%M%S")
# 日志目录
log_dir = "logs"
# 如果目录不存在,则创建
os.makedirs(log_dir, exist_ok=True)
current_file = os.path.splitext(os.path.basename(__file__))[0]
log_filename = f"{current_file}_{now_str}.log"
@@ -159,7 +164,7 @@ def main():
st.subheader("运行结果")
if result.get('status'):
st.success("执行成功")
st.json(result.get('data'))
st.info(result.get('data'))
else:
st.error(f"执行失败: {result.get('message', '未知错误')}")