Commit e568edb8 authored by 冷冷's avatar 冷冷

🐛 Fixing a bug. api change

parent 57ab08c5
...@@ -17,6 +17,14 @@ ...@@ -17,6 +17,14 @@
import request from '@/router/axios' import request from '@/router/axios'
export function fetchDeptTree(query) {
return request({
url: '/admin/dept/user-tree',
method: 'get',
params: query
})
}
export function fetchTree(query) { export function fetchTree(query) {
return request({ return request({
url: '/admin/dept/tree', url: '/admin/dept/tree',
......
...@@ -86,11 +86,3 @@ export function fetchRoleTree(roleName) { ...@@ -86,11 +86,3 @@ export function fetchRoleTree(roleName) {
method: 'get' method: 'get'
}) })
} }
export function fetchDeptTree(query) {
return request({
url: '/admin/dept/tree',
method: 'get',
params: query
})
}
...@@ -111,7 +111,8 @@ ...@@ -111,7 +111,8 @@
<script> <script>
import { fetchList, getObj, addObj, putObj, delObj } from "@/api/user"; import { fetchList, getObj, addObj, putObj, delObj } from "@/api/user";
import { deptRoleList, fetchDeptTree } from "@/api/role"; import { deptRoleList } from "@/api/role";
import { fetchDeptTree } from "@/api/dept";
import { tableOption } from '@/const/crud/user'; import { tableOption } from '@/const/crud/user';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { constants } from 'fs'; import { constants } from 'fs';
...@@ -228,7 +229,7 @@ export default { ...@@ -228,7 +229,7 @@ export default {
this.role[i] = this.form.roleList[i].roleId; this.role[i] = this.form.roleList[i].roleId;
} }
deptRoleList().then(response => { deptRoleList().then(response => {
this.rolesOptions = response.data; this.rolesOptions = response.data.data;
}); });
} else if (type === 'add') { } else if (type === 'add') {
this.role = []; this.role = [];
...@@ -241,7 +242,7 @@ export default { ...@@ -241,7 +242,7 @@ export default {
}, },
create (row, done, loading) { create (row, done, loading) {
addObj(this.form).then(() => { addObj(this.form).then(() => {
this.getList(); this.getList(this.page);
done(); done();
this.$notify({ this.$notify({
title: "成功", title: "成功",
...@@ -255,7 +256,7 @@ export default { ...@@ -255,7 +256,7 @@ export default {
}, },
update (row, index, done, loading) { update (row, index, done, loading) {
putObj(this.form).then(() => { putObj(this.form).then(() => {
this.getList(); this.getList(this.page);
done(); done();
this.$notify({ this.$notify({
title: "成功", title: "成功",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment