From 005e7df1b8d7733b459c24104bc775c52e528454 Mon Sep 17 00:00:00 2001 From: thiszhc <2029364173@qq.com> Date: 星期四, 15 六月 2023 19:30:17 +0800 Subject: [PATCH] 优化第三方授权登录 --- ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SocialUserMapper.xml | 58 +++++++--------------------------------------------------- 1 files changed, 7 insertions(+), 51 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SocialUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SocialUserMapper.xml index fb636b1..0c50ee6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SocialUserMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SocialUserMapper.xml @@ -8,61 +8,17 @@ <id property="id" column="id"/> </resultMap> - <sql id="selectSocialUser"> - select id, - user_id, - tenant_id, - auth_id, - source, - open_id, - access_token, - expire_in, - refresh_token, - access_code, - union_id, - scope, - token_type, - id_token, - mac_algorithm, - mac_key, - code, - oauth_token, - oauth_token_secret, - create_dept, - create_by, - create_time, - update_by, - update_time - from social_user - </sql> - - <!-- 鏍规嵁userId鏌ヨSocialUser琛ㄥ搴攗serId鐨凷ysUser锛岃繑鍥濻ysUserBo鐨勫璞� --> - <select id="selectSocialUserByUserId" parameterType="String" resultMap="SocialUserAuthResult"> - select b.* - from social_user a - left join sys_user b on a.user_id = b.user_id - where a.user_id = #{userId} - </select> - - <!-- 鏍规嵁authId鏌ヨSocialUser琛ㄥ拰SysUser琛紝杩斿洖SocialUserAuthResult鏄犲皠鐨勫璞� --> <select id="selectSocialUserByAuthId" parameterType="String" resultMap="SocialUserAuthResult"> - select b.user_id as userId, - b.tenant_id as tenantId, - b.user_name as userName, - b.password as password, - a.auth_id as authId, - a.source as source + select b.user_id, + b.tenant_id, + b.user_name, + b.password, + a.auth_id, + a.source from social_user a - left join sys_user b on a.user_id = b.user_id + left join sys_user b on a.user_id = b.user_id where a.auth_id = #{authId} - </select> - - <!-- 鏍规嵁userId鍜宻ource鏌ヨSocialUser琛紝杩斿洖int绫诲瀷鐨勭粨鏋� --> - <select id="checkSocialUser" parameterType="org.dromara.system.domain.vo.SocialUserVo" resultType="int"> - select count(*) - from social_user - where user_id = #{userId} and source = #{source} limit 1 </select> </mapper> -- Gitblit v1.9.3