Skip to content

Commit 501c462

Browse files
committed
权限修复
1 parent 18e5170 commit 501c462

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pm3/apidoc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ func (a *apiDoc) Handler() gin.HandlerFunc {
129129
if field != "" {
130130
auto.I18nConvert(rv, I18nGet(utils.I18n(context)))
131131
value := rv.Interface()
132+
132133
auto.CompleteLabels(context, value)
133134
resp.Data[field] = value
134135
}

server/build.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,14 @@ func (i *imlServiceBuilder) Build() Server {
7575
}
7676
if ai, ok := p.(pm3.IPluginApis); ok {
7777
for _, a := range ai.APis() {
78+
for _, access := range a.Permits() {
79+
permit.AddPermitRule(access, permit.FormatPath(a.Method(), a.Path()))
80+
}
7881
middlewareHandlers := middlewareList.Check(a.Method(), a.Path())
7982

8083
handlers[p.Name()] = append(handlers[p.Name()], a)
8184
engine.Group("/", middlewareHandlers...).Handle(a.Method(), a.Path(), a.Handler)
82-
for _, access := range a.Permits() {
83-
permit.AddPermitRule(access, permit.FormatPath(a.Method(), a.Path()))
84-
}
85+
8586
}
8687
}
8788
}

0 commit comments

Comments
 (0)