【发布时间】:2019-05-20 10:14:47
【问题描述】:
我有一个想要从后端更改的前端用户。所以我做了一个 AXIOS 查询,但它不起作用。
async updateUtilisateur(user) {
const headers = {
'authorization': localStorage.getItem(ACCESS_TOKEN)
}
const {id} = user.id;
return await axios.put('/secure/utilisateur/${id}',
user,{headers}
);
},
在我的后端日志中: o.s.s.w.u.matcher.AntPathRequestMatcher :检查请求的匹配:'/secure/utilisateur/${id}';反对'/gestion-promotions/secure/**'
2018-12-19 22:21:19.018 WARN 1432 --- [io-8080-exec-14] .wsmsDefaultHandlerExceptionResolver:已解决 [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException:无法转换键入“java.lang.String”到所需类型“java.lang.Integer”;嵌套异常是 java.lang.NumberFormatException: For input string: "${id}"]
id 是我请求中的 PathVariable
【问题讨论】:
标签: javascript axios