Commit 82a129d3 authored by youjie's avatar youjie

no message

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