融合微信登录
This commit is contained in:
@@ -105,6 +105,15 @@ public class WxLoginController extends BaseController {
|
||||
User user = userService.getByPhone(phone);
|
||||
// 不存在则注册
|
||||
if (user == null) {
|
||||
if ((userParam.getOpenid() == null || userParam.getOpenid().isEmpty()) && userParam.getAuthCode() != null) {
|
||||
UserParam userParam2 = new UserParam();
|
||||
userParam2.setCode(userParam.getAuthCode());
|
||||
JSONObject result = getOpenIdByCode(userParam2);
|
||||
System.out.println("userInfo res:" + result);
|
||||
String openid = result.getString("openid");
|
||||
// String unionid = result.getString("unionid");
|
||||
userParam.setOpenid(openid);
|
||||
}
|
||||
userParam.setPhone(phone);
|
||||
user = addUser(userParam);
|
||||
user.setRecommend(1);
|
||||
|
||||
Reference in New Issue
Block a user