Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Yutta82 committed May 8, 2023
1 parent 99f6833 commit db2fae5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ export default {
},
methods: {
getData() {
let id =Math.random()*10;
//2.使用axios 进行post请求
this.$request.post("TestController/testParams", {
id: 1
id
}).then((res) => {
//请求成功的回调函数
console.log(res);
this.responseJson = res;
this.person.id = res;
this.person.id = res.id;
}).catch((err) => {
//请求失败的回调函数
console.log(err)
Expand Down

0 comments on commit db2fae5

Please sign in to comment.