async asyncData(context) {
console.log("asyncData runing");
let categoryListData = await axios({
method: "POST",
url: api.categoryList,
headers: {
authorization: api.authCode,
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
transformRequest: [data => Qs.stringify(data)],
data: {}
}).then(response => {
let data = response.data;
return data.data.rows;
}).catch(error => {
console.log("error:", error);
});
context.store.commit('getCategoryList', categoryListData)
return;
},
添加回答
举报
0/150
提交
取消