x
This commit is contained in:
@@ -110,15 +110,6 @@ func initWebPluginList() {
|
|||||||
plugin_subcribe_addresses = new
|
plugin_subcribe_addresses = new
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
GinApi(GET, "/api/plugins/download", func(c *gin.Context) {
|
|
||||||
uuid := c.Query("uuid")
|
|
||||||
for _, f := range Functions {
|
|
||||||
if f.UUID == uuid && f.Public {
|
|
||||||
c.String(200, publicScript(plugins.GetString(f.UUID)))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
GinApi(GET, "/api/plugins/list.json", func(ctx *gin.Context) {
|
GinApi(GET, "/api/plugins/list.json", func(ctx *gin.Context) {
|
||||||
current := utils.Int(ctx.Query("current"))
|
current := utils.Int(ctx.Query("current"))
|
||||||
pageSize := utils.Int(ctx.Query("pageSize"))
|
pageSize := utils.Int(ctx.Query("pageSize"))
|
||||||
|
|||||||
+18
@@ -66,6 +66,24 @@ func init() {
|
|||||||
Server.Use(gzip.Gzip(gzip.DefaultCompression))
|
Server.Use(gzip.Gzip(gzip.DefaultCompression))
|
||||||
Server.GET("/api/file/:filename", FindFile)
|
Server.GET("/api/file/:filename", FindFile)
|
||||||
Server.GET("/api/decode/:random", Base642Binary)
|
Server.GET("/api/decode/:random", Base642Binary)
|
||||||
|
Server.GET("/api/plugins/download", func(c *gin.Context) {
|
||||||
|
uuid := c.Query("uuid")
|
||||||
|
for _, f := range Functions {
|
||||||
|
if f.UUID == uuid && f.Public {
|
||||||
|
c.String(200, publicScript(plugins.GetString(f.UUID)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Server.GET("/api/plugins/download/:uuid", func(c *gin.Context) {
|
||||||
|
uuid := c.Param("uuid")
|
||||||
|
for _, f := range Functions {
|
||||||
|
if f.UUID == uuid && f.Public {
|
||||||
|
c.String(200, publicScript(plugins.GetString(f.UUID)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Server.NoRoute(func(c *gin.Context) {
|
Server.NoRoute(func(c *gin.Context) {
|
||||||
if c.Request.URL.Path != "/api/web_chat" {
|
if c.Request.URL.Path != "/api/web_chat" {
|
||||||
logs.Debug(c.Request.URL.Path)
|
logs.Debug(c.Request.URL.Path)
|
||||||
|
|||||||
Reference in New Issue
Block a user