mirror of https://gitee.com/xiaonuobase/snowy
【更新】日志记录和自动插入创建人、修改人时,若获取不到B端用户,则获取C端用户,兼容B、C端日志记录和数据记录
parent
87145eebca
commit
2616c755ba
|
@ -46,7 +46,10 @@ import org.aspectj.lang.annotation.Pointcut;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import vip.xiaonuo.auth.core.pojo.SaBaseClientLoginUser;
|
||||||
import vip.xiaonuo.auth.core.pojo.SaBaseLoginUser;
|
import vip.xiaonuo.auth.core.pojo.SaBaseLoginUser;
|
||||||
|
import vip.xiaonuo.auth.core.util.StpClientLoginUserUtil;
|
||||||
|
import vip.xiaonuo.auth.core.util.StpClientUtil;
|
||||||
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
||||||
import vip.xiaonuo.common.annotation.CommonLog;
|
import vip.xiaonuo.common.annotation.CommonLog;
|
||||||
import vip.xiaonuo.dev.modular.log.util.DevLogUtil;
|
import vip.xiaonuo.dev.modular.log.util.DevLogUtil;
|
||||||
|
@ -90,6 +93,11 @@ public class DevLogAop {
|
||||||
SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
||||||
if(ObjectUtil.isNotNull(loginUser)) {
|
if(ObjectUtil.isNotNull(loginUser)) {
|
||||||
userName = loginUser.getName();
|
userName = loginUser.getName();
|
||||||
|
} else {
|
||||||
|
SaBaseClientLoginUser clientLoginUser = StpClientLoginUserUtil.getClientLoginUser();
|
||||||
|
if(ObjectUtil.isNotNull(clientLoginUser)) {
|
||||||
|
userName = clientLoginUser.getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
@ -113,6 +121,11 @@ public class DevLogAop {
|
||||||
SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
||||||
if(ObjectUtil.isNotNull(loginUser)) {
|
if(ObjectUtil.isNotNull(loginUser)) {
|
||||||
userName = loginUser.getName();
|
userName = loginUser.getName();
|
||||||
|
} else {
|
||||||
|
SaBaseClientLoginUser clientLoginUser = StpClientLoginUserUtil.getClientLoginUser();
|
||||||
|
if(ObjectUtil.isNotNull(clientLoginUser)) {
|
||||||
|
userName = clientLoginUser.getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,12 +607,16 @@ public class GlobalConfigure implements WebMvcConfigurer {
|
||||||
if (ObjectUtil.isNotEmpty(loginId)) {
|
if (ObjectUtil.isNotEmpty(loginId)) {
|
||||||
return loginId;
|
return loginId;
|
||||||
} else {
|
} else {
|
||||||
return "-1";
|
String clientLoginId = StpClientUtil.getLoginIdAsString();
|
||||||
|
if (ObjectUtil.isNotEmpty(clientLoginId)) {
|
||||||
|
return clientLoginId;
|
||||||
|
} else {
|
||||||
|
return "-1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return "-1";
|
return "-1";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue