Skip to content

Commit

Permalink
feat: 检查接口返回插件名
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Jun 17, 2024
1 parent 32a56aa commit 1f2a32f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/http/controllers/plugin_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,16 @@ func (r *PluginController) IsInstalled(ctx http.Context) http.Response {
slug := ctx.Request().Input("slug")

plugin := r.plugin.GetInstalledBySlug(slug)
info := r.plugin.GetBySlug(slug)
if plugin.Slug != slug {
return Success(ctx, false)
return Success(ctx, http.Json{
"name": info.Name,
"installed": false,
})
}

return Success(ctx, true)
return Success(ctx, http.Json{
"name": info.Name,
"installed": true,
})
}

0 comments on commit 1f2a32f

Please sign in to comment.