From 7c22c914adbb9541a0a38d81993f3e0a616b78f4 Mon Sep 17 00:00:00 2001 From: lyd <1419499670@qq.com> Date: Wed, 16 Nov 2022 18:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/modules/system/rest/UserController.java | 6 +++++- mes/qd/src/views/system/user/index.vue | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/modules/system/rest/UserController.java b/mes/hd/nladmin-system/src/main/java/org/nl/modules/system/rest/UserController.java index af923631..aafb773b 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/modules/system/rest/UserController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/modules/system/rest/UserController.java @@ -16,6 +16,7 @@ package org.nl.modules.system.rest; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -110,7 +111,10 @@ public class UserController { public ResponseEntity create(@Validated @RequestBody User resources){ checkLevel(resources); // 默认密码 123456 - resources.setPassword(passwordEncoder.encode("123456")); + if (ObjectUtil.isEmpty(resources.getPassword())) + resources.setPassword(passwordEncoder.encode("123456")); + else + resources.setPassword(passwordEncoder.encode(resources.getPassword())); userService.create(resources); return new ResponseEntity<>(HttpStatus.CREATED); } diff --git a/mes/qd/src/views/system/user/index.vue b/mes/qd/src/views/system/user/index.vue index 3f5bb844..b7ab01cd 100644 --- a/mes/qd/src/views/system/user/index.vue +++ b/mes/qd/src/views/system/user/index.vue @@ -147,7 +147,7 @@ /> - + @@ -167,7 +167,7 @@ - + @@ -297,6 +297,9 @@ export default { ], phone: [ { required: true, trigger: 'blur', validator: validPhone } + ], + password: [ + { max: 20, message: '长度最多 20 个字符', trigger: 'change' } ] } } @@ -354,6 +357,9 @@ export default { this.jobDatas = [] this.roleDatas = [] }, + [CRUD.HOOK.afterRefresh]() { + console.log(this.crud.data) + }, // 初始化编辑时候的角色与岗位 [CRUD.HOOK.beforeToEdit](crud, form) { this.getJobs(this.form.dept.id)