|
@@ -14,16 +14,28 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
|
|
|
|
|
|
@Override
|
|
|
public void insertFill(MetaObject metaObject) {
|
|
|
+ String userNickName = null;
|
|
|
+ try {
|
|
|
+ userNickName = SecurityUtils.getUserNickName();
|
|
|
+ } catch (Exception e) {
|
|
|
+ userNickName = "system";
|
|
|
+ }
|
|
|
if (metaObject.hasGetter("createBy") && metaObject.hasGetter("updateBy")) {
|
|
|
- setFieldValByName("createBy", SecurityUtils.getUserNickName(), metaObject);
|
|
|
- setFieldValByName("updateBy", SecurityUtils.getUserNickName(), metaObject);
|
|
|
+ setFieldValByName("createBy", userNickName, metaObject);
|
|
|
+ setFieldValByName("updateBy", userNickName, metaObject);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void updateFill(MetaObject metaObject) {
|
|
|
+ String userNickName = null;
|
|
|
+ try {
|
|
|
+ userNickName = SecurityUtils.getUserNickName();
|
|
|
+ } catch (Exception e) {
|
|
|
+ userNickName = "system";
|
|
|
+ }
|
|
|
if (metaObject.hasGetter("updateBy")) {
|
|
|
- setFieldValByName("updateBy", SecurityUtils.getUserNickName(), metaObject);
|
|
|
+ setFieldValByName("updateBy", userNickName, metaObject);
|
|
|
}
|
|
|
}
|
|
|
}
|