为了账号安全,请及时绑定邮箱和手机立即绑定

获取OTP短信验证失败,打开网页输入手机号点击获取OTP后出现以下错误求大神解答,谢谢!

Access to XMLHttpRequest at 'http://localhost:8090/user/getotp' from origin 'http://localhost:63342' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

正在回答

1 回答

Ajax跨域请求问题,设置一下属性就可以了,前端Ajax请求中添加

xhrFields: {withCredentials: true},
后端controller层添加@CrossOrigin(origins = "*", allowCredentials = "true")就可以访问了


3 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

获取OTP短信验证失败,打开网页输入手机号点击获取OTP后出现以下错误求大神解答,谢谢!

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信