Commit 82a129d3 authored by youjie's avatar youjie

no message

parent bdb012bc
......@@ -94,24 +94,42 @@ export default {
getUserProfile() {
//新的获取用户资料
var that = this;
wx.getUserProfile({
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (info) => {
console.log(info);
this.msg = {
Id: 0,
AliasName: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl,
};
that.getUserInfo(info);
},
fail: () => {
uni.showToast({
title: "微信登录授权失败",
icon: "none",
});
},
});
wx.login({
success: res => {
let obj = {
Source: 1,
OpenId: "",
// Name: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// Gender: info.userInfo.gender,
Moblie: "",
SuperiorId: 0,
code: res.code,
}
that.getCode(obj);
},
fail: (err) => {
console.log(err,'=====err');
},
})
// wx.getUserProfile({
// desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
// success: (info) => {
// console.log(info);
// this.msg = {
// Id: 0,
// AliasName: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// };
// that.getUserInfo(info);
// },
// fail: (err) => {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none",
// });
// },
// });
},
getUserInfo(info) {
var that = this;
......@@ -119,7 +137,7 @@ export default {
uni.getProvider({
service: "oauth",
success: function (res) {
if (~res.provider.indexOf("weixin")) {
if (res.provider.indexOf("weixin")) {
uni.login({
provider: "weixin",
success: (res) => {
......
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