提交 8c121c39 编写于 作者: S shiziyuan9527

组织成员管理

上级 807135e7
......@@ -62,9 +62,10 @@ public class UserController {
}
@PostMapping("/switch/source/{sourceId}")
public void switchUserRole(@PathVariable(value = "sourceId") String sourceId) {
public UserDTO switchUserRole(@PathVariable(value = "sourceId") String sourceId) {
UserDTO user = SessionUtils.getUser();
userService.switchUserRole(user, sourceId);
return SessionUtils.getUser();
}
@GetMapping("/info/{userId}")
......
......@@ -32,7 +32,9 @@
}
},
mounted() {
this.activeIndex = this.$route.matched[0].path || '/'
if (this.$route.matched.length > 0) {
this.activeIndex = this.$route.matched[0].path;
}
},
methods: {
handleSelect(index) {
......
......@@ -124,8 +124,11 @@
let user = {};
user.id = this.currentUserInfo.id;
user.lastSourceId = data.id;
this.$post("/user/switch/source/" + user.lastSourceId, {});
window.location.reload();
this.$post("/user/switch/source/" + user.lastSourceId, {},response => {
Cookies.set(TokenKey, response.data);
window.location.reload();
})
}
}
}
......
......@@ -63,6 +63,8 @@
<script>
import MsCreateBox from "./CreateBox";
import Cookies from 'js-cookie';
import {TokenKey} from "../../../common/constants";
export default {
name: "OrganizationMember",
components: {MsCreateBox},
......@@ -84,19 +86,24 @@
]
},
multipleSelection: [],
currentOrganizationId: "d2f49498-3333-4872-ab98-59174d4a81da",
currentOrganizationId: JSON.parse(Cookies.get(TokenKey)).organizationId,
currentPage: 1,
pageSize: 5,
total: 0
total: 0,
}
},
methods: {
currentUser: () => {
let user = Cookies.get(TokenKey);
window.console.log(user);
return JSON.parse(user);
},
initTableData() {
let param = {
name: this.condition,
organizationId: this.currentOrganizationId
organizationId: this.currentUser().organizationId
// organizationId: this.currentOrganizationId
};
this.result = this.$post(this.buildPagePath(this.queryPath), param, response => {
let data = response.data;
this.total = data.itemCount;
......@@ -116,22 +123,19 @@
this.currentPage = current;
},
del(row) {
this.$confirm('移除该成员, 是否继续?', '提示', {
this.$confirm('是否删除用户 ' + row.name + ' ?', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.loading = true;
this.$get('/user/member/delete/' + this.currentWorkspaceId + '/' + row.id).then(() => {
this.result = this.$get('/user/orgmember/delete/' + this.currentOrganizationId + '/' + row.id, () => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.initTableData();
this.loading = false;
});
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.loading = false;
this.$message({
type: 'info',
message: '已取消删除'
......@@ -139,22 +143,10 @@
});
},
create() {
this.loading = true;
this.$get('/user/list').then(response => {
if (response.data.success) {
this.result = this.$get('/user/list', response => {
this.createVisible = true;
this.form = {userList: response.data.data};
} else {
this.$message.error(response.message);
}
this.loading = false;
}).catch(() => {
this.loading = false;
this.$message({
type: 'error',
message: '获取用户列表失败'
});
});
this.form = {userList: response.data};
})
},
submitForm(formName) {
this.loading = true;
......@@ -162,14 +154,11 @@
if (valid) {
let param = {
userIds: this.form.userIds,
workspaceId: this.currentWorkspaceId
organizationId: this.currentOrganizationId
};
this.$post("user/member/add", param).then(() => {
this.result = this.$post("user/orgmember/add", param,() => {
this.initTableData();
this.createVisible = false;
this.loading = false;
}).catch(() => {
this.loading = false;
})
} else {
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册