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
+12
View File
@@ -218,6 +218,18 @@ func HandleDeleteAccount(c *gin.Context) {
return
}
// 检查账号是否归属请求用户
ownerUID, err := getAccountOwnerUID(accountID)
if err != nil {
response.ServerError(c, "获取账号所属用户失败")
return
}
if ownerUID != userInfo.ID {
response.Forbidden(c, "无权限操作该账号")
return
}
// 删除相关规则
rules, err := getRulesByAccountID(accountID, userInfo.ID)
if err != nil {