Skip to content

Commit

Permalink
fix: 登入功能。
Browse files Browse the repository at this point in the history
  • Loading branch information
1999JD committed Aug 28, 2022
1 parent 3479cce commit 6a97f27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ export default {
}
const res = await this.$api.deleteCarts(body)
if (res.err) return alert('刪除品項失敗')
console.log(res)
this.$store.commit('removeCartsItem', itemId)
},
},
Expand Down
11 changes: 7 additions & 4 deletions plugins/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ function apiFunction(axios) {
return axios.get(`/courses/fundraising`)
},
deleteCarts(body) {
return axios.delete(`/carts`, body)
return axios.delete(`/carts`, {
headers: {
common: { Accept: 'text/html' }
},
data: body
})
},
postCarts(body) {
return axios.post(`/carts`, body, {
headers: { common: { Accept: 'text/html' } }
})
return axios.post(`/carts`, body)
},
}
}
Expand Down

0 comments on commit 6a97f27

Please sign in to comment.