v2.5.1 beta2 (#1048)

* 修复日志中间件报文过大的报错问题

* 修复 Token 失效后导致的白屏问题

* 增加自动创建插件模板功能

* 密码加密方式改为 hash

* 增加刷新防抖

Co-authored-by: songzhibin97 <718428482@qq.com>
Co-authored-by: icedays <icedays@163.com>
Co-authored-by: hedeqiang <laravel_code@163.com>
This commit is contained in:
奇淼(piexlmax
2022-04-25 17:34:17 +08:00
committed by GitHub
parent 843e5a9ad4
commit 6add2094a6
42 changed files with 635 additions and 43 deletions

View File

@@ -111,6 +111,7 @@ func (i *initApi) InitializeData(ctx context.Context) (context.Context, error) {
{ApiGroup: "代码生成器", Method: "POST", Path: "/autoCode/createTemp", Description: "自动化代码"},
{ApiGroup: "代码生成器", Method: "POST", Path: "/autoCode/preview", Description: "预览自动化代码"},
{ApiGroup: "代码生成器", Method: "GET", Path: "/autoCode/getColumn", Description: "获取所选table的所有字段"},
{ApiGroup: "代码生成器", Method: "POST", Path: "/autoCode/createPlug", Description: "自从创建插件包"},
{ApiGroup: "包pkg生成器", Method: "POST", Path: "/autoCode/createPackage", Description: "生成包(package)"},
{ApiGroup: "包pkg生成器", Method: "POST", Path: "/autoCode/getPackage", Description: "获取所有包(package)"},

View File

@@ -119,6 +119,7 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error
{PType: "p", V0: "888", V1: "/autoCode/createPackage", V2: "POST"},
{PType: "p", V0: "888", V1: "/autoCode/getPackage", V2: "POST"},
{PType: "p", V0: "888", V1: "/autoCode/delPackage", V2: "POST"},
{PType: "p", V0: "888", V1: "/autoCode/createPlug", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/findSysDictionaryDetail", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/updateSysDictionaryDetail", V2: "PUT"},

View File

@@ -78,6 +78,7 @@ func (i *initMenu) InitializeData(ctx context.Context) (next context.Context, er
{MenuLevel: 0, Hidden: false, ParentId: "14", Path: "autoCodeAdmin", Name: "autoCodeAdmin", Component: "view/systemTools/autoCodeAdmin/index.vue", Sort: 1, Meta: Meta{Title: "自动化代码管理", Icon: "magic-stick"}},
{MenuLevel: 0, Hidden: true, ParentId: "14", Path: "autoCodeEdit/:id", Name: "autoCodeEdit", Component: "view/systemTools/autoCode/index.vue", Sort: 0, Meta: Meta{Title: "自动化代码(复用)", Icon: "magic-stick"}},
{MenuLevel: 0, Hidden: false, ParentId: "14", Path: "autoPkg", Name: "autoPkg", Component: "view/systemTools/autoPkg/autoPkg.vue", Sort: 0, Meta: Meta{Title: "自动化package", Icon: "folder"}},
{MenuLevel: 0, Hidden: false, ParentId: "14", Path: "autoPlug", Name: "autoPlug", Component: "view/systemTools/autoPlug/autoPlug.vue", Sort: 4, Meta: Meta{Title: "自动化插件模板", Icon: "folder"}},
}
if err = db.Create(&entities).Error; err != nil {
return ctx, errors.Wrap(err, SysBaseMenu{}.TableName()+"表数据初始化失败!")

View File

@@ -5,6 +5,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
sysModel "github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/service/system"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"gorm.io/gorm"
@@ -44,9 +45,29 @@ func (i *initUser) InitializeData(ctx context.Context) (next context.Context, er
if !ok {
return ctx, system.ErrMissingDBContext
}
password := utils.BcryptHash("6447985")
adminPassword := utils.BcryptHash("123456")
entities := []sysModel.SysUser{
{UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "https://qmplusimg.henrongyi.top/gva_header.jpg", AuthorityId: "888", Phone: "17611111111", Email: "333333333@qq.com"},
{UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "https:///qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528", Phone: "17611111111", Email: "333333333@qq.com"},
{
UUID: uuid.NewV4(),
Username: "admin",
Password: adminPassword,
NickName: "超级管理员",
HeaderImg: "https://qmplusimg.henrongyi.top/gva_header.jpg",
AuthorityId: "888",
Phone: "17611111111",
Email: "333333333@qq.com",
},
{
UUID: uuid.NewV4(),
Username: "a303176530",
Password: password,
NickName: "QMPlusUser",
HeaderImg: "https:///qmplusimg.henrongyi.top/1572075907logo.png",
AuthorityId: "9528",
Phone: "17611111111",
Email: "333333333@qq.com"},
}
if err = global.GVA_DB.Create(&entities).Error; err != nil {
return ctx, errors.Wrap(err, sysModel.SysUser{}.TableName()+"表数据初始化失败!")