|
|
@ -385,13 +385,13 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
|
|
|
|
if(user==null){
|
|
|
|
if(user==null){
|
|
|
|
throw new BadRequestException("WeChat users do not exist");
|
|
|
|
throw new BadRequestException("WeChat users do not exist");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String unionId = user.getString("unionid");
|
|
|
|
String openId = user.getString("openid");
|
|
|
|
String openId = user.getString("openid");
|
|
|
|
JSONObject account = signInAccountService.clientWechatOneSignIn(openId);
|
|
|
|
JSONObject account = signInAccountService.clientWechatOneSignIn(unionId);
|
|
|
|
if (account == null) {
|
|
|
|
if (account == null) {
|
|
|
|
JSONObject wechatUserInfo = mpClientAppWechatApiProvider.getApi("merchant-app").appUserInfo(openId,user.getString("access_token"));
|
|
|
|
JSONObject wechatUserInfo = mpClientAppWechatApiProvider.getApi("merchant-app").appUserInfo(openId,user.getString("access_token"));
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
String nickName = wechatUserInfo.getString("nickname");
|
|
|
|
String nickName = wechatUserInfo.getString("nickname");
|
|
|
|
String unionId = wechatUserInfo.getString("unionid");
|
|
|
|
|
|
|
|
res.put("bind_status", false);
|
|
|
|
res.put("bind_status", false);
|
|
|
|
res.put("app_openid", openId);
|
|
|
|
res.put("app_openid", openId);
|
|
|
|
res.put("status", "success");
|
|
|
|
res.put("status", "success");
|
|
|
@ -405,7 +405,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager {
|
|
|
|
account = getCurrentClient(statusKey);
|
|
|
|
account = getCurrentClient(statusKey);
|
|
|
|
account.put("sign_key", statusKey);
|
|
|
|
account.put("sign_key", statusKey);
|
|
|
|
result.put("account",account);
|
|
|
|
result.put("account",account);
|
|
|
|
result.put("app_openid", openId);
|
|
|
|
result.put("app_openid", unionId);
|
|
|
|
result.put("bind_status", true);
|
|
|
|
result.put("bind_status", true);
|
|
|
|
result.put("status", "success");
|
|
|
|
result.put("status", "success");
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|