From 05c74ca131add20dbcf23dc109e63c21b3e2be29 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 24 Feb 2021 18:11:57 +0800
Subject: [PATCH] Merge branch 'whole_new_trc20' into whole_new
---
src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java b/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
index b60a5a3..5e69b7a 100644
--- a/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
+++ b/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
@@ -27,10 +27,7 @@
@Override
public Object intercept(Invocation invocation) throws Throwable {
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
- String sqlId = mappedStatement.getId();
- log.info("----sqlId----" + sqlId);
SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
- log.info("-------------->{}", sqlCommandType);
Object parameter = invocation.getArgs()[1];
if (parameter == null) {
@@ -75,12 +72,13 @@
}
public void injectForInsert(Object o) {
- MemberEntity member = LoginUserUtils.getAppLoginUser();
+ MemberEntity member = LoginUserUtils.getUser();
if (o instanceof BaseEntity) {
BaseEntity baseEntity = (BaseEntity) o;
if (member != null) {
- baseEntity.setCreateBy(member.getUsername());
- baseEntity.setUpdateBy(member.getUsername());
+ String by = member.getPhone() != null ? member.getPhone() : member.getEmail();
+ baseEntity.setCreateBy(by);
+ baseEntity.setUpdateBy(by);
} else {
baseEntity.setCreateBy(AppContants.SYSTEM_USER);
baseEntity.setUpdateBy(AppContants.SYSTEM_USER);
@@ -91,11 +89,12 @@
}
public void injectForUpdate(Object o) {
- MemberEntity member = LoginUserUtils.getAppLoginUser();
+ MemberEntity member = LoginUserUtils.getUser();
if (o instanceof BaseEntity) {
BaseEntity baseEntity = (BaseEntity) o;
if (member != null) {
- baseEntity.setUpdateBy(member.getUsername());
+ String by = member.getPhone() != null ? member.getPhone() : member.getEmail();
+ baseEntity.setUpdateBy(by);
} else {
baseEntity.setUpdateBy(AppContants.SYSTEM_USER);
}
--
Gitblit v1.9.1