增加默认执行all命令
This commit is contained in:
parent
1e8fc7d1de
commit
be93d78d71
@ -221,17 +221,20 @@ class MainShowChatRecords():
|
|||||||
|
|
||||||
app.register_blueprint(api)
|
app.register_blueprint(api)
|
||||||
|
|
||||||
# 自动打开浏览器
|
try:
|
||||||
url = "http://127.0.0.1:5000/"
|
# 自动打开浏览器
|
||||||
# 根据操作系统使用不同的命令打开默认浏览器
|
url = "http://127.0.0.1:5000/"
|
||||||
if sys.platform.startswith('darwin'): # macOS
|
# 根据操作系统使用不同的命令打开默认浏览器
|
||||||
subprocess.call(['open', url])
|
if sys.platform.startswith('darwin'): # macOS
|
||||||
elif sys.platform.startswith('win'): # Windows
|
subprocess.call(['open', url])
|
||||||
subprocess.call(['start', url], shell=True)
|
elif sys.platform.startswith('win'): # Windows
|
||||||
elif sys.platform.startswith('linux'): # Linux
|
subprocess.call(['start', url], shell=True)
|
||||||
subprocess.call(['xdg-open', url])
|
elif sys.platform.startswith('linux'): # Linux
|
||||||
else:
|
subprocess.call(['xdg-open', url])
|
||||||
print("Unsupported platform, can't open browser automatically.")
|
else:
|
||||||
|
print("Unsupported platform, can't open browser automatically.")
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
print("[+] 请使用浏览器访问 http://127.0.0.1:5000/ 查看聊天记录")
|
print("[+] 请使用浏览器访问 http://127.0.0.1:5000/ 查看聊天记录")
|
||||||
app.run(host='0.0.0.0', port=5000, debug=False)
|
app.run(host='0.0.0.0', port=5000, debug=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user