Skip to content

Commit

Permalink
flask从本地读取文档
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Nov 19, 2023
1 parent 725992e commit ce7610c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def decorated_function(*args, **kwargs):
return decorated_function


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


@app.errorhandler(404)
Expand Down
1 change: 1 addition & 0 deletions ui/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ declare module '@vue/runtime-core' {
MaaWeekly: typeof import('./src/components/MaaWeekly.vue')['default']
MaaWeeklyNew: typeof import('./src/components/MaaWeeklyNew.vue')['default']
MaaWeeklypartly: typeof import('./src/components/MaaWeeklypartly.vue')['default']
NA: typeof import('naive-ui')['NA']
NAvatar: typeof import('naive-ui')['NAvatar']
NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
Expand Down
15 changes: 14 additions & 1 deletion ui/src/pages/Doc.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<template>
<div class="link-container">
在线文档地址:
<n-a href="https://arkmowers.github.io/arknights-mower/" target="_blank">
https://arkmowers.github.io/arknights-mower/
</n-a>
</div>
<iframe
:src="'https://arkmowers.github.io/arknights-mower/'"
src="/docs/index.html"
sandbox="allow-popups allow-scripts allow-same-origin"
style="width: 100%; height: 100vh; border: none"
/>
</template>

<style scoped>
.link-container {
width: 100%;
padding: 6px 12px 0;
}
</style>

0 comments on commit ce7610c

Please sign in to comment.