[英]POST http://localhost:3000/api/v1/stories 401 (Unauthorized)
[英]GET http://localhost:3000/api/auth/user/:id 401 (Unauthorized)
我將 vue3 與 axios 和 prisma 一起使用,但在獲取用戶信息時遇到問題。
我的郵遞員請求沒問題(http://localhost:3000/api/auth/user/7),但我的 axios req 不是。
你能幫我嗎 ?
async created () {
const response = await axios.get('http://localhost:3000/api/auth/user/:id', {
headers: {
Authorization: 'Bearer ' + localStorage.getItem('token')
}
});
console.log('ici');
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.