Skip to content

Commit f58d614

Browse files
author
woytu
committed
判断执行脚本是否存在
1 parent cc29beb commit f58d614

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

key-gin.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,12 @@ func getKey(c *gin.Context) {
106106
c.JSON(http.StatusOK, common.Error(300, "请选择版本"))
107107
return
108108
}
109-
110-
path := utils.ParentDirectory(utils.OsPath()) + "/pyutils"
109+
path, err := utils.ContextPath("key-gin")
110+
if err != nil {
111+
c.JSON(http.StatusOK, common.Error(500, "获取key系统错误"))
112+
return
113+
}
114+
path = utils.PathStitching(path, "pyutils")
111115
if company == "netsarang" {
112116
result, err := utils.ExecutePython(path+"/xshell_key.py", app, version)
113117
if err != nil {

0 commit comments

Comments
 (0)