这是我的getter,它从本地存储中获取令牌
computed: {
...mapGetters(["getToken"])
}
如何在我的axios.post请求中访问它
const pay = () => {
elms.value.instance
.createToken(cardElement, { price: price.value })
.then(result => {
console.log(result);
const token = result.token;
const paymentData = {
token: token.id,
price: 100
};
axios
.post("http://localhost:5000/api/pay", paymentData)
.then(response => {
})
})
};