Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_54624550
gin-vue-admin
提交
8b00e8d6
G
gin-vue-admin
项目概览
weixin_54624550
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b00e8d6
编写于
8月 29, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
取消插件模式 不再对插件提供支持
上级
3066b2ae
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
0 addition
and
55 deletion
+0
-55
server/core/install_plugs.go
server/core/install_plugs.go
+0
-26
server/core/server.go
server/core/server.go
+0
-3
server/go.mod
server/go.mod
+0
-2
server/initialize/plug.go
server/initialize/plug.go
+0
-23
web/src/view/layout/aside/index.vue
web/src/view/layout/aside/index.vue
+0
-1
未找到文件。
server/core/install_plugs.go
已删除
100644 → 0
浏览文件 @
3066b2ae
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**/
}
server/core/server.go
浏览文件 @
8b00e8d6
...
...
@@ -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
)
// 保证文本顺序输出
...
...
server/go.mod
浏览文件 @
8b00e8d6
...
...
@@ -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
...
...
server/initialize/plug.go
已删除
100644 → 0
浏览文件 @
3066b2ae
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
}
web/src/view/layout/aside/index.vue
浏览文件 @
8b00e8d6
...
...
@@ -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
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录