迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產(chǎn)品,以萬端互聯(lián)為設(shè)計理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
有大佬能提供個微信小程序新版接口wx.getUserProfile方法的登錄注冊實例嗎?
我自己用的,可以成功
getUserProfile: function (e) { var self=this; wx.getUserProfile({ desc: '展示用戶信息', // 聲明獲取用戶個人信息后的用途,后續(xù)會展示在彈窗中,請謹慎填寫 success: (file) => { if (file.userInfo) { console.log(file.userInfo) wx.login({ success: (res) => { console.log(file); console.log(file.encryptedData); wx.request({ url: app.globalData.http_api + "s=weixin&c=member&m=xcx", method: 'post', header: { 'Content-Type': 'application/x-www-form-urlencoded', }, data: { nickname:file.userInfo.nickName, avatar:file.userInfo.avatarUrl, js_code: res.code, json:file.rawData }, success: (open) => { console.log(open.data); if (open.data.code) { if (open.data.msg == 'login') { // 登錄成功 console.log("登錄成功了"); wx.setStorageSync('member_uid', open.data.data.member.id); wx.setStorageSync('member_auth', open.data.data.auth); wx.setStorageSync('member', open.data.data.member); wx.setStorageSync('member_oauth', file.userInfo); console.log(open.data.data.avatar); wx.showToast({ title: "登錄成功", icon: 'success', success: function () { wx.reLaunch({ url: "/pages/member/index" }); } }) } else { // 綁定賬號注冊 wx.setStorageSync('oauth', ress.data.data); wx.showActionSheet({ itemList: ['綁定已有賬號', '注冊新賬號'], success: function (res) { if (res.tapIndex == 1) { wx.navigateTo({ url: "../login/register" }); } else { wx.navigateTo({ url: "../login/bang" }); } }, fail: function (res) { console.log(res.errMsg) } }) // } } else { // 失敗了 wx.showModal({ showCancel: false, content: open.data.msg }) } } }) } }) } } }) },
我自己用的,可以成功