token
来源:4-4 获取用户基本信息
samijan
2022-11-09
我刚登录还是提示401 token 失效
Accept: application/json, text/plain, /
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Authorization: Bearer 8cb25a87-61d6-42b5-b416-57bbb8963dcf
Connection: keep-alive
Host: api.imooc-admin.lgdsunday.club
icode: XXXX
Origin: http://localhost:8083
Referer: http://localhost:8083/
写回答
2回答
-
samijan
提问者
2022-11-09
确实cookie的问题了
const service = axios.create({ baseURL:import.meta.env.VITE_API_BASE_URL, withCredentials:true, // 添加了这段代码 timeout:5000 })// 添加这行代码 withCredentials:true, /** 然后出现跨越的问题开启代理就好了 */
00 -
Sunday
2022-11-09
你好
你可以把 401 的请求截图,给我发送一下我看看。看你现在的信息应该是 cookie 没有发过去。
032022-11-10
相似问题