提交 2b5ce5a4 编写于 作者: C Captain.B

Merge branch 'dev' of github.com:fit2cloudrd/metersphere-server into dev

......@@ -60,7 +60,9 @@
<script>
import MsCreateBox from "./CreateBox";
import Cookies from 'js-cookie';
import {Message} from "element-ui";
import {TokenKey} from "../../../common/constants";
export default {
name: "OrganizationWorkspace",
......@@ -68,6 +70,13 @@
mounted() {
this.list();
},
computed: {
currentUser: () => {
let user = Cookies.get(TokenKey);
window.console.log(user);
return JSON.parse(user);
}
},
methods: {
create() {
this.createVisible = true;
......@@ -118,11 +127,21 @@
},
list() {
let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize;
this.result = this.$post(url, {name: this.condition}, response => {
let data = response.data;
this.items = data.listObject;
this.total = data.itemCount;
});
let lastOrganizationId = this.currentUser.lastOrganizationId;
let userRole = this.currentUser.userRoles.filter(r => r.sourceId === lastOrganizationId);
if (userRole.length > 0) {
if (userRole[0].roleId === "org_admin") {
this.result = this.$post(url, {name: this.condition}, response => {
let data = response.data;
this.items = data.listObject;
this.total = data.itemCount;
});
} else {
this.items = [];
this.total = 0;
}
}
},
handleSizeChange(size) {
this.pageSize = size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册