This commit is contained in:
Daniel 2023-10-30 15:25:46 +08:00
parent ed117fd577
commit eba283d8b2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 25 additions and 2 deletions

View file

@ -101,7 +101,15 @@ func searchAsset(c *gin.Context) {
}
k := arg["k"].(string)
ret.Data = model.SearchAssetsByName(k)
var exts []string
if extsArg := arg["exts"]; nil != extsArg {
for _, ext := range extsArg.([]interface{}) {
exts = append(exts, ext.(string))
}
}
ret.Data = model.SearchAssetsByName(k, exts)
return
}