51,407
社区成员
发帖
与我相关
我的任务
分享造成这个问题的原因是前端发送/login请求时没有携带cookie。
解决方法如下:
如果前端基于Vue,那么 在发起ajax请求时带上cookie需要进行如下配置,可以配置在全局axios中,或者配置在main.js中
import axios from 'axios'
axios.defaults.withCredentials=true;//让ajax携带cookie
可能会出现跨域问题,解决一下即可。
感谢博客《关于shiro授权 This subject is anonymous - it does not have any identifying principals and》的作者“普通网友“