[GH-ISSUE #671] 接口单复数导致404 #6114

Closed
opened 2026-03-01 17:09:35 +03:00 by kerem · 1 comment
Owner

Originally created by @fjk0618 on GitHub (Oct 28, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/671

Describe the bug
后段api接口,在定义列表接口时,是复数风格,例如/certs、/dns_credentials,但是在新增、删除、编辑时是单数风格,例如/cert/:id,/dns_credential/:id,因为前端公用了同一个baseUrl,导致除了列表接口外, 其他接口都会404。
因为获取列表时,调用的是get请求的/api/dns_credentials,此时baseUrl=/api/dns_credentials,此时去调用新增接口,只会变成post的
/api/dns_credentials,而后端实际接口是/api/dns_credential。希望大佬能够统一修复下。目前发现

  1. dns_credentials
  2. certs
  3. acme_users
    certificate/route.go中的路由存在这个问题

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Info (please complete the following information):

  • Server OS: [e.g. Ubuntu 22.04]
  • Server Arch: [e.g. x86, aach64]
  • Nginx UI Version: [e.g. 1.8.0]
  • Your Browser: [e.g. Chrome, Safari, Firefox]

Additional context
Add any other context about the problem here.

Originally created by @fjk0618 on GitHub (Oct 28, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/671 **Describe the bug** 后段api接口,在定义列表接口时,是复数风格,例如/certs、/dns_credentials,但是在新增、删除、编辑时是单数风格,例如/cert/:id,/dns_credential/:id,因为前端公用了同一个baseUrl,导致除了列表接口外, 其他接口都会404。 因为获取列表时,调用的是get请求的/api/dns_credentials,此时baseUrl=/api/dns_credentials,此时去调用新增接口,只会变成post的 /api/dns_credentials,而后端实际接口是/api/dns_credential。希望大佬能够统一修复下。目前发现 1. dns_credentials 2. certs 3. acme_users certificate/route.go中的路由存在这个问题 **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 4. Click on '....' 5. Scroll down to '....' 6. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Info (please complete the following information):** - Server OS: [e.g. Ubuntu 22.04] - Server Arch: [e.g. x86, aach64] - Nginx UI Version: [e.g. 1.8.0] - Your Browser: [e.g. Chrome, Safari, Firefox] **Additional context** Add any other context about the problem here.
kerem 2026-03-01 17:09:35 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Oct 28, 2024):

已经修复,稍后发新版

<!-- gh-comment-id:2440967529 --> @0xJacky commented on GitHub (Oct 28, 2024): 已经修复,稍后发新版
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#6114
No description provided.