Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1e38bc

Browse files
committed
停号后,个人首页不让查看
1 parent c914eee commit d1e38bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

http/controller/user.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"github.com/studygolang/studygolang/context"
1414
"github.com/studygolang/studygolang/logic"
15+
"github.com/studygolang/studygolang/model"
1516

1617
echo "github.com/labstack/echo/v4"
1718
"github.com/polaris1119/goutils"
@@ -36,7 +37,7 @@ func (self UserController) RegisterRoute(g *echo.Group) {
3637
func (UserController) Home(ctx echo.Context) error {
3738
username := ctx.Param("username")
3839
user := logic.DefaultUser.FindOne(context.EchoContext(ctx), "username", username)
39-
if user == nil || user.Uid == 0 {
40+
if user == nil || user.Uid == 0 || user.Status == model.UserStatusOutage {
4041
return ctx.Redirect(http.StatusSeeOther, "/users")
4142
}
4243

0 commit comments

Comments
 (0)