Skip to content

Commit

Permalink
使用CRUD 共工接口
Browse files Browse the repository at this point in the history
  • Loading branch information
yang0817gj committed Apr 4, 2020
1 parent 5f84e21 commit b731f85
Show file tree
Hide file tree
Showing 2,944 changed files with 2,051 additions and 395,270 deletions.
9 changes: 4 additions & 5 deletions admin/src/views/CategoryEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export default {
let res;
if (this.id) {
res = await this.$http.put(
`/categories/${this.id}`,
`/rest/categories/${this.id}`,
this.model
);
} else {
res = await this.$http.post("/categories", this.model);
res = await this.$http.post("/rest/categories", this.model);
}
this.$router.push({
path: "/CategoryList"
Expand All @@ -53,13 +53,12 @@ export default {
});
},
async fatch() {
const res = await this.$http.get(`/categories/${this.id}`);
const res = await this.$http.get(`/rest/categories/${this.id}`);
this.model = res.data;
},
async fetchParent() {
const res = await this.$http.get(`/categories`);
const res = await this.$http.get(`/rest/categories`);
this.parentOptions = res.data;
console.log(this.parentOptions);
}
},
created() {
Expand Down
4 changes: 2 additions & 2 deletions admin/src/views/CategoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
},
methods: {
async fatch() {
const res = await this.$http.get("categories");
const res = await this.$http.get("/rest/categories");
console.log(res);
this.model = res.data;
},
Expand All @@ -43,7 +43,7 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const res = await this.$http.delete(`categories/${id}`);
const res = await this.$http.delete(`/rest/categories/${id}`);
console.log(res);
this.fatch();
});
Expand Down
3 changes: 0 additions & 3 deletions server/node_modules/.recently_updates.txt

This file was deleted.

2 changes: 2 additions & 0 deletions server/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

236 changes: 0 additions & 236 deletions server/node_modules/_accepts@1.3.7@accepts/HISTORY.md

This file was deleted.

23 changes: 0 additions & 23 deletions server/node_modules/_accepts@1.3.7@accepts/LICENSE

This file was deleted.

Loading

0 comments on commit b731f85

Please sign in to comment.