修复开启「全站登录」后Token接口跳转到登录页面的问题

This commit is contained in:
yangjian 2021-06-17 20:49:11 +08:00
parent 89ba0f25f2
commit 668aeac15c
2 changed files with 16 additions and 2 deletions

View File

@ -7,6 +7,7 @@
- [修复]开启「全站登录」后URL跳转异常的问题
- [修复]Vditor编辑器编写的文档搜索高亮文档不解析的问题
- [修复]Vditor编辑器粘贴上传图片异常的处理
- [修复]开启「全站登录」后Token接口重定向到登录页面的问题
- [优化]用户禁止同名文集创建,文集下禁止同名文档创建;
- [优化]文集导出异常提示;
- [优化]Vditor文档目录样式
@ -14,7 +15,7 @@
- [优化]同步PearAdminLayui组件库版本至3.8.3
- [优化]文档编写页面保存逻辑;
- [优化]导出Markdown压缩包时文件名校验过滤
- [优化]PDF导出的文档类型
- [优化]PDF导出的文档类型
### v0.6.7 2021-05-29
- [新增]表格文档支持Excel文件(.xlsx格式)导入;

View File

@ -13,7 +13,20 @@ class RequiredLoginMiddleware():
def __init__(self, get_response):
self.get_response = get_response
# 设置排除URL
compile_tuple = (r'/login(.*)$', r'/logout(.*)$', r'/register(.*)$',r'/check_code(.*)$',r'/static/(.*)$')
compile_tuple = (
r'/login(.*)$', # 登录
r'/logout(.*)$', # 注销
r'/register(.*)$', # 注册
r'/check_code(.*)$', # 验证码
r'/static/(.*)$', # 静态文件
r'/api/get_projects/(.*)$', # token api 获取文集列表
r'/api/get_docs/(.*)$', # token api 获取文档列表
r'/api/get_doc/(.*)$', # token api 获取文档
r'/api/create_project/(.*)$', # token api 新建文集
r'/api/create_doc/(.*)$', # token api 新建文档
r'/api/modify_doc/(.*)$', # token api 修改文档
r'/api/upload_img/(.*)$', # token api 粘贴上传图片
)
self.exceptions = tuple(re.compile(url) for url in compile_tuple)
def __call__(self, request):