Skip to content

接口单复数导致404 #671

@fjk0618

Description

@fjk0618

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions