From 016ae8a01462005a3341c80f7fb857a8d2d2609b Mon Sep 17 00:00:00 2001 From: Yavolte Date: Wed, 23 Jul 2025 17:11:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=9A=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- formatter.go | 9 +++++---- pb/organize_http.pb.go | 2 +- pb/organize_model.pb.go | 2 +- pb/system_http.pb.go | 2 +- pb/system_model.pb.go | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/formatter.go b/formatter.go index d30af9f..818caf0 100644 --- a/formatter.go +++ b/formatter.go @@ -5,6 +5,7 @@ import ( "fmt" "git.nobla.cn/golang/aeus-admin/internal/logic" + "git.nobla.cn/golang/aeus-admin/utils" "git.nobla.cn/golang/aeus/pkg/cache" "git.nobla.cn/golang/rest" "git.nobla.cn/golang/rest/types" @@ -20,7 +21,7 @@ type Formatter struct { } func (f *Formatter) FormatUser(ctx context.Context, value, model any, scm *types.Schema) any { - if values, err := f.user.GetLabels(ctx); err == nil { + if values, err := f.user.GetLabels(ctx, utils.GetDomainFromContext(ctx)); err == nil { for _, row := range values { if row.Value == value { return fmt.Sprintf("%s(%s)", row.Label, row.Value) @@ -31,7 +32,7 @@ func (f *Formatter) FormatUser(ctx context.Context, value, model any, scm *types } func (f *Formatter) FormatDepartment(ctx context.Context, value, model any, scm *types.Schema) any { - if values, err := f.department.GetLabels(ctx); err == nil { + if values, err := f.department.GetLabels(ctx, utils.GetDomainFromContext(ctx)); err == nil { for _, row := range values { if row.Value == value { return row.Label @@ -42,7 +43,7 @@ func (f *Formatter) FormatDepartment(ctx context.Context, value, model any, scm } func (f *Formatter) FormatRole(ctx context.Context, value, model any, scm *types.Schema) any { - if values, err := f.role.GetLabels(ctx); err == nil { + if values, err := f.role.GetLabels(ctx, utils.GetDomainFromContext(ctx)); err == nil { for _, row := range values { if row.Value == value { return row.Label @@ -53,7 +54,7 @@ func (f *Formatter) FormatRole(ctx context.Context, value, model any, scm *types } func (f *Formatter) FormatMenu(ctx context.Context, value, model any, scm *types.Schema) any { - if values, err := f.menu.GetLabels(ctx); err == nil { + if values, err := f.menu.GetLabels(ctx, utils.GetDomainFromContext(ctx)); err == nil { for _, row := range values { if row.Value == value { return row.Label diff --git a/pb/organize_http.pb.go b/pb/organize_http.pb.go index a4803cb..adead60 100644 --- a/pb/organize_http.pb.go +++ b/pb/organize_http.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-aeus. DO NOT EDIT. // source: organize.proto -// date: 2025-07-23 17:06:59 +// date: 2025-07-23 17:11:27 package pb diff --git a/pb/organize_model.pb.go b/pb/organize_model.pb.go index 47e91d1..400c661 100644 --- a/pb/organize_model.pb.go +++ b/pb/organize_model.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-aeus. DO NOT EDIT. // source: organize.proto -// date: 2025-07-23 17:06:59 +// date: 2025-07-23 17:11:27 package pb diff --git a/pb/system_http.pb.go b/pb/system_http.pb.go index cfd1c56..d0a9dab 100644 --- a/pb/system_http.pb.go +++ b/pb/system_http.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-aeus. DO NOT EDIT. // source: system.proto -// date: 2025-07-23 17:06:59 +// date: 2025-07-23 17:11:27 package pb diff --git a/pb/system_model.pb.go b/pb/system_model.pb.go index 8e3a16c..b2b74c8 100644 --- a/pb/system_model.pb.go +++ b/pb/system_model.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-aeus. DO NOT EDIT. // source: system.proto -// date: 2025-07-23 17:06:59 +// date: 2025-07-23 17:11:27 package pb