This commit is contained in:
tangzh 2025-07-31 13:35:41 +08:00
parent 3b60e7448a
commit c6cc09916b

View File

@ -39,6 +39,9 @@ public class WeChatServiceImpl implements WeChatService {
@Value("${weChat.secret}")
private String secret;
@Value("${spring.profiles.active}")
private String active;
@Autowired private QrCodeUtil qrCodeUtil;
@Autowired private BusUserMapper BusUserMapper;
@Autowired private RestTemplateUtils restTemplateUtil;
@ -65,9 +68,13 @@ public class WeChatServiceImpl implements WeChatService {
@Override
public LoginVo authorizeLogin(String code, HttpServletRequest request) {
LoginVo loginVo = new LoginVo();
WeChatMiniAuthorizeVo response = miniAuthCode(code);
// WeChatMiniAuthorizeVo response = new WeChatMiniAuthorizeVo();
// response.setOpenId("123456");
WeChatMiniAuthorizeVo response = null;
if (!active.equals("local")) {
response = miniAuthCode(code);
} else {
response = new WeChatMiniAuthorizeVo();
response.setOpenId("123456");
}
String openId = response.getOpenId();
String type = "login";
BusUser busUser = BusUserMapper.getUserByOpenId(openId);