Commit b6449fc2 authored by Fred's avatar Fred

公共字段更新

parent 881e04d3
...@@ -20,10 +20,10 @@ public class MyMetaObjectHandler extends MetaObjectHandler { ...@@ -20,10 +20,10 @@ public class MyMetaObjectHandler extends MetaObjectHandler {
// 获取当前时间 // 获取当前时间
Date date = DateUtil.date(); Date date = DateUtil.date();
metaObject.setValue("createBy", ue.getId()); setFieldValByName("createBy", ue.getId(), metaObject);
metaObject.setValue("modifyBy", ue.getId()); setFieldValByName("createTime", date, metaObject);
metaObject.setValue("createTime", date); setFieldValByName("modifyBy", ue.getId(), metaObject);
metaObject.setValue("modifyTime", date); setFieldValByName("modifyTime", date, metaObject);
setFieldValByName("state", 1, metaObject); setFieldValByName("state", 1, metaObject);
} }
...@@ -33,10 +33,8 @@ public class MyMetaObjectHandler extends MetaObjectHandler { ...@@ -33,10 +33,8 @@ public class MyMetaObjectHandler extends MetaObjectHandler {
//获取当前登录用户 //获取当前登录用户
UserEntity ue = new UserEntity(); UserEntity ue = new UserEntity();
ue.setId(1L); ue.setId(1L);
// 获取当前时间
Date date = DateUtil.date(); setFieldValByName("modifyBy", ue.getId(), metaObject);
metaObject.setValue("modifyBy", ue.getId()); setFieldValByName("modifyTime", DateUtil.date(), metaObject);
metaObject.setValue("modifyTime", date);
} }
} }
...@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.govmade.common.utils.Assert;
import com.govmade.common.utils.Constant; import com.govmade.common.utils.Constant;
import com.govmade.common.utils.PageUtils; import com.govmade.common.utils.PageUtils;
import com.govmade.common.utils.R; import com.govmade.common.utils.R;
...@@ -23,6 +22,7 @@ import com.govmade.modules.basic.controller.AbstractController; ...@@ -23,6 +22,7 @@ import com.govmade.modules.basic.controller.AbstractController;
import com.govmade.modules.system.entity.UserEntity; import com.govmade.modules.system.entity.UserEntity;
import com.govmade.modules.system.service.UserService; import com.govmade.modules.system.service.UserService;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -122,7 +122,6 @@ public class UserController extends AbstractController { ...@@ -122,7 +122,6 @@ public class UserController extends AbstractController {
*/ */
@PutMapping("updatePassword") @PutMapping("updatePassword")
public R password(String password, String newPassword) { public R password(String password, String newPassword) {
Assert.isBlank(newPassword, "新密码不为能空");
password = new Sha256Hash(password).toHex(); password = new Sha256Hash(password).toHex();
newPassword = new Sha256Hash(newPassword).toHex(); newPassword = new Sha256Hash(newPassword).toHex();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment