mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-28 17:29:36 +08:00
【优化】租户功能,框架优化
This commit is contained in:
@@ -5,9 +5,10 @@ type AppContext struct {
|
||||
|
||||
type LoginAccount struct {
|
||||
UserId int64
|
||||
TenantId int64
|
||||
RoleId int64
|
||||
DeptId int64
|
||||
PostId int64
|
||||
Username string
|
||||
Rolename string
|
||||
RoleKey string
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package model
|
||||
import (
|
||||
"fmt"
|
||||
"pandax/base/biz"
|
||||
"pandax/base/global"
|
||||
"pandax/pkg/global"
|
||||
"strconv"
|
||||
|
||||
"strings"
|
||||
@@ -48,7 +48,9 @@ func (m *Model) SetBaseInfo(account *LoginAccount) {
|
||||
func Tx(funcs ...func(db *gorm.DB) error) (err error) {
|
||||
tx := global.Db.Begin()
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
var err any
|
||||
err = recover()
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
err = fmt.Errorf("%v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user