Skip to content

Commit f06777b

Browse files
committed
📝 更改接口,将原来的接口改为restframework的接口
1 parent c8250a0 commit f06777b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/MessageList.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ export default {
2727
/* eslint-disable */
2828
data() {
2929
let comments = [];
30+
let result = [];
3031
return {
3132
comments,
3233
current: 1,
34+
result
3335
}
3436
},
3537
methods: {
@@ -42,8 +44,10 @@ export default {
4244
}
4345
},
4446
beforeMount: function () {
45-
this.$http("http://www.bai3.xyz/comment/getlist")
46-
.then(response => {console.log(response);this.comments = response.data.reverse()})
47+
this.$http("http://www.bai3.xyz/api/getlist/?format=json")
48+
.then(response => {this.comments = response.data.reverse()});
49+
this.$http("http://www.bai3.xyz/api/users/?format=json")
50+
.then(response => {this.result = response.data})
4751
},
4852
4953
filters: {

0 commit comments

Comments
 (0)