fix userinfo

This commit is contained in:
aichy126 2022-11-30 18:15:21 +08:00
parent d8902a44d1
commit 287266d221
1 changed files with 9 additions and 0 deletions

View File

@ -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),