mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-04 21:55:48 +08:00
feat: 代码优化、机器计划任务完善
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"mayfly-go/pkg/ginx"
|
||||
"mayfly-go/pkg/model"
|
||||
"mayfly-go/pkg/req"
|
||||
"mayfly-go/pkg/utils"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -72,14 +72,14 @@ func (r *Role) SaveResource(rc *req.Ctx) {
|
||||
rc.ReqParam = form
|
||||
|
||||
// 将,拼接的字符串进行切割并转换
|
||||
newIds := utils.ArrayMap[string, uint64](strings.Split(form.ResourceIds, ","), func(val string) uint64 {
|
||||
newIds := collx.ArrayMap[string, uint64](strings.Split(form.ResourceIds, ","), func(val string) uint64 {
|
||||
id, _ := strconv.Atoi(val)
|
||||
return uint64(id)
|
||||
})
|
||||
|
||||
oIds := r.RoleApp.GetRoleResourceIds(uint64(form.Id))
|
||||
|
||||
addIds, delIds, _ := utils.ArrayCompare(newIds, oIds, func(i1, i2 uint64) bool {
|
||||
addIds, delIds, _ := collx.ArrayCompare(newIds, oIds, func(i1, i2 uint64) bool {
|
||||
return i1 == i2
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user