问题描述

关于接口报错{“msg”:“Request method ‘POST’ not supported”,“code”:500}
getway网关没有打印日志

{"msg":"Request method 'POST' not supported","code":500}

原因分析:

1、接口未编写
2、接口类型不对


解决方案:

1、检查接口名字,大小写字符、路径是否一致
2、检查后端注解
@GetMapping @PutMapping @PostMapping

与前端 src\api\接口文件
接口发送的method请求类型是否一致
如

export function update(data) {
  return request({
    url: '/basic/My',
    method: 'put',
    data: data
  })
}

export function del(id) {
  return request({
    url: '/basic/My/' + id,
    method: 'delete'
  })
}

更多推荐