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
co-authored by songzhibin97 icedays hedeqiang
parent 843e5a9ad4
commit 6add2094a6
42 changed files with 635 additions and 43 deletions
+23 -2
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()+"表数据初始化失败!")