|
@@ -68,20 +68,22 @@ Page({
|
|
|
* 获取用户信息
|
|
|
*/
|
|
|
getUserProfile() {
|
|
|
- var that = this;
|
|
|
- wx.getUserProfile({
|
|
|
- desc:"授权信息",
|
|
|
- success:function(res){
|
|
|
- if(res.userInfo){
|
|
|
- that.setData({
|
|
|
- name:res.userInfo.nickName,
|
|
|
- avatarUrl:res.userInfo.avatarUrl,
|
|
|
- pageLogin: true
|
|
|
- })
|
|
|
- app.globalData.userInfo.login = true
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
+ if (this.data.avatarUrl == '') {
|
|
|
+ var that = this;
|
|
|
+ wx.getUserProfile({
|
|
|
+ desc:"授权信息",
|
|
|
+ success:function(res){
|
|
|
+ if(res.userInfo){
|
|
|
+ that.setData({
|
|
|
+ name:res.userInfo.nickName,
|
|
|
+ avatarUrl:res.userInfo.avatarUrl,
|
|
|
+ pageLogin: true
|
|
|
+ })
|
|
|
+ app.globalData.userInfo.login = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|