|
|
|
@@ -353,9 +353,15 @@ public class WxUserGrantController extends BaseController { |
|
|
|
WxCUser user = getUser(); |
|
|
|
|
|
|
|
if (user != null) { |
|
|
|
logger.debug(user.toString()); |
|
|
|
|
|
|
|
boolean bFirstNickName = false; |
|
|
|
if(StringUtils.isBlank(user.getNickName())) { |
|
|
|
bFirstNickName = true; |
|
|
|
} |
|
|
|
|
|
|
|
WxMaService wxMaService = getWeappService(user.getAppId()); |
|
|
|
|
|
|
|
logger.debug(user.toString()); |
|
|
|
String session_key = user.getSessionKey(); |
|
|
|
try { |
|
|
|
// 解密用户信息 |
|
|
|
@@ -371,10 +377,13 @@ public class WxUserGrantController extends BaseController { |
|
|
|
user.setLanguage(userInfo.getLanguage()); |
|
|
|
wxCUserService.saveOrUpdate(user); |
|
|
|
|
|
|
|
// 成长值 |
|
|
|
wxScoreRulesService.addScore(EnumScoreType.WECHAT_PERSION, user); |
|
|
|
//增加积分 |
|
|
|
addCredit(user, EnumScoreType.WECHAT_PERSION); |
|
|
|
if(bFirstNickName) { |
|
|
|
// 首次获取昵称 |
|
|
|
// 成长值 |
|
|
|
wxScoreRulesService.addScore(EnumScoreType.WECHAT_PERSION, user); |
|
|
|
//增加积分 |
|
|
|
addCredit(user, EnumScoreType.WECHAT_PERSION); |
|
|
|
} |
|
|
|
|
|
|
|
resultMap.put("openId", user.getOpenId()); |
|
|
|
resultMap.put("unionId", user.getUnionId()); |
|
|
|
@@ -388,7 +397,7 @@ public class WxUserGrantController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.DB_FAIL.getCode(), "解密并保存出错", resultMap); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return new ResultData(ErrorCode.USER_IS_EMPTY); |
|
|
|
return new ResultData(ErrorCode.USER_LOGIN_FAILED); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -416,9 +425,13 @@ public class WxUserGrantController extends BaseController { |
|
|
|
|
|
|
|
WxCUser user = getUser(); |
|
|
|
|
|
|
|
boolean bPhone = false; |
|
|
|
if (user == null) { |
|
|
|
return new ResultData(ErrorCode.USER_IS_EMPTY); |
|
|
|
} |
|
|
|
|
|
|
|
boolean isFirstPhone = false; |
|
|
|
if(StringUtils.isBlank(user.getPhone())) { |
|
|
|
bPhone = true; |
|
|
|
isFirstPhone = true; |
|
|
|
} |
|
|
|
|
|
|
|
WxMaService wxMaService = getWeappService(user.getAppId()); |
|
|
|
@@ -434,7 +447,7 @@ public class WxUserGrantController extends BaseController { |
|
|
|
user.setCountryCode(phoneNoInfo.getCountryCode()); |
|
|
|
wxCUserService.saveOrUpdate(user); |
|
|
|
|
|
|
|
if(bPhone) { |
|
|
|
if(isFirstPhone) { |
|
|
|
// 首次授权, 增加成长值及积分 |
|
|
|
// 成长值 |
|
|
|
user.setScore(wxScoreRulesService.addScore(EnumScoreType.WECHAT_PHONE, user)); |
|
|
|
|