fix: 修复删除资源时未验证所有者的问题
Quality check / Web UI (push) Successful in 9m11s

This commit is contained in:
mei
2026-08-30 17:47:53 +08:00
parent 59cf99ae22
commit 360169ee64
6 changed files with 68 additions and 0 deletions
+14
View File
@@ -59,3 +59,17 @@ func maskAccounts(accounts []model.Account) []model.Account {
}
return masked
}
// getAccountOwnerUID 获取账号所属用户的 UID
func getAccountOwnerUID(accountID uint) (uint, error) {
gormDB, err := db.GetGormDB()
if err != nil {
return 0, err
}
var account model.Account
if err := gormDB.Select("uid").Where("id = ?", accountID).First(&account).Error; err != nil {
return 0, err
}
return account.UID, nil
}