From c971b893bf0c2bb9c17174211dfe1c8cbb8adea0 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 2 Dec 2021 11:15:04 +0800 Subject: [PATCH] mod default --- routers/user/profile.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/routers/user/profile.go b/routers/user/profile.go index 0e29b6117..fe5dc4598 100755 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -6,6 +6,7 @@ package user import ( + "errors" "fmt" "path" "strings" @@ -107,6 +108,9 @@ func Profile(ctx *context.Context) { ctx.Data["HasOrgsVisible"] = models.HasOrgsVisible(orgs, ctx.User) tab := ctx.Query("tab") + if tab == "" { + tab = "activity" + } ctx.Data["TabName"] = tab page := ctx.QueryInt("page") @@ -230,7 +234,7 @@ func Profile(ctx *context.Context) { } total = int(count) ctx.Data["Datasets"] = datasets - default: + case "repository": repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ ListOptions: models.ListOptions{ PageSize: setting.UI.User.RepoPagingNum, @@ -251,6 +255,9 @@ func Profile(ctx *context.Context) { } total = int(count) + default: + ctx.ServerError("tab error", errors.New("tab error")) + return } ctx.Data["Repos"] = repos ctx.Data["Total"] = total