diff --git a/server/core/install_plugs.go b/server/core/install_plugs.go deleted file mode 100644 index 02c28360..00000000 --- a/server/core/install_plugs.go +++ /dev/null @@ -1,26 +0,0 @@ -package core - -import ( - "fmt" - "gin-vue-admin/global" - "gin-vue-admin/initialize" - "gin-vue-admin/middleware" - "github.com/gin-gonic/gin" - "github.com/piexlmax/gvaplug" -) - -func InstallPlugs(route *gin.Engine) { - GvaPlugsGroupBase := route.Group("") // 纯净路由 插件可通用 传递给插件的0号位置 为了不让插件的自动路由出问题 这里建议为 "" - /**安装一个插件需要的步骤 start**/ - GvaPlugsGroupMiddle := route.Group("") // 携带中间件的路由 传递给插件的1号位置 为了不让插件的自动路由出问题 这里建议为 "" - GvaPlugsGroupMiddle.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()) - // 插件安装 暂时只是后台功能 添加model 添加路由 添加对数据库的操作 详细插件测试模板可看https://github.com/piexlmax/gvaplug 此处不建议投入生产 - err := initialize.InstallPlug(global.GVA_DB, [2]*gin.RouterGroup{ - GvaPlugsGroupBase, - GvaPlugsGroupMiddle, - }, gvaplug.GvaPlug{SomeConfig: "插件给用户提供的配置区域"}) - if err != nil { - panic(fmt.Sprintf("插件安装失败: %v", err)) - } - /**安装一个插件需要的步骤 end**/ -} diff --git a/server/core/server.go b/server/core/server.go index f855aede..e7e1cf7e 100644 --- a/server/core/server.go +++ b/server/core/server.go @@ -19,9 +19,6 @@ func RunWindowsServer() { Router := initialize.Routers() Router.Static("/form-generator", "./resource/page") - //InstallPlugs(Router) - // end 插件描述 - address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr) s := initServer(address, Router) // 保证文本顺序输出 diff --git a/server/go.mod b/server/go.mod index 56770f93..183396ba 100644 --- a/server/go.mod +++ b/server/go.mod @@ -31,10 +31,8 @@ require ( github.com/onsi/gomega v1.4.3 // indirect github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/pelletier/go-toml v1.6.0 // indirect - github.com/piexlmax/gvaplug v0.0.8 github.com/pkg/errors v0.9.1 // indirect github.com/qiniu/api.v7/v7 v7.4.1 - github.com/qiniu/x v1.10.5 github.com/satori/go.uuid v1.2.0 github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect diff --git a/server/initialize/plug.go b/server/initialize/plug.go deleted file mode 100644 index b2bad07a..00000000 --- a/server/initialize/plug.go +++ /dev/null @@ -1,23 +0,0 @@ -package initialize - -import ( - "github.com/gin-gonic/gin" - "github.com/jinzhu/gorm" -) - -type Plug interface { - InitRouter([2]*gin.RouterGroup) error - InitModel(*gorm.DB) error -} - -func InstallPlug(db *gorm.DB, router [2]*gin.RouterGroup, p Plug) (err error) { - err = p.InitModel(db) - if err != nil { - return err - } - err = p.InitRouter(router) - if err != nil { - return err - } - return nil -} diff --git a/web/src/view/layout/aside/index.vue b/web/src/view/layout/aside/index.vue index 19b80fb7..f427050b 100644 --- a/web/src/view/layout/aside/index.vue +++ b/web/src/view/layout/aside/index.vue @@ -45,7 +45,6 @@ export default { params[item.key] = item.value; } }); - console.log(query, params); if (index === this.$route.name) return; this.$router.push({ name: index, query, params }); }