dengschoo / vxsocialminprogram Goto Github PK
View Code? Open in Web Editor NEW交友微信小程序
交友微信小程序
大佬,你好!我是一名学生,可以一份完整版的吗?我把上面那个运行后才发现是有一大部分功能是缺陷的,当然如果需要支付点代价,我也是能接受的,毕竟知识是财富。
如果您同意分享
可否联系一下我QQ390477024
可否发到我的QQ邮箱:[email protected]
感激不尽
2021.4.13微信授权登录部分的open-type开放数据
只能够获得open_id了 以及匿名信息
所以接口的获取需要重新写一下
做一下事件绑定
index.wxml
`
{{btninfo}}
`
通过handleUserInfo获取openid 和原先的步骤一样
但是只需要加入到全局变量中就可以
最后获取授权登录的方式
`
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
console.log('openid:'+app.globalData['openid'])
wx.getUserProfile({
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
console.log(res)
app.globalData['userPhoto'] = res.userInfo.avatarUrl;
app.globalData['nickName'] = res.userInfo.nickName;
app.globalData['gender'] = res.userInfo.gender;
wx.setStorageSync('userinfo', res.userInfo);
db.collection('users').where({
_openid : app.globalData['openid']
}).get().then((res)=>{
if (res.data.length == 0) {
wx.reLaunch({
url: '../register/register',
});
return
} else
{
if (this.data.userinfo.length != 0) {
app.globalData["permission"] = true
}
if (app.globalData["permission"] == true) {
app.userInfo = Object.assign(app.userInfo, res.data[0]);
wx.reLaunch({
url: '../index/index',
})
return;
}
this.setData({
Img:app.globalData['userPhoto'],
btninfo:app.globalData['nickName'] + " 现在开始",
//permission:true
})
app.globalData["permission"] = true
}
})
},
fail: res => {
//拒绝授权
wx.showToast({
title: '您拒绝了授权',
icon: 'none'
})
return;
}
})
},
`
Q1: 关于授权登录的方式 是否还有其他解决办法
目前通过调用两个函数 执行顺序无法控制,是否能在一个函数中解决上述问题
你好,对你的项目很感兴趣,是否有启动的说明文档能协助我启动这个项目 谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.