fix: 用户管理删除组织会闪现0(null)

This commit is contained in:
fit2cloud-chenyw 2021-06-24 18:34:05 +08:00
parent 99bd4727ed
commit 256c0efe6b
4 changed files with 6 additions and 3 deletions

View File

@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
@ -117,6 +118,7 @@ public class SysUserService {
user.setUpdateTime(now);
deleteUserRoles(user.getUserId());//先删除用户角色关联
saveUserRoles(user.getUserId(), request.getRoleIds());//再插入角色关联
if (ObjectUtils.isEmpty(user.getDeptId())) user.setDeptId(0L);
return sysUserMapper.updateByPrimaryKeySelective(user);
}

View File

@ -106,7 +106,7 @@ export default {
const { meta, path } = route
// if set path, the sidebar will highlight the path you set
if (meta.activeMenu) {
return meta.activeMenu
// return meta.activeMenu
}
//
if (path === '/panel') {

View File

@ -5,7 +5,8 @@
<div class="span-header">
<div class="bi-text">
{{ $t('pblink.key_pwd') }}
<span style="text-align: center;">{{ $t('pblink.key_pwd') }}
</span>
</div>
</div>

View File

@ -288,7 +288,7 @@ export default {
save() {
this.$refs.createUserForm.validate(valid => {
if (valid) {
!this.form.deptId && (this.form.deptId = 0)
// !this.form.deptId && (this.form.deptId = 0)
const method = this.formType === 'add' ? addUser : editUser
method(this.form).then(res => {
this.$success(this.$t('commons.save_success'))