Skip to content

Commit b1b7427

Browse files
committed
fixed:修复GHSA-gv3w-m57p-3wc4
1 parent 7bc7c30 commit b1b7427

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/api/v1/system/sys_auto_code.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net/url"
77
"os"
8+
"path/filepath"
89
"strings"
910

1011
"github.com/flipped-aurora/gin-vue-admin/server/global"
@@ -253,6 +254,11 @@ func (autoApi *AutoCodeApi) AutoPlug(c *gin.Context) {
253254
response.FailWithMessage(err.Error(), c)
254255
return
255256
}
257+
if strings.Contains(a.PlugName, string(filepath.Separator)) {
258+
response.FailWithMessage("插件名称不能包含"+string(filepath.Separator), c)
259+
return
260+
}
261+
256262
a.Snake = strings.ToLower(a.PlugName)
257263
a.NeedModel = a.HasRequest || a.HasResponse
258264
err = autoCodeService.CreatePlug(a)

0 commit comments

Comments
 (0)