Comments (7)
我还配置了app.config["APPLICATION_ROOT"] = "/eng/",其他接口都可以使用,只有/docs接口没有办法用
from flask-siwadoc.
经过测试,问题出现在 这行return render_template(ui_file, spec_url=self.openapi_url),改成return render_template(ui_file, spec_url=“eng" + self.openapi_url)这样就是可以的
@siwa_bp.route(self.doc_url)
def doc_html():
siwa_user = self.app.config.get("SIWA_USER")
siwa_pass = self.app.config.get("SIWA_PASSWORD")
if siwa_user and siwa_pass:
global users
users = {
siwa_user: generate_password_hash(siwa_pass),
}
login_info = auth.get_auth()
password = auth.get_auth_password(login_info)
status = None
user = auth.authenticate(login_info, password)
if user in (False, None):
status = 401
elif not auth.authorize(None, user, auth):
status = 403
if status:
try:
return auth.auth_error_callback(status)
except TypeError:
return auth.auth_error_callback()
ui = request.args.get("ui") or self.ui
assert ui in SUPPORTED_UI, f"ui only support with {SUPPORTED_UI}"
ui_file = f'{ui}.html'
return render_template(ui_file, spec_url=self.openapi_url)
from flask-siwadoc.
这个 /eng
是你的业务路径吧,不能把业务代码侵入到框架代码中去
from flask-siwadoc.
这个
/eng
是你的业务路径吧,不能把业务代码侵入到框架代码中去
是的,那是我的业务路径,不知道有什么方法可以配置?
from flask-siwadoc.
这个
/eng
是你的业务路径吧,不能把业务代码侵入到框架代码中去
应该默认获取同级路由, 不应该自己去配置
from flask-siwadoc.
@lzjun567 大佬,改一下templates, 从js 那边获取当前页面的url
from flask-siwadoc.
@lzjun567 大佬,改一下templates, 从js 那边获取当前页面的url
from flask-siwadoc.
Related Issues (17)
- swagger文档加载慢,请问该怎么解决? HOT 1
- Form和files类型的支持 HOT 2
- 接口比较多,没办法创建两个接口文档 HOT 1
- 请问 可以自定义 response code 吗
- 上传多个文件对象且用文件名自动生成key
- 怎么支持 authorizations
- 关于加入Header参数的支持 HOT 1
- 有计划支持pydantic2.x吗
- 你好,flask-siwadoc这个包支持传入token吗?
- 能否在离线环境中使用? HOT 2
- 初始化直接显示没有title字段 HOT 2
- 修复methodview方法重名bug HOT 1
- 如果使用了蓝图 要如何注册呢 HOT 2
- padantic 数据类型是 另一个model时,解析出错 HOT 1
- defination status code
- 缺少针对header的校验
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-siwadoc.