@weakish,不好意思,我还是没明白。我这里没有用邮箱注册的用户,是用户先用手机号加密码注册AV.User.signUpOrlogInWithMobilePhone()
,然后用户在小程序端以手机号+验证码AV.User.logInWithMobilePhoneSmsCode()
的方式登录,真机调试,微信账号的手机号与用户登录的手机号是同一号码。但在调用AV.User.current().associateWithMiniApp()
时还是报错:
qa_new.js:295 associateWithMiniApp() error: A unique field was given a value that is already taken. class:_User, index:authData.lc_weapp.openid_1, duplicate value:{ : "ojPJE5VRdN-WBG_hf5G2KCKL8g9o" } [400 PUT https://api.******.com/1.1/classes/_User/5fab846c7df50b3c5b331079]
******
是我隐去的敏感数据,非报错信息本身内容。
鉴于始终解决不了这个问题,我把代码和App ID以及涉及到的用户objectId贴在这里吧,以便技术人员帮忙分析处理:
adapters.getAuthInfo({
preferUnionId: true,
}).then(authInfoResult => {
console.log('authData: ' + JSON.stringify(AV.User.current().authData)); // TODO: Remove Before Flight!
return AV.User.current().associateWithMiniApp().then(associationResult => {
console.info('associationResult: ' + JSON.stringify(associationResult)); // TODO: Remove Before Flight!
}, error => {
console.error('associateWithMiniApp() error: ' + error.message);
});
});
App ID: ******
User ObjectID: ******