|
@@ -189,7 +189,7 @@ public class UserGatewayImpl implements UserGateway {
|
|
|
// 2 校验当前用户是否已登录
|
|
|
boolean isLogin = StpUtil.isLogin();
|
|
|
if (!isLogin) {
|
|
|
- StpUtil.login(userInfo.getUserId(), DeviceType.WX.getCode());
|
|
|
+ StpUtil.login(RedisCacheConstant.WX_USER_PRE + userInfo.getUserId(), DeviceType.WX.getCode());
|
|
|
|
|
|
// 这里可以考虑 在session 中插入信息
|
|
|
// 同账户多设备 登录共享信息
|
|
@@ -290,7 +290,7 @@ public class UserGatewayImpl implements UserGateway {
|
|
|
redisService.del(redisKey);
|
|
|
|
|
|
// 登录
|
|
|
- StpUtil.login(String.valueOf(user.getUserId()));
|
|
|
+ StpUtil.login(RedisCacheConstant.WX_USER_PRE + user.getUserId(), DeviceType.WX.getCode());
|
|
|
SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
|
|
|
|
|
|
// 构造返回对象
|
|
@@ -333,7 +333,9 @@ public class UserGatewayImpl implements UserGateway {
|
|
|
HttpEntity<String> request = new HttpEntity<>(param.toJSONString(), headers);
|
|
|
|
|
|
// 发起请求
|
|
|
+ log.info("小程序获取电话号码,调用微信后台 url:{}, request:{}", url, request);
|
|
|
String response = restTemplate.postForObject(url, request, String.class);
|
|
|
+ log.info("小程序获取电话号码,调用微信后台 response:{}", response);
|
|
|
JSONObject json = JSONObject.parseObject(response);
|
|
|
|
|
|
// 判断微信返回是否成功
|
|
@@ -569,7 +571,7 @@ public class UserGatewayImpl implements UserGateway {
|
|
|
}
|
|
|
|
|
|
if (!StpUtil.isLogin()) {
|
|
|
- StpUtil.login(userInfo.getUserId(), DeviceType.WX.getCode());
|
|
|
+ StpUtil.login(RedisCacheConstant.WX_USER_PRE + userInfo.getUserId(), DeviceType.WX.getCode());
|
|
|
}
|
|
|
}
|
|
|
|