feat:多项功能优化
This commit is contained in:
@@ -84,11 +84,13 @@ func authInterceptor(ctx *svc.ServiceContext) func(next http.HandlerFunc) http.H
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
path := r.URL.Path
|
||||
|
||||
// 白名单:健康检查 / 登录注册 / 免登录大屏 / 内部API(自带写死token校验)
|
||||
// 白名单:健康检查 / 登录注册 / 免登录大屏 / 内部API(自带写死token校验) / 附件静态文件
|
||||
// /uploads/* 为附件预览(window.open 新窗口打开,浏览器无法携带 Authorization 头),必须免鉴权。
|
||||
if path == "/api/health" ||
|
||||
strings.HasPrefix(path, "/api/auth/") ||
|
||||
strings.HasPrefix(path, "/api/display/") ||
|
||||
strings.HasPrefix(path, "/api/internal/") {
|
||||
strings.HasPrefix(path, "/api/internal/") ||
|
||||
strings.HasPrefix(path, "/uploads/") {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user