fix[用户中心]:优化登录等录逻辑

This commit is contained in:
2025-02-21 11:56:33 +08:00
parent cdb35876a0
commit 65dd24289b
11 changed files with 87 additions and 48 deletions
@@ -18,15 +18,21 @@ import java.util.Collection;
public class TencentAuthenticationToken extends BaseAuthenticationToken {
public static final AuthorizationGrantType GRANT_TYPE = new AuthorizationGrantType("tencent");
private final Object principal;
private final String encryptedData;
private final String iv;
public TencentAuthenticationToken(String code) {
public TencentAuthenticationToken(String code, String encryptedData, String iv) {
super(GRANT_TYPE);
this.principal = code;
this.encryptedData = encryptedData;
this.iv = iv;
super.setAuthenticated(true);
}
public TencentAuthenticationToken(UserDetails user, Collection<? extends GrantedAuthority> authorities) {
public TencentAuthenticationToken(UserDetails user, Collection<? extends GrantedAuthority> authorities, String encryptedData, String iv) {
super(authorities);
this.principal = user;
this.encryptedData = encryptedData;
this.iv = iv;
}
}
@@ -56,8 +56,8 @@ public interface UserService {
*
* @param openId openId
*/
@GetMapping(value = "/users-anon/wxOpenId", params = "openId")
SysUser findByWxOpenId(@RequestParam("openId") String openId);
@GetMapping(value = "/users-anon/wxOpenId", params = {"openId","mobile"})
SysUser findByWxOpenId(@RequestParam("openId") String openId, @RequestParam("mobile") String mobile);
/**
@@ -3,8 +3,8 @@ package com.central.common.feign.fallback;
import com.central.common.feign.UserService;
import com.central.common.model.SysRole;
import com.central.common.model.SysUser;
import org.springframework.cloud.openfeign.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import java.util.Collections;
import java.util.List;
@@ -45,7 +45,7 @@ public class UserServiceFallbackFactory implements FallbackFactory<UserService>
}
@Override
public SysUser findByWxOpenId(String openId) {
public SysUser findByWxOpenId(String openId,String mobile) {
log.error("通过wxOpenId查询用户异常:{}", openId, throwable);
return new SysUser();
}