Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]路由admin修改后插件图片路由问题 #630

Open
a6652162 opened this issue Jul 17, 2024 · 0 comments
Open

[BUG]路由admin修改后插件图片路由问题 #630

a6652162 opened this issue Jul 17, 2024 · 0 comments
Labels
🐛bug Something isn't working

Comments

@a6652162
Copy link

bug 描述 [详细地描述 bug,让大家都能理解]

在创建项目时,如果不使用admin路由的话,在插件界面时,插件 基础Admin 的图片显示会有问题

复现步骤 [清晰描述复现步骤,让别人也能看到问题]

期望结果 [描述你原本期望看到的结果]

复现代码 [提供可复现的代码,仓库,或线上示例]

plugins.go 第298行代码,当未设置时,默认会强制使用 /admin/ 路由,若项目配置时,有修改,则图片显示不了

func (h *Handler) pluginBox(ctx *context.Context, param PluginBoxParam) template.HTML {
cover := template2.HTML(param.Info.MiniCover)
if cover == template2.HTML("") {
cover = "/admin/assets/dist/img/plugin_default.png"
}

jump := param.IndexURL
label := template.HTML("")
if !param.Install {
	jump = h.config.Url("/info/plugin_" + param.Name + "/new")
	label = html.SpanEl().SetClass("plugin-item-label").SetContent(language.GetFromHtml("uninstalled")).Get()
}
col1 := html.AEl().SetContent(html.DivEl().SetClass("plugin-item-img").
	SetContent(aImage(ctx).
		SetSrc(cover).
		GetContent()+
		html.PEl().SetContent(language.GetFromHtml(template.HTML(param.Info.Title), param.Name)).
			SetClass("plugin-item-title").Get()).
	Get()+label).SetAttr("href", jump).Get()
return col1

}

版本信息:

  • GoAdmin 版本:1.2.26
  • golang 版本:1.20.4
  • 浏览器环境:
  • 开发环境:

其他信息 [如截图等其他信息可以贴在这里]

Uploading 微信截图_20240717101305.png…

@a6652162 a6652162 added the 🐛bug Something isn't working label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant