Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix userinfo

aichy126287266d221fe
diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go
index 292e4a95..295b1f03 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -165,6 +165,15 @@ func (tc *TemplateController) UserInfo(ctx *gin.Context) {
req := &schema.GetOtherUserInfoByUsernameReq{}
req.Username = username
userinfo, err := tc.templateRenderController.UserInfo(ctx, req)
+ if !userinfo.Has {
+ ctx.HTML(http.StatusNotFound, "404.html", gin.H{
+ "siteinfo": tc.SiteInfo(ctx),
+ "scriptPath": tc.scriptPath,
+ "cssPath": tc.cssPath,
+ "err": "",
+ })
+ return
+ }
if err != nil {
ctx.HTML(http.StatusNotFound, "404.html", gin.H{
"siteinfo": tc.SiteInfo(ctx),