路径:
https://leancloud.cn/docs/leanstorage_guide-java.html#hash-1198014376
原代码:
// 跳转到输入用户名、密码、手机号等业务页面之后
LCUser avUser = new LCUser();
avUser.setUsername("Tom");
avUser.setMobilePhoneNumber("+8618200008888");
avUser.loginWithAuthData(thirdPartyData, "weixin").subscribe(new Observer<LCUser>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(LCUser avUser) {
System.out.println("登录成功");
}
@Override
public void onError(Throwable e) {
System.out.println("登录失败:" + e.getMessage());
}
@Override
public void onComplete() {
}
});
问题:
警告(java) 和 报错(kotlin)
avUser.loginWithAuthData(thirdPartyData, "weixin")
idea Java 提示:
Static member 'cn.leancloud.LCUser.loginWithAuthData(java.util.Map, java.lang.String)' accessed via instance reference
idea Kotlin 提示:
None of the following functions can be called with the arguments supplied.
- loginWithAuthData((Mutable)Map!, String!, Boolean) defined in cn.leancloud.LCUser
- loginWithAuthData((Mutable)Map!, String!, String!, String!, Boolean, Boolean) defined in cn.leancloud.LCUser
移除警告(java和kotlin):
将 avUser 修改为 LCUser
LCUser.loginWithAuthData(thirdPartyData, "weixin")
新问题:
此处的avUser是否还有效?
LCUser avUser = new LCUser();
avUser.setUsername("Tom");
avUser.setMobilePhoneNumber("+8618200008888");
LCUser.loginWithAuthData(thirdPartyData, "weixin")