fix: absolute path bug

This commit is contained in:
Terry Geng
2020-12-31 11:06:44 +08:00
parent f96c9f7f89
commit 8870667064
2 changed files with 6 additions and 3 deletions

View File

@ -225,7 +225,8 @@ def get_all_dirs():
@web.route("/", methods=['GET'])
@requires_auth
def index():
return open(f"templates/index.{var.language}.html", "r").read()
root_dir = os.path.dirname(__file__)
return open(os.path.join(root_dir, f"templates/index.{var.language}.html"), "r").read()
@web.route("/playlist", methods=['GET'])