关于Spring Security+axios 自定义成功失败处理返回null值的原因记录问题1:首先排除HTML 或者javascript 表单或者 异步提交的字段名错误:**username**axios 异步提交正确方案问题1:首先排除HTML 或者javascript ...

关于Spring Security+axios 自定义成功失败处理返回null值的原因记录
- 问题1:首先排除HTML 或者javascript 表单或者 异步提交的字段名错误:**username**
- axios 异步提交正确方案
问题1:首先排除HTML 或者javascript 表单或者 异步提交的字段名错误:username
Java的基本都是驼峰命名要小心被坑
axios 异步提交正确方案
注意:
axios({
headers: {‘Content-Type’:‘application/x-www-form-urlencoded’},
method: “post”,
url: “http://localhost:8080/submitLogin”,
params: { username:document.getElementById(“username”).value, password:document.getElementById(“password”).value},
}).then(function (response) {
if(!response.data.success){
alert(response.data.error);
window.location.href=“http://localhost:8080/loginAction”;
}else {
alert(response.data.message);
window.location.href=“http://localhost:8080/admin”;
}
})
本文标题为:关于Spring Security+axios 自定义成功失败处理返回null值的原因【已解决】


基础教程推荐
- Flutter手势密码的实现示例(附demo) 2023-04-11
- Android多返回栈技术 2023-04-15
- IOS 播放系统提示音使用总结(AudioToolbox) 2023-03-01
- 解决Android Studio突然不显示logcat日志的问题 2023-02-04
- Android中的webview监听每次URL变化实例 2023-01-23
- IOS应用内跳转系统设置相关界面的方法 2022-11-20
- iOS开发教程之XLForm的基本使用方法 2023-05-01
- Android开发使用RecyclerView添加点击事件实例详解 2023-06-15
- Flutter绘图组件之CustomPaint使用详解 2023-05-12
- android studio按钮监听的5种方法实例详解 2023-01-12