1 回答

TA貢獻1829條經驗 獲得超7個贊
它應該this.$route.query.id代替this.$route.query
mounted: function () {
CifRepository
.getCustomerDetails(this.$route.query.id)
.then(response => {
this.model = response.data.Results;
})
.catch(error => {
console.log(error)
this.errored = true
})
.finally(() => this.loading = false);
}
和
getCustomerDetails(id) {
return Repository.get("/api/Accounts/GetCustomerDetails/" + id);
}
我不確定 C# 部分,但可能是
[HttpGet("GetCustomerDetails/${id}")]
public async Task<CustomerListingDto> GetCustomerDetails(long id)
{
CustomerServiceModel customers = await
_accountService.GetCustomerDetailsByCustomerId(id);
return _mapper.Map<CustomerListingDto>(customers);
}
- 1 回答
- 0 關注
- 143 瀏覽
添加回答
舉報