mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-14 13:13:51 +08:00
1、泛型化参数,预留泛型约束,方便以后代码扩展的类型安全校验
2、升级goframe至v2.7.3
This commit is contained in:
@@ -165,7 +165,7 @@ func (h *hookSaveTenant) checkRelationSingle(idx any, relation, limitType string
|
||||
return
|
||||
}
|
||||
|
||||
relationId := contexts.GetUserId(h.ctx)
|
||||
relationId := contexts.GetUserId[any](h.ctx)
|
||||
switch relation {
|
||||
case consts.DeptTypeTenant:
|
||||
if ok = tr.TenantId == relationId; !ok {
|
||||
@@ -210,8 +210,8 @@ func (h *hookSaveTenant) handle() (result sql.Result, err error) {
|
||||
var (
|
||||
update = make(g.Map)
|
||||
fields = h.getFields()
|
||||
memberId = contexts.GetUserId(h.ctx)
|
||||
deptType = contexts.GetDeptType(h.ctx)
|
||||
memberId = contexts.GetUserId[any](h.ctx)
|
||||
deptType = contexts.GetDeptType[any](h.ctx)
|
||||
tr *hgorm.TenantRelation
|
||||
)
|
||||
|
||||
@@ -221,7 +221,7 @@ func (h *hookSaveTenant) handle() (result sql.Result, err error) {
|
||||
}
|
||||
|
||||
// 非公司类型,加载自己的租户关系,用于重写关系
|
||||
if !contexts.IsCompanyDept(h.ctx) {
|
||||
if !contexts.IsCompanyDept[any](h.ctx) {
|
||||
tr, err = h.getRelation(memberId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user