Merge branch 'dev' of https://github.com/metersphere/server into dev
This commit is contained in:
commit
8333367ca0
|
@ -123,6 +123,10 @@ public class OrganizationService {
|
||||||
list.add(r.getParentId());
|
list.add(r.getParentId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ignore list size is 0
|
||||||
|
list.add("no_such_id");
|
||||||
|
|
||||||
OrganizationExample organizationExample = new OrganizationExample();
|
OrganizationExample organizationExample = new OrganizationExample();
|
||||||
organizationExample.createCriteria().andIdIn(list);
|
organizationExample.createCriteria().andIdIn(list);
|
||||||
return organizationMapper.selectByExample(organizationExample);
|
return organizationMapper.selectByExample(organizationExample);
|
||||||
|
|
|
@ -195,6 +195,17 @@ public class UserService {
|
||||||
String userId = user.getId();
|
String userId = user.getId();
|
||||||
UserRoleExample userRoleExample = new UserRoleExample();
|
UserRoleExample userRoleExample = new UserRoleExample();
|
||||||
userRoleExample.createCriteria().andUserIdEqualTo(userId);
|
userRoleExample.createCriteria().andUserIdEqualTo(userId);
|
||||||
|
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
|
||||||
|
List<String> list = userRoles.stream().map(UserRole::getSourceId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
if (list.contains(user.getLastWorkspaceId()) || list.contains(user.getLastOrganizationId())) {
|
||||||
|
user.setLastOrganizationId("");
|
||||||
|
user.setLastWorkspaceId("");
|
||||||
|
userMapper.updateByPrimaryKeySelective(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
userRoleMapper.deleteByExample(userRoleExample);
|
userRoleMapper.deleteByExample(userRoleExample);
|
||||||
List<Map<String, Object>> roles = user.getRoles();
|
List<Map<String, Object>> roles = user.getRoles();
|
||||||
if (!roles.isEmpty()) {
|
if (!roles.isEmpty()) {
|
||||||
|
@ -275,6 +286,14 @@ public class UserService {
|
||||||
UserRoleExample example = new UserRoleExample();
|
UserRoleExample example = new UserRoleExample();
|
||||||
example.createCriteria().andRoleIdLike("%test%")
|
example.createCriteria().andRoleIdLike("%test%")
|
||||||
.andUserIdEqualTo(userId).andSourceIdEqualTo(workspaceId);
|
.andUserIdEqualTo(userId).andSourceIdEqualTo(workspaceId);
|
||||||
|
|
||||||
|
User user = userMapper.selectByPrimaryKey(userId);
|
||||||
|
if (StringUtils.equals(workspaceId, user.getLastWorkspaceId())) {
|
||||||
|
user.setLastWorkspaceId("");
|
||||||
|
user.setLastOrganizationId("");
|
||||||
|
userMapper.updateByPrimaryKeySelective(user);
|
||||||
|
}
|
||||||
|
|
||||||
userRoleMapper.deleteByExample(example);
|
userRoleMapper.deleteByExample(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +324,14 @@ public class UserService {
|
||||||
public void delOrganizationMember(String organizationId, String userId) {
|
public void delOrganizationMember(String organizationId, String userId) {
|
||||||
UserRoleExample userRoleExample = new UserRoleExample();
|
UserRoleExample userRoleExample = new UserRoleExample();
|
||||||
userRoleExample.createCriteria().andRoleIdLike("%org%").andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId);
|
userRoleExample.createCriteria().andRoleIdLike("%org%").andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId);
|
||||||
|
|
||||||
|
User user = userMapper.selectByPrimaryKey(userId);
|
||||||
|
if (StringUtils.equals(organizationId, user.getLastOrganizationId())) {
|
||||||
|
user.setLastWorkspaceId("");
|
||||||
|
user.setLastOrganizationId("");
|
||||||
|
userMapper.updateByPrimaryKeySelective(user);
|
||||||
|
}
|
||||||
|
|
||||||
userRoleMapper.deleteByExample(userRoleExample);
|
userRoleMapper.deleteByExample(userRoleExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,9 +301,6 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
createTestResourcePool(createTestResourcePoolForm) {
|
createTestResourcePool(createTestResourcePoolForm) {
|
||||||
if (this.result.loading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$refs[createTestResourcePoolForm].validate(valid => {
|
this.$refs[createTestResourcePoolForm].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let vri = this.validateResourceInfo();
|
let vri = this.validateResourceInfo();
|
||||||
|
@ -340,9 +337,6 @@
|
||||||
this.form.resources = resources;
|
this.form.resources = resources;
|
||||||
},
|
},
|
||||||
updateTestResourcePool(updateTestResourcePoolForm) {
|
updateTestResourcePool(updateTestResourcePoolForm) {
|
||||||
if (this.result.loading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$refs[updateTestResourcePoolForm].validate(valid => {
|
this.$refs[updateTestResourcePoolForm].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let vri = this.validateResourceInfo();
|
let vri = this.validateResourceInfo();
|
||||||
|
|
|
@ -336,11 +336,11 @@
|
||||||
rule: {
|
rule: {
|
||||||
id: [
|
id: [
|
||||||
{required: true, message: this.$t('user.input_id'), trigger: 'blur'},
|
{required: true, message: this.$t('user.input_id'), trigger: 'blur'},
|
||||||
{min: 2, max: 20, message: this.$t('commons.input_limit', [2, 20]), trigger: 'blur'}
|
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: this.$t('user.input_name'), trigger: 'blur'},
|
{required: true, message: this.$t('user.input_name'), trigger: 'blur'},
|
||||||
{min: 2, max: 20, message: this.$t('commons.input_limit', [2, 20]), trigger: 'blur'},
|
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
|
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
|
||||||
|
|
|
@ -18,6 +18,8 @@ export default {
|
||||||
let login = function () {
|
let login = function () {
|
||||||
MessageBox.alert(i18n.t('commons.tips'), i18n.t('commons.prompt'), {
|
MessageBox.alert(i18n.t('commons.tips'), i18n.t('commons.prompt'), {
|
||||||
callback: () => {
|
callback: () => {
|
||||||
|
axios.get("/signout");
|
||||||
|
localStorage.setItem('Admin-Token', "{}");
|
||||||
window.location.href = "/login"
|
window.location.href = "/login"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue