fix(tenant): 封堵审计文件与历史用户跨站访问
This commit is contained in:
@@ -104,17 +104,8 @@ func Append(tx *gorm.DB, entries ...Entry) error {
|
||||
continue
|
||||
}
|
||||
tenantID := entry.TenantID
|
||||
if tenantID == 0 {
|
||||
var row struct {
|
||||
TenantID uint64
|
||||
}
|
||||
if err := tx.Table("admin_user_roles").
|
||||
Select("tenant_id").
|
||||
Where("admin_user_id = ? AND tenant_id > 0", entry.AdminUserID).
|
||||
Order("tenant_id ASC").
|
||||
Take(&row).Error; err == nil {
|
||||
tenantID = row.TenantID
|
||||
}
|
||||
if tenantID == 0 && tx.Statement != nil && tx.Statement.Context != nil {
|
||||
tenantID = tenancy.IDFromContext(tx.Statement.Context)
|
||||
}
|
||||
row := model.AdminNotification{
|
||||
TenantID: tenantID,
|
||||
|
||||
Reference in New Issue
Block a user