mirror of https://gitee.com/answerdev/answer.git
fix users
This commit is contained in:
parent
4bb014867e
commit
78c0606e52
|
@ -276,6 +276,14 @@ func (tc *TemplateController) TagInfo(ctx *gin.Context) {
|
||||||
|
|
||||||
// UserInfo user info
|
// UserInfo user info
|
||||||
func (tc *TemplateController) UserInfo(ctx *gin.Context) {
|
func (tc *TemplateController) UserInfo(ctx *gin.Context) {
|
||||||
|
// urlPath := ctx.Request.URL.Path
|
||||||
|
// filePath := ""
|
||||||
|
// switch urlPath {
|
||||||
|
// case "/users/login":
|
||||||
|
// filePath = "build/index.html"
|
||||||
|
// case "/users/register":
|
||||||
|
// filePath = "build/index.html"
|
||||||
|
// default:
|
||||||
username := ctx.Param("username")
|
username := ctx.Param("username")
|
||||||
req := &schema.GetOtherUserInfoByUsernameReq{}
|
req := &schema.GetOtherUserInfoByUsernameReq{}
|
||||||
req.Username = username
|
req.Username = username
|
||||||
|
@ -305,6 +313,17 @@ func (tc *TemplateController) UserInfo(ctx *gin.Context) {
|
||||||
"userinfo": userinfo,
|
"userinfo": userinfo,
|
||||||
"bio": template.HTML(userinfo.Info.BioHTML),
|
"bio": template.HTML(userinfo.Info.BioHTML),
|
||||||
})
|
})
|
||||||
|
// }
|
||||||
|
|
||||||
|
// file, err := ui.Build.ReadFile(filePath)
|
||||||
|
// if err != nil {
|
||||||
|
// log.Error(err)
|
||||||
|
// ctx.Status(http.StatusNotFound)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// ctx.Header("content-type", "text/html;charset=utf-8")
|
||||||
|
// ctx.String(http.StatusOK, string(file))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tc *TemplateController) Page404(ctx *gin.Context) {
|
func (tc *TemplateController) Page404(ctx *gin.Context) {
|
||||||
|
|
|
@ -41,6 +41,6 @@ func (a *TemplateRouter) RegisterTemplateRouter(r *gin.RouterGroup) {
|
||||||
|
|
||||||
r.GET("/tags", a.templateController.TagList)
|
r.GET("/tags", a.templateController.TagList)
|
||||||
r.GET("/tags/:tag", a.templateController.TagInfo)
|
r.GET("/tags/:tag", a.templateController.TagInfo)
|
||||||
r.GET("/users/:username", a.templateController.UserInfo)
|
// r.GET("/users/:username", a.templateController.UserInfo)
|
||||||
r.GET("/404", a.templateController.Page404)
|
r.GET("/404", a.templateController.Page404)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue