mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 05:12:32 +08:00
优化服务启动流程,修复后端配置组件名称和vue组件名称不一致无法缓存问题
This commit is contained in:
@@ -7,7 +7,6 @@ package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
@@ -100,7 +99,7 @@ func (s *sAdminDept) Edit(ctx context.Context, in adminin.DeptEditInp) (err erro
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
in.Tree = fmt.Sprintf("%str_%v ", pTree.String(), in.Id)
|
||||
in.Tree = tree.GenLabel(pTree.String(), in.Id)
|
||||
|
||||
err = dao.AdminDept.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
// 更新数据
|
||||
@@ -129,7 +128,8 @@ func updateChildrenTree(ctx context.Context, _id int64, _level int, _tree string
|
||||
}
|
||||
for _, child := range list {
|
||||
child.Level = _level + 1
|
||||
child.Tree = fmt.Sprintf("%str_%v ", _tree, child.Id)
|
||||
child.Tree = tree.GenLabel(_tree, child.Id)
|
||||
|
||||
_, err = dao.AdminDept.Ctx(ctx).Where("id", child.Id).Data("level", child.Level, "tree", child.Tree).Update()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@@ -7,7 +7,6 @@ package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
@@ -224,7 +223,7 @@ func (s *sAdminRole) Edit(ctx context.Context, in *role.EditReq) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
in.Tree = fmt.Sprintf("%str_%v ", pTree.String(), in.Id)
|
||||
in.Tree = tree.GenLabel(pTree.String(), in.Id)
|
||||
|
||||
err = dao.AdminRole.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
|
||||
// 更新数据
|
||||
@@ -252,7 +251,8 @@ func updateRoleChildrenTree(ctx context.Context, _id int64, _level int, _tree st
|
||||
}
|
||||
for _, child := range list {
|
||||
child.Level = _level + 1
|
||||
child.Tree = fmt.Sprintf("%str_%v ", _tree, child.Id)
|
||||
child.Tree = tree.GenLabel(_tree, child.Id)
|
||||
|
||||
_, err = dao.AdminRole.Ctx(ctx).Where("id", child.Id).Data("level", child.Level, "tree", child.Tree).Update()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user