vue.js - Vue.js 使用 POST 错误(Sysntax 但未找到)
问题描述
感谢您阅读这个问题。
我有一个语法错误,但我找不到在哪里。
我正在使用 Vue.js 和引导程序,我正在研究购物车功能。为了使端点工作,您需要传递一个特殊的身份验证标头:
授权:kazuhisa.noguchi.ghsd75@gmail.com
import Vue from 'vue'
import App from './App.vue'
import BootstrapVue from 'bootstrap-vue'
import VueRouter from 'vue-router'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
import MainPage from './components/MainPage.vue'
import HelpPage from './components/HelpPage.vue'
import ProductPage from './components/ProductPage.vue'
import CategoryPage from './components/CategoryPage.vue'
Vue.config.productionTip = false
Vue.use(BootstrapVue)
Vue.use(VueRouter)
const router = new VueRouter({
routes: [{
path: '/',
component: MainPage
},
{
path: '/help',
component: HelpPage
},
{
path: '/products/:productId',
component: ProductPage
},
{
path: '/categories/:categoryAlias',
component: CategoryPage
}
],
mode: 'history'
})
axios.defaults.headers.common['Authorization'] = 'azuhisa.noguchi.ghsd75@gmail.com';
axios.post("https://euas.person.ee/user/carts/").then(
response => {
new Vue({
render: h => h(App),
router: router,
data: {
cart: response.data,
saveCard() {
axios.put("https://euas.person.ee/user/carts/" +
this.cart.id, this.cart)
}
}
}).$mount('#app')
}
};
尽我所能,
解决方案
推荐阅读
- c - 我的 C 程序无法识别有效输入,认为这是因为换行问题
- ruby-on-rails - 这是在后端允许在 Rails 中使用参数的安全方法吗?
- python - *不*能够从文件中取回值
- svelte-3 - svelte 不断更新 store var 而不点击更新
- firefox - FireFox Video 发出警告,但视频确实有效?
- javascript - 有效地查找字符串中的 n 个最长单词
- scriptdom - 在动态 SQL 中,ScriptDom 正在查找 IF 语句,而不是 UPDATE 语句
- javascript - 为什么 Symbol.iterator 被设计为 Symbol 类型?
- git - 后续提交后将功能分支合并到主分支?
- python - 包含 Nan / Series.idxmax() 和 np.NA 的数值的 Panda Series dtype 引发 TypeError