mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
Fix the abnormal path retrieval issue in some systems.
This commit is contained in:
@@ -2,12 +2,14 @@ package server
|
||||
|
||||
import (
|
||||
"NetworkAuth/public"
|
||||
"NetworkAuth/utils"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -48,6 +50,9 @@ func registerFrontendRoutes(r *gin.Engine) {
|
||||
return // 反向代理接管了所有非 API 路由,直接返回
|
||||
} else {
|
||||
// 使用本地外部目录
|
||||
if !filepath.IsAbs(distConfig) {
|
||||
distConfig = filepath.Join(utils.GetRootDir(), distConfig)
|
||||
}
|
||||
fileServer = http.FileServer(http.Dir(distConfig))
|
||||
|
||||
// 拦截并处理静态资源请求
|
||||
|
||||
Reference in New Issue
Block a user