Skip to content

Commit

Permalink
优化ui路径
Browse files Browse the repository at this point in the history
不需要把dist文件夹复制到根目录下了
  • Loading branch information
Anyk00 committed Sep 18, 2024
1 parent 347f564 commit ad306ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def jump_to_index(window):
api = Api()
window = webview.create_window(
title="多开管理器",
url="dist/index.html",
url="ui/dist/index.html",
js_api=api,
min_size=(400, 500),
width=400,
Expand Down
8 changes: 4 additions & 4 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
mimetypes.add_type("text/css", ".css")
mimetypes.add_type("application/javascript", ".js")

app = Flask(__name__, static_folder="dist", static_url_path="")
app = Flask(__name__, static_folder="ui/dist", static_url_path="")
sock = Sock(app)
CORS(app)

Expand Down Expand Up @@ -64,17 +64,17 @@ def decorated_function(*args, **kwargs):

@app.route("/<path:path>")
def serve_index(path):
return send_from_directory("dist", path)
return send_from_directory("ui/dist", path)


@app.errorhandler(404)
def not_found(e):
if (path := request.path).startswith("/docs"):
try:
return send_from_directory("dist" + path, "index.html")
return send_from_directory("ui/dist" + path, "index.html")
except NotFound:
return "<h1>404 Not Found</h1>", 404
return send_from_directory("dist", "index.html")
return send_from_directory("ui/dist", "index.html")


@app.route("/conf", methods=["GET", "POST"])
Expand Down

0 comments on commit ad306ab

Please sign in to comment.