Commit 60e3b96e authored by 俞嘉婷's avatar 俞嘉婷

feat: 免登接口code传入

parent 79a847c0
......@@ -154,10 +154,15 @@ ComponentWithStore({
const data = await store.doImgUpload(base64)
console.info('头像上传后data', data);
if (data) {
await dbLogin({
avatar: data,
});
await this.updateHomeInfo();
wx.login({
success: async (res) => {
await dbLogin({
code: res.code,
avatar: data,
});
await this.updateHomeInfo();
}
});
}
}
})
......@@ -165,10 +170,15 @@ ComponentWithStore({
async onInputChange(e: any) {
const nickName = e.detail.value
if (nickName) {
await dbLogin({
nickname: nickName,
});
await this.updateHomeInfo();
wx.login({
success: async (res) => {
await dbLogin({
code: res.code,
nickname: nickName,
});
await this.updateHomeInfo();
}
});
}
},
getUserProfile() {
......
......@@ -60,12 +60,17 @@ ComponentWithStore({
const data = await store.doImgUpload(base64)
console.info('头像上传后data', data);
if (data) {
await dbLogin({
avatar: data,
});
const { nickName } = this.data.userInfo
this.setData({
"userInfo.avatarUrl": data,
wx.login({
success: async (res) => {
await dbLogin({
code: res.code,
avatar: data,
});
const { nickName } = this.data.userInfo
this.setData({
"userInfo.avatarUrl": data,
})
}
})
}
}
......@@ -74,12 +79,17 @@ ComponentWithStore({
async onInputChange(e: any) {
const nickName = e.detail.value
if (nickName) {
await dbLogin({
nickname: nickName,
});
const { avatarUrl } = this.data.userInfo
this.setData({
"userInfo.nickName": nickName,
wx.login({
success: async (res) => {
await dbLogin({
code: res.code,
nickname: nickName,
});
const { avatarUrl } = this.data.userInfo
this.setData({
"userInfo.nickName": nickName,
})
}
})
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment