mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 03:49:37 +08:00
描述:获取个人信息
This commit is contained in:
parent
29b2690d55
commit
939bd28997
@ -11,3 +11,11 @@ export function userProfile(id) {
|
||||
});
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export function getUserInfoRq(id) {
|
||||
return request({
|
||||
url: '/wx/getUserInfo?userId=' + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,8 @@ import {
|
||||
} from "../../api/common/scan.js"
|
||||
|
||||
import {
|
||||
userProfile
|
||||
userProfile,
|
||||
getUserInfoRq
|
||||
} from "../../api/user/user.js"
|
||||
|
||||
import {
|
||||
@ -157,7 +158,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
console.log('onLoad options' , options);
|
||||
console.log('onLoad options', options);
|
||||
|
||||
let _this = this;
|
||||
// 轮播图
|
||||
@ -189,10 +190,15 @@ Page({
|
||||
let _this = this
|
||||
let userId = wx.getStorageSync('userId');
|
||||
if (userId) {
|
||||
userProfile(userId).then(res => {
|
||||
console.log('userProfile', res);
|
||||
getUserInfoRq(userId).then(res => {
|
||||
console.log('getUserInfoRq', res);
|
||||
let userDetail = res.data;
|
||||
// 存储用户信息
|
||||
wx.setStorageSync('openid', userDetail.openid)
|
||||
wx.setStorageSync('user', userDetail)
|
||||
wx.setStorageSync('userId', userDetail.id)
|
||||
_this.setData({
|
||||
userDetail: res.data
|
||||
userDetail
|
||||
})
|
||||
})
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user