fix🔒: require JWT and role check on /job/start and /job/remove

The two routes were registered on the bare v1 group, so they ran without any authentication. Mount them on a group with the same JWT and AuthCheckRole middleware as /sysjob.
This commit is contained in:
zhangwenjian
2026-10-08 20:00:11 +08:00
parent 6499dbf1ef
commit 13a52c65df
+5 -2
View File
@@ -29,6 +29,9 @@ func registerSysJobRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlew
}
sysJob := apis.SysJob{}
v1.GET("/job/remove/:id", sysJob.RemoveJobForService)
v1.GET("/job/start/:id", sysJob.StartJobForService)
r2 := v1.Group("/job").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
{
r2.GET("/remove/:id", sysJob.RemoveJobForService)
r2.GET("/start/:id", sysJob.StartJobForService)
}
}