加入接口文档页面

This commit is contained in:
liuwei
2025-05-23 10:21:48 +08:00
parent e04c0f0b74
commit 865228a9d9
3 changed files with 62 additions and 1 deletions

View File

@@ -13,7 +13,10 @@ system_bp = Blueprint('system', __name__)
# 记录应用启动时间
APP_START_TIME = time.time()
@app.route('/api_docs')
@login_required
def api_docs():
return render_template('api_docs.html')
# 页面路由
@system_bp.route('/wx_logs')
@login_required

View File

@@ -0,0 +1,53 @@
{% extends "base.html" %}
{% block title %}接口文档 - 机器人管理后台{% endblock %}
{% block content %}
<!-- 接口文档 -->
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover">
<div slot="header">
<span>接口文档</span>
</div>
<div class="iframe-container">
<iframe src="http://192.168.2.170:8058/" frameborder="0" width="100%" height="800px"></iframe>
</div>
</el-card>
</el-col>
</el-row>
</div>
{% endblock %}
{% block scripts %}
<script>
new Vue({
el: '#app',
mixins: [baseApp],
data() {
return {
// 设置当前菜单项
currentView: '13' // 使用一个新的索引,确保在菜单中能正确高亮
}
},
mounted() {
// 页面加载时设置当前视图
this.currentView = '13';
}
});
</script>
<style>
.iframe-container {
width: 100%;
overflow: hidden;
}
.iframe-container iframe {
border: none;
width: 100%;
min-height: 800px;
}
</style>
{% endblock %}

View File

@@ -171,6 +171,11 @@
<i class="el-icon-connection"></i>
<span slot="title">虚拟群组</span>
</el-menu-item>
<!-- 添加接口文档菜单项 -->
<el-menu-item index="13">
<i class="el-icon-document"></i>
<span slot="title">接口文档</span>
</el-menu-item>
</el-menu>
</div>