Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
661fba3e
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
333
Star
18155
Fork
5506
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
661fba3e
编写于
9月 07, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自动初始化单独建包 为 命令行做基础
上级
800ef882
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
6 deletion
+6
-6
server/go.mod
server/go.mod
+0
-3
server/gva/init_data/init_data.go
server/gva/init_data/init_data.go
+4
-1
server/initialize/data.go
server/initialize/data.go
+0
-0
server/main.go
server/main.go
+2
-2
server/service/sys_db_initialize.go
server/service/sys_db_initialize.go
+0
-0
未找到文件。
server/go.mod
浏览文件 @
661fba3e
...
...
@@ -22,8 +22,6 @@ require (
github.com/json-iterator/go v1.1.10 // indirect
github.com/lestrrat-go/file-rotatelogs v2.3.0+incompatible
github.com/lestrrat-go/strftime v1.0.3 // indirect
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mitchellh/mapstructure v1.2.2 // indirect
github.com/mojocn/base64Captcha v1.3.1
...
...
@@ -42,7 +40,6 @@ require (
github.com/swaggo/swag v1.6.7
github.com/tebeka/strftime v0.1.3 // indirect
github.com/unrolled/secure v1.0.7
github.com/urfave/cli v1.22.2 // indirect
go.uber.org/zap v1.10.0
golang.org/x/net v0.0.0-20200320220750-118fecf932d8 // indirect
golang.org/x/sys v0.0.0-20200610111108-226ff32320da // indirect
...
...
server/gva/init_data/init_data.go
浏览文件 @
661fba3e
...
...
@@ -5,6 +5,7 @@ import (
"gin-vue-admin/model"
gormadapter
"github.com/casbin/gorm-adapter/v3"
"github.com/satori/go.uuid"
"go.uber.org/zap"
"gorm.io/gorm"
"time"
)
...
...
@@ -309,6 +310,7 @@ func InitSysBaseMenus() (err error) {
{
Model
:
gorm
.
Model
{
ID
:
23
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
Hidden
:
true
,
ParentId
:
"3"
,
Path
:
"dictionaryDetail/:id"
,
Name
:
"dictionaryDetail"
,
Component
:
"view/superAdmin/dictionary/sysDictionaryDetail.vue"
,
Sort
:
1
,
Meta
:
model
.
Meta
{
Title
:
"字典详情"
,
Icon
:
"s-order"
}},
{
Model
:
gorm
.
Model
{
ID
:
24
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
Hidden
:
false
,
ParentId
:
"3"
,
Path
:
"operation"
,
Name
:
"operation"
,
Component
:
"view/superAdmin/operation/sysOperationRecord.vue"
,
Sort
:
6
,
Meta
:
model
.
Meta
{
Title
:
"操作历史"
,
Icon
:
"time"
}},
{
Model
:
gorm
.
Model
{
ID
:
25
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
Hidden
:
false
,
ParentId
:
"9"
,
Path
:
"simpleUploader"
,
Name
:
"simpleUploader"
,
Component
:
"view/example/simpleUploader/simpleUploader"
,
Sort
:
6
,
Meta
:
model
.
Meta
{
Title
:
"断点续传(插件版)"
,
Icon
:
"upload"
}},
{
Model
:
gorm
.
Model
{
ID
:
26
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
ParentId
:
"0"
,
Path
:
"https://www.gin-vue-admin.com"
,
Name
:
"https://www.gin-vue-admin.com"
,
Hidden
:
false
,
Component
:
"/"
,
Sort
:
0
,
Meta
:
model
.
Meta
{
Title
:
"官方网站"
,
Icon
:
"s-home"
}},
}
if
tx
.
Create
(
&
insert
)
.
Error
!=
nil
{
// 遇到错误时回滚事务
tx
.
Rollback
()
...
...
@@ -366,6 +368,7 @@ func InitSysAuthorityMenus() (err error) {
{
"888"
,
23
},
{
"888"
,
24
},
{
"888"
,
25
},
{
"888"
,
26
},
{
"8881"
,
1
},
{
"8881"
,
2
},
{
"8881"
,
8
},
...
...
@@ -476,7 +479,7 @@ func InitData() {
err
=
InitSysDictionaryDetail
()
err
=
InitExaFileUploadAndDownload
()
if
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"initialize data failed"
,
err
)
global
.
GVA_LOG
.
Error
(
"initialize data failed"
,
zap
.
Any
(
"err"
,
err
)
)
}
global
.
GVA_LOG
.
Debug
(
"initialize data success"
)
}
server/initialize/data.go
已删除
100644 → 0
浏览文件 @
800ef882
server/main.go
浏览文件 @
661fba3e
...
...
@@ -3,7 +3,7 @@ package main
import
(
"gin-vue-admin/core"
"gin-vue-admin/global"
"gin-vue-admin/gva/init_data"
//
"gin-vue-admin/gva/init_data"
"gin-vue-admin/initialize"
//"runtime"
)
...
...
@@ -25,7 +25,7 @@ func main() {
initialize
.
Mysql
()
}
initialize
.
DBTables
()
init_data
.
InitData
()
// 打开注释即可初始化数据
//init_data.InitData() // 打开注释即可初始化数据 使用过后一定要再次注释或删除
// 程序结束前关闭数据库链接
db
,
_
:=
global
.
GVA_DB
.
DB
()
defer
db
.
Close
()
...
...
server/service/sys_db_initialize.go
已删除
100644 → 0
浏览文件 @
800ef882
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录