feat(group): 业务组禁用后限制用户登录和配置拉取

This commit is contained in:
2026-03-15 21:19:48 +08:00
parent 928a95fccd
commit 6ab368f21e
5 changed files with 62 additions and 2 deletions
+10
View File
@@ -53,6 +53,16 @@ func (h *ConfigApiHandler) FetchAllConfigs(c *gin.Context) {
return
}
// check if app's group is enabled
if app.GroupId != nil {
var group model.BusinessGroup
has, _ := dao.Engine.ID(*app.GroupId).Get(&group)
if !has || !group.Enabled {
c.JSON(http.StatusForbidden, model.WrapperResponse{Code: 403, Msg: "业务组已禁用"})
return
}
}
// validate token if app has token configured
if app.Token != "" && app.Token != req.Token {
c.JSON(http.StatusForbidden, model.WrapperResponse{Code: 403, Msg: "Token 无效"})