Commit 9b3767a9 authored by RuoYi's avatar RuoYi
Browse files

优化多角色数据权限匹配规则

parent 851dc54b
...@@ -342,9 +342,8 @@ ...@@ -342,9 +342,8 @@
</template> </template>
<script> <script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user"; import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
...@@ -462,7 +461,7 @@ export default { ...@@ -462,7 +461,7 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getTreeselect(); this.getDeptTree();
this.getConfigKey("sys.user.initPassword").then(response => { this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg; this.initPassword = response.msg;
}); });
...@@ -479,8 +478,8 @@ export default { ...@@ -479,8 +478,8 @@ export default {
); );
}, },
/** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */
getTreeselect() { getDeptTree() {
treeselect().then(response => { deptTreeSelect().then(response => {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
...@@ -561,7 +560,6 @@ export default { ...@@ -561,7 +560,6 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.getTreeselect();
getUser().then(response => { getUser().then(response => {
this.postOptions = response.posts; this.postOptions = response.posts;
this.roleOptions = response.roles; this.roleOptions = response.roles;
...@@ -573,7 +571,6 @@ export default { ...@@ -573,7 +571,6 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.getTreeselect();
const userId = row.userId || this.ids; const userId = row.userId || this.ids;
getUser(userId).then(response => { getUser(userId).then(response => {
this.form = response.data; this.form = response.data;
......
Supports Markdown
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