mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-06 22:55:46 +08:00
feat: 新增系统全局配置&修改账号密码
This commit is contained in:
@@ -15,6 +15,7 @@ func InitAccountRouter(router *gin.RouterGroup) {
|
||||
ResourceApp: application.ResourceApp,
|
||||
RoleApp: application.RoleApp,
|
||||
MsgApp: application.MsgApp,
|
||||
ConfigApp: application.ConfigApp,
|
||||
}
|
||||
{
|
||||
// 用户登录
|
||||
@@ -61,7 +62,7 @@ func InitAccountRouter(router *gin.RouterGroup) {
|
||||
ctx.NewReqCtxWithGin(c).
|
||||
WithRequiredPermission(addAccountPermission).
|
||||
WithLog(createAccount).
|
||||
Handle(a.CreateAccount)
|
||||
Handle(a.SaveAccount)
|
||||
})
|
||||
|
||||
changeStatus := ctx.NewLogInfo("修改账号状态").WithSave(true)
|
||||
|
||||
30
server/internal/sys/router/config.go
Normal file
30
server/internal/sys/router/config.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/api"
|
||||
"mayfly-go/internal/sys/application"
|
||||
"mayfly-go/pkg/ctx"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func InitSysConfigRouter(router *gin.RouterGroup) {
|
||||
r := &api.Config{ConfigApp: application.ConfigApp}
|
||||
db := router.Group("sys/configs")
|
||||
{
|
||||
db.GET("", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).Handle(r.Configs)
|
||||
})
|
||||
|
||||
db.GET("/value", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithNeedToken(false).Handle(r.GetConfigValueByKey)
|
||||
})
|
||||
|
||||
saveConfig := ctx.NewLogInfo("保存系统配置信息").WithSave(true)
|
||||
db.POST("", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).
|
||||
WithLog(saveConfig).
|
||||
Handle(r.SaveConfig)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user