feat:完善入驻信息管理
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/config"
|
||||
"SciencesServer/serve/orm"
|
||||
"SciencesServer/utils"
|
||||
)
|
||||
|
||||
type synchronized struct {
|
||||
@ -25,8 +26,10 @@ func initModel() {
|
||||
function := func(synchronized ...*synchronized) {
|
||||
for _, v := range synchronized {
|
||||
if !db.Migrator().HasTable(v.iModel) {
|
||||
_ = db.Migrator().CreateTable(v.iModel)
|
||||
|
||||
err := db.Migrator().CreateTable(v.iModel)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if v.iValues != nil && v.iValues() != nil {
|
||||
db.Table(v.iModel.TableName()).Create(v.iValues())
|
||||
}
|
||||
@ -40,10 +43,10 @@ func initModel() {
|
||||
&synchronized{iModel: model.NewSysConfig()},
|
||||
&synchronized{iModel: model.NewSysMenu()}, &synchronized{iModel: model.NewSysAuth()},
|
||||
&synchronized{iModel: model.NewSysUser(), iValues: func() interface{} {
|
||||
return &model.SysUser{Account: "admin", Name: "商挈智能", Mobile: "13888888888", Password: "123456",
|
||||
return &model.SysUser{Account: "admin", Name: "商挈智能", Mobile: "13888888888", Password: utils.Md5String("123456"),
|
||||
IsAdmin: model.SysUserAdministratorForAdmin, Remark: "超级管理员"}
|
||||
}},
|
||||
&synchronized{iModel: model.NewSysUserTenant()},
|
||||
&synchronized{iModel: model.NewSysUserRole()}, &synchronized{iModel: model.NewSysUserTenant()},
|
||||
&synchronized{iModel: model.NewSysDepartment()},
|
||||
&synchronized{iModel: model.NewSysRole()}, &synchronized{iModel: model.NewSysRoleMenu()}, &synchronized{iModel: model.NewSysRoleAuth()},
|
||||
// 配置管理
|
||||
@ -72,7 +75,6 @@ func initModel() {
|
||||
return out
|
||||
}},
|
||||
// 日志管理
|
||||
&synchronized{iModel: model.NewSysUserRole()},
|
||||
&synchronized{iModel: model.NewSysLog()}, &synchronized{iModel: model.NewSysUserLoginLog()},
|
||||
// 用户管理
|
||||
&synchronized{iModel: model.NewUserInstance()}, &synchronized{iModel: model.NewUserIdentity()},
|
||||
|
Reference in New Issue
Block a user