diff --git a/internal/app/system/controller/sys_user.go b/internal/app/system/controller/sys_user.go index 5256ecc..0f6088b 100644 --- a/internal/app/system/controller/sys_user.go +++ b/internal/app/system/controller/sys_user.go @@ -5,8 +5,8 @@ import ( "github.com/gogf/gf/v2/crypto/gmd5" "github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/frame/g" - "github.com/gogf/gf/v2/os/genv" "github.com/gogf/gf/v2/util/gconv" + "github.com/gogf/gf/v2/util/gmode" "github.com/tiger1103/gfast/v3/api/v1/system" commonService "github.com/tiger1103/gfast/v3/internal/app/common/service" "github.com/tiger1103/gfast/v3/internal/app/system/model" @@ -30,8 +30,8 @@ func (c *userController) Login(ctx context.Context, req *system.UserLoginReq) (r menuList []*model.UserMenus ) //判断验证码是否正确 - debug := genv.GetWithCmd("gf.debug") - if debug.Int() != 1 { + debug := gmode.IsDevelop() + if !debug { if !commonService.Captcha().VerifyString(req.VerifyKey, req.VerifyCode) { err = gerror.New("验证码输入错误") return diff --git a/internal/app/system/model/entity/sys_role.go b/internal/app/system/model/entity/sys_role.go index 17d2a9e..240310a 100644 --- a/internal/app/system/model/entity/sys_role.go +++ b/internal/app/system/model/entity/sys_role.go @@ -1,15 +1,21 @@ // ================================================================================= -// Code generated by GoFrame CLI tool. DO NOT EDIT. Created at 2022-03-09 10:18:38 +// Code generated by GoFrame CLI tool. DO NOT EDIT. // ================================================================================= package entity +import ( + "github.com/gogf/gf/v2/os/gtime" +) + // SysRole is the golang structure for table sys_role. type SysRole struct { - Id uint `json:"id" description:""` - Status uint `json:"status" description:"状态;0:禁用;1:正常"` - ListOrder float64 `json:"listOrder" description:"排序"` - Name string `json:"name" description:"角色名称"` - Remark string `json:"remark" description:"备注"` - DataScope uint `json:"dataScope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)"` + Id uint `json:"id" description:""` + Status uint `json:"status" description:"状态;0:禁用;1:正常"` + ListOrder float64 `json:"listOrder" description:"排序"` + Name string `json:"name" description:"角色名称"` + Remark string `json:"remark" description:"备注"` + DataScope uint `json:"dataScope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)"` + CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"` + UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"` } diff --git a/internal/app/system/service/internal/dao/internal/sys_role.go b/internal/app/system/service/internal/dao/internal/sys_role.go index d1622e6..8d18163 100644 --- a/internal/app/system/service/internal/dao/internal/sys_role.go +++ b/internal/app/system/service/internal/dao/internal/sys_role.go @@ -1,5 +1,5 @@ // ========================================================================== -// Code generated by GoFrame CLI tool. DO NOT EDIT. Created at 2022-03-09 10:18:38 +// Code generated by GoFrame CLI tool. DO NOT EDIT. // ========================================================================== package internal @@ -25,6 +25,8 @@ type SysRoleColumns struct { Name string // 角色名称 Remark string // 备注 DataScope string // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 } // sysRoleColumns holds the columns for table sys_role. @@ -35,6 +37,8 @@ var sysRoleColumns = SysRoleColumns{ Name: "name", Remark: "remark", DataScope: "data_scope", + CreatedAt: "created_at", + UpdatedAt: "updated_at", } // NewSysRoleDao creates and returns a new DAO object for table data access. diff --git a/internal/app/system/service/internal/do/sys_role.go b/internal/app/system/service/internal/do/sys_role.go index a2a5f56..47e9599 100644 --- a/internal/app/system/service/internal/do/sys_role.go +++ b/internal/app/system/service/internal/do/sys_role.go @@ -1,11 +1,12 @@ // ================================================================================= -// Code generated by GoFrame CLI tool. DO NOT EDIT. Created at 2022-03-09 10:18:38 +// Code generated by GoFrame CLI tool. DO NOT EDIT. // ================================================================================= package do import ( "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" ) // SysRole is the golang structure of table sys_role for DAO operations like Where/Data. @@ -17,4 +18,6 @@ type SysRole struct { Name interface{} // 角色名称 Remark interface{} // 备注 DataScope interface{} // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 } diff --git a/manifest/config/config.yaml b/manifest/config/config.yaml index 4519b11..062cb9a 100644 --- a/manifest/config/config.yaml +++ b/manifest/config/config.yaml @@ -76,7 +76,7 @@ gfcli: gen: dao: - link: "mysql:root:123456@tcp(127.0.0.1:3306)/gfast-v3" - tables: "sys_auth_rule" + tables: "sys_role" removePrefix: "gf_" descriptionTag: true noModelComment: true