mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
修复安装路由异常
This commit is contained in:
@@ -44,8 +44,9 @@ func InstallCheckMiddleware() gin.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果未安装且不是访问安装接口,则返回 403 JSON
|
// 如果未安装且是 API 请求但不是安装接口,则返回 403 JSON
|
||||||
if !isInstalled && !isInstallRoute {
|
// 如果是前端页面请求,不在此处拦截,交由前端 Vue Router 拦截并跳转至安装页
|
||||||
|
if !isInstalled && !isInstallRoute && len(path) >= 4 && path[:4] == "/api" {
|
||||||
c.JSON(http.StatusForbidden, gin.H{
|
c.JSON(http.StatusForbidden, gin.H{
|
||||||
"code": 403,
|
"code": 403,
|
||||||
"msg": "系统未初始化,请先完成安装",
|
"msg": "系统未初始化,请先完成安装",
|
||||||
|
|||||||
Reference in New Issue
Block a user