优化
This commit is contained in:
@@ -199,9 +199,10 @@ func (h *API) ApplySync(c *gin.Context) {
|
||||
httpx.OK(c)
|
||||
}
|
||||
func (h *API) FreshCasbin(c *gin.Context) {
|
||||
// Policies are read from casbin_rule on every authorization decision, so
|
||||
// there is no in-memory enforcer cache to reload. Keep the compatible
|
||||
// endpoint and success response.
|
||||
if err := h.service.FreshCasbin(c.Request.Context()); err != nil {
|
||||
httpx.Fail(c, "刷新失败")
|
||||
return
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "刷新成功")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user