fix: 修复移除账号角色接口路由参数名错误
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
RemoveRole handler 中使用 c.Params("id") 取账号 ID,
但路由注册的参数名为 account_id,导致解析失败报"无效的账号 ID"。
修正为 c.Params("account_id")。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -148,7 +148,7 @@ func (h *AccountHandler) GetRoles(c *fiber.Ctx) error {
|
||||
// RemoveRole 移除账号的角色
|
||||
// DELETE /api/admin/accounts/:account_id/roles/:role_id
|
||||
func (h *AccountHandler) RemoveRole(c *fiber.Ctx) error {
|
||||
id, err := strconv.ParseUint(c.Params("id"), 10, 64)
|
||||
id, err := strconv.ParseUint(c.Params("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
return errors.New(errors.CodeInvalidParam, "无效的账号 ID")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user