yxh пре 4 година
родитељ
комит
da77876e14

+ 3 - 3
internal/app/system/controller/sys_user.go

@@ -5,8 +5,8 @@ import (
 	"github.com/gogf/gf/v2/crypto/gmd5"
 	"github.com/gogf/gf/v2/crypto/gmd5"
 	"github.com/gogf/gf/v2/errors/gerror"
 	"github.com/gogf/gf/v2/errors/gerror"
 	"github.com/gogf/gf/v2/frame/g"
 	"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/gconv"
+	"github.com/gogf/gf/v2/util/gmode"
 	"github.com/tiger1103/gfast/v3/api/v1/system"
 	"github.com/tiger1103/gfast/v3/api/v1/system"
 	commonService "github.com/tiger1103/gfast/v3/internal/app/common/service"
 	commonService "github.com/tiger1103/gfast/v3/internal/app/common/service"
 	"github.com/tiger1103/gfast/v3/internal/app/system/model"
 	"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
 		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) {
 		if !commonService.Captcha().VerifyString(req.VerifyKey, req.VerifyCode) {
 			err = gerror.New("验证码输入错误")
 			err = gerror.New("验证码输入错误")
 			return
 			return

+ 13 - 7
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
 package entity
 
 
+import (
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
 // SysRole is the golang structure for table sys_role.
 // SysRole is the golang structure for table sys_role.
 type SysRole struct {
 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:"更新时间"`
 }
 }

+ 5 - 1
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
 package internal
@@ -25,6 +25,8 @@ type SysRoleColumns struct {
 	Name      string // 角色名称
 	Name      string // 角色名称
 	Remark    string // 备注
 	Remark    string // 备注
 	DataScope string // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
 	DataScope string // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
+	CreatedAt string // 创建时间
+	UpdatedAt string // 更新时间
 }
 }
 
 
 //  sysRoleColumns holds the columns for table sys_role.
 //  sysRoleColumns holds the columns for table sys_role.
@@ -35,6 +37,8 @@ var sysRoleColumns = SysRoleColumns{
 	Name:      "name",
 	Name:      "name",
 	Remark:    "remark",
 	Remark:    "remark",
 	DataScope: "data_scope",
 	DataScope: "data_scope",
+	CreatedAt: "created_at",
+	UpdatedAt: "updated_at",
 }
 }
 
 
 // NewSysRoleDao creates and returns a new DAO object for table data access.
 // NewSysRoleDao creates and returns a new DAO object for table data access.

+ 4 - 1
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
 package do
 
 
 import (
 import (
 	"github.com/gogf/gf/v2/frame/g"
 	"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.
 // SysRole is the golang structure of table sys_role for DAO operations like Where/Data.
@@ -17,4 +18,6 @@ type SysRole struct {
 	Name      interface{} // 角色名称
 	Name      interface{} // 角色名称
 	Remark    interface{} // 备注
 	Remark    interface{} // 备注
 	DataScope interface{} // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
 	DataScope interface{} // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
+	CreatedAt *gtime.Time // 创建时间
+	UpdatedAt *gtime.Time // 更新时间
 }
 }

+ 1 - 1
manifest/config/config.yaml

@@ -76,7 +76,7 @@ gfcli:
   gen:
   gen:
     dao:
     dao:
       - link:            "mysql:root:123456@tcp(127.0.0.1:3306)/gfast-v3"
       - link:            "mysql:root:123456@tcp(127.0.0.1:3306)/gfast-v3"
-        tables:          "sys_auth_rule"
+        tables:          "sys_role"
         removePrefix:    "gf_"
         removePrefix:    "gf_"
         descriptionTag:  true
         descriptionTag:  true
         noModelComment:  true
         noModelComment:  true