mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
member:优化部分变量的命名
This commit is contained in:
@ -24,8 +24,8 @@ public class SocialClientApiImpl implements SocialClientApi {
|
||||
private SocialClientService socialClientService;
|
||||
|
||||
@Override
|
||||
public String getAuthorizeUrl(Integer type, Integer userType, String redirectUri) {
|
||||
return socialClientService.getAuthorizeUrl(type, userType, redirectUri);
|
||||
public String getAuthorizeUrl(Integer socialType, Integer userType, String redirectUri) {
|
||||
return socialClientService.getAuthorizeUrl(socialType, userType, redirectUri);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,8 +33,8 @@ public class SocialUserApiImpl implements SocialUserApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocialUserRespDTO getSocialUser(Integer userType, Integer type, String code, String state) {
|
||||
return socialUserService.getSocialUser(userType, type, code, state);
|
||||
public SocialUserRespDTO getSocialUser(Integer userType, Integer socialType, String code, String state) {
|
||||
return socialUserService.getSocialUser(userType, socialType, code, state);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -148,7 +148,8 @@ public class AuthController {
|
||||
})
|
||||
public CommonResult<String> socialLogin(@RequestParam("type") Integer type,
|
||||
@RequestParam("redirectUri") String redirectUri) {
|
||||
return success(socialClientService.getAuthorizeUrl(type, UserTypeEnum.ADMIN.getValue(), redirectUri));
|
||||
return success(socialClientService.getAuthorizeUrl(
|
||||
type, UserTypeEnum.ADMIN.getValue(), redirectUri));
|
||||
}
|
||||
|
||||
@PostMapping("/social-login")
|
||||
|
@ -16,7 +16,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface SocialUserService {
|
||||
|
||||
// TODO @芋艿:需要传递 userType
|
||||
/**
|
||||
* 获得指定用户的社交用户列表
|
||||
*
|
||||
@ -39,10 +38,10 @@ public interface SocialUserService {
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param userType 全局用户类型
|
||||
* @param type 社交平台的类型 {@link SocialTypeEnum}
|
||||
* @param socialType 社交平台的类型 {@link SocialTypeEnum}
|
||||
* @param openid 社交平台的 openid
|
||||
*/
|
||||
void unbindSocialUser(Long userId, Integer userType, Integer type, String openid);
|
||||
void unbindSocialUser(Long userId, Integer userType, Integer socialType, String openid);
|
||||
|
||||
/**
|
||||
* 获得社交用户
|
||||
@ -50,11 +49,11 @@ public interface SocialUserService {
|
||||
* 在认证信息不正确的情况下,也会抛出 {@link ServiceException} 业务异常
|
||||
*
|
||||
* @param userType 用户类型
|
||||
* @param type 社交平台的类型
|
||||
* @param socialType 社交平台的类型
|
||||
* @param code 授权码
|
||||
* @param state state
|
||||
* @return 社交用户
|
||||
*/
|
||||
SocialUserRespDTO getSocialUser(Integer userType, Integer type, String code, String state);
|
||||
SocialUserRespDTO getSocialUser(Integer userType, Integer socialType, String code, String state);
|
||||
|
||||
}
|
||||
|
@ -80,9 +80,9 @@ public class SocialUserServiceImpl implements SocialUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbindSocialUser(Long userId, Integer userType, Integer type, String openid) {
|
||||
public void unbindSocialUser(Long userId, Integer userType, Integer socialType, String openid) {
|
||||
// 获得 openid 对应的 SocialUserDO 社交用户
|
||||
SocialUserDO socialUser = socialUserMapper.selectByTypeAndOpenid(type, openid);
|
||||
SocialUserDO socialUser = socialUserMapper.selectByTypeAndOpenid(socialType, openid);
|
||||
if (socialUser == null) {
|
||||
throw exception(SOCIAL_USER_NOT_FOUND);
|
||||
}
|
||||
@ -92,9 +92,9 @@ public class SocialUserServiceImpl implements SocialUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocialUserRespDTO getSocialUser(Integer userType, Integer type, String code, String state) {
|
||||
public SocialUserRespDTO getSocialUser(Integer userType, Integer socialType, String code, String state) {
|
||||
// 获得社交用户
|
||||
SocialUserDO socialUser = authSocialUser(type, userType, code, state);
|
||||
SocialUserDO socialUser = authSocialUser(socialType, userType, code, state);
|
||||
Assert.notNull(socialUser, "社交用户不能为空");
|
||||
|
||||
// 如果未绑定的社交用户,则无法自动登录,进行报错
|
||||
|
Reference in New Issue
Block a user