Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
1. 登陆页面适配移动端
2. 调整sysconfig功能
3. 修复已知BUG
  • Loading branch information
wenjianzhang authored Oct 17, 2020
2 parents c350c8e + 8ef816c commit 61bf06c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 15 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package models
package system

import (
"gorm.io/gorm"
Expand Down
8 changes: 4 additions & 4 deletions app/admin/router/sys_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package router

import (
"github.com/gin-gonic/gin"
"go-admin/app/admin/apis/sys_config"
"go-admin/app/admin/apis/system/sys_config"
"go-admin/app/admin/middleware"
"go-admin/app/admin/models"
"go-admin/app/admin/models/system"
"go-admin/app/admin/service/dto"
"go-admin/common/actions"
jwt "go-admin/pkg/jwtauth"
Expand All @@ -18,9 +18,9 @@ func init() {
func registerSysConfigRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
r := v1.Group("/config").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
{
model := &models.SysConfig{}
model := &system.SysConfig{}
r.GET("", actions.PermissionAction(), actions.IndexAction(model, new(dto.SysConfigSearch), func() interface{} {
list := make([]models.SysConfig, 0)
list := make([]system.SysConfig, 0)
return &list
}))
r.GET("/:id", actions.PermissionAction(), actions.ViewAction(new(dto.SysConfigById), nil))
Expand Down
6 changes: 3 additions & 3 deletions app/admin/service/dto/sys_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package dto

import (
"github.com/gin-gonic/gin"
"go-admin/app/admin/models/system"
"gorm.io/gorm"

"go-admin/app/admin/models"
"go-admin/common/dto"
"go-admin/common/log"
common "go-admin/common/models"
Expand Down Expand Up @@ -65,7 +65,7 @@ func (s *SysConfigControl) Generate() dto.Control {
}

func (s *SysConfigControl) GenerateM() (common.ActiveRecord, error) {
return &models.SysConfig{
return &system.SysConfig{
Model: gorm.Model{ID: s.ID},
ConfigName: s.ConfigName,
ConfigKey: s.ConfigKey,
Expand All @@ -89,5 +89,5 @@ func (s *SysConfigById) Generate() dto.Control {
}

func (s *SysConfigById) GenerateM() (common.ActiveRecord, error) {
return &models.SysConfig{}, nil
return &system.SysConfig{}, nil
}
4 changes: 2 additions & 2 deletions app/admin/service/sys_config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package service

import (
"go-admin/app/admin/models"
"go-admin/app/admin/models/system"
"go-admin/app/admin/service/dto"
"go-admin/common/log"
"go-admin/common/service"
Expand All @@ -14,7 +14,7 @@ type SysConfig struct {
// GetSysConfigByKEY 根据Key获取SysConfig
func (e *SysConfig) GetSysConfigByKEY(c *dto.SysConfigControl) error {
var err error
var data models.SysConfig
var data system.SysConfig
msgID := e.MsgID
data.ConfigKey = c.ConfigKey
err = e.Orm.Table(data.TableName()).Where("config_key = ?", data.ConfigKey).First(c).Error
Expand Down
5 changes: 3 additions & 2 deletions cmd/migrate/migration/version/1599190683659_tables.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package version

import (
"go-admin/app/admin/models/system"
"runtime"

"gorm.io/gorm"
Expand All @@ -20,7 +21,7 @@ func _1599190683659Tables(db *gorm.DB, version string) error {
err := db.Debug().Migrator().AutoMigrate(
new(models.CasbinRule),
new(models.SysDept),
new(models.SysConfig),
new(system.SysConfig),
new(tools.SysTables),
new(tools.SysColumns),
new(models.Menu),
Expand All @@ -34,7 +35,7 @@ func _1599190683659Tables(db *gorm.DB, version string) error {
new(models.DictData),
new(models.DictType),
new(models.SysJob),
new(models.SysConfig),
new(system.SysConfig),
new(models.SysSetting),
new(models.SysFileDir),
new(models.SysFileInfo),
Expand Down
3 changes: 2 additions & 1 deletion cmd/migrate/migration/version/1599190683670_migrate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package version

import (
"go-admin/app/admin/models/system"
"runtime"
"time"

Expand Down Expand Up @@ -260,7 +261,7 @@ func _1599190683670Test(db *gorm.DB, version string) error {
{DeptId: 10, ParentId: 1, DeptPath: "/0/1/10", DeptName: "人力资源", Sort: 3, Leader: "aituo", Phone: "13782218188", Email: "[email protected]", Status: "1", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
}

list4 := []models.SysConfig{
list4 := []system.SysConfig{
{Model: gorm.Model{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now(), DeletedAt: gorm.DeletedAt{}}, ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "主框架页-默认皮肤样式名称", ConfigKey: "sys_index_skinName", ConfigValue: "skin-blue", ConfigType: "Y", Remark: "蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow"},
{Model: gorm.Model{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now(), DeletedAt: gorm.DeletedAt{}}, ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "用户管理-账号初始密码", ConfigKey: "sys.user.initPassword", ConfigValue: "123456", ConfigType: "Y", Remark: "初始化密码 123456"},
{Model: gorm.Model{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now(), DeletedAt: gorm.DeletedAt{}}, ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "主框架页-侧边栏主题", ConfigKey: "sys_index_sideTheme", ConfigValue: "theme-dark", ConfigType: "Y", Remark: "深色主题theme-dark,浅色主题theme-light"},
Expand Down
3 changes: 2 additions & 1 deletion cmd/migrate/migration/version/1602644950000_migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package version

import (
"go-admin/app/admin/models"
"go-admin/app/admin/models/system"
"gorm.io/gorm"
"runtime"

Expand All @@ -16,7 +17,7 @@ func init() {

func _1602644950000Test(db *gorm.DB, version string) error {
return db.Transaction(func(tx *gorm.DB) error {
err := db.Migrator().RenameColumn(&models.SysConfig{}, "config_id", "id")
err := db.Migrator().RenameColumn(&system.SysConfig{}, "config_id", "id")
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion common/global/adm.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
// go-admin Version Info
Version = "1.2.0"
Version = "1.2.1"
)

var Cfg config.Conf = config.DefaultConfig()
Expand Down

0 comments on commit 61bf06c

Please sign in to comment.