Dao切面加入tenantId属性,来自token

This commit is contained in:
ZZ 2021-12-31 14:54:06 +08:00
parent ae7f95db44
commit 883b1730c9
2 changed files with 16 additions and 10 deletions

View File

@ -120,9 +120,7 @@ public class UserDaoAspect {
BeanUtils.setProperty(arg, UPDATE_TIME, date); BeanUtils.setProperty(arg, UPDATE_TIME, date);
} }
if (isProperty(arg, TENANT_ID) && StringUtils.isEmpty(BeanUtils.getProperty(arg, TENANT_ID))) { BeanUtils.setProperty(arg, TENANT_ID, loginUser.getTenantId());
BeanUtils.setProperty(arg, TENANT_ID, date);
}
} }
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -50,6 +50,9 @@
<if test="null != avatar and '' != avatar"> <if test="null != avatar and '' != avatar">
avatar, avatar,
</if> </if>
<if test="null != tenantId ">
tenant_id,
</if>
<if test="null != balance and '' != balance"> <if test="null != balance and '' != balance">
balance, balance,
</if> </if>
@ -106,6 +109,9 @@
<if test="null != avatar and '' != avatar"> <if test="null != avatar and '' != avatar">
#{avatar}, #{avatar},
</if> </if>
<if test="null != tenantId and '' != tenantId">
#{tenantId},
</if>
<if test="null != balance and '' != balance"> <if test="null != balance and '' != balance">
#{balance}, #{balance},
</if> </if>
@ -241,6 +247,9 @@
<if test="null != userType "> <if test="null != userType ">
user_type, user_type,
</if> </if>
<if test="null != tenantId ">
tenant_id,
</if>
<if test="null != openId and '' != openId"> <if test="null != openId and '' != openId">
open_id, open_id,
</if> </if>
@ -295,8 +304,7 @@
</update> </update>
<select id="getUserLoginTime" resultType="map"> <select id="getUserLoginTime" resultType="map">
select select app_user_id as appUserId,
app_user_id as appUserId,
account as account, account as account,
user_type as userType, user_type as userType,
open_id as openId, open_id as openId,