This commit is contained in:
Liang Ding 2022-10-12 09:23:45 +08:00
parent d63c63bbd7
commit 1a8c519fb3
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -35,7 +35,7 @@ func getSnippet(c *gin.Context) {
return
}
typ := arg["type"].(string)
typ := arg["type"].(string) // js/css/all
enabledArg := int(arg["enabled"].(float64)) // 0禁用1启用2全部
enabled := true
if 0 == enabledArg {
@ -55,6 +55,9 @@ func getSnippet(c *gin.Context) {
snippets = append(snippets, s)
}
}
if 1 > len(snippets) {
snippets = []*conf.Snippet{}
}
ret.Data = map[string]interface{}{
"snippets": snippets,