毕设-dev-first
This commit is contained in:
@ -12,12 +12,40 @@ Page({
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.fetchSupervisorInfo();
|
||||
onLoad() {
|
||||
const role = wx.getStorageSync('role')
|
||||
if (role === 'manager') {
|
||||
this.getManagerInfo();
|
||||
} else {
|
||||
this.fetchSupervisorInfo();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 请求后端接口,获取上级联系人信息
|
||||
*/
|
||||
|
||||
getManagerInfo() {
|
||||
const token = wx.getStorageSync('token')
|
||||
wx.request({
|
||||
url: baseUrl + '/userInfo/get/jwt',
|
||||
method: 'GET',
|
||||
header: {
|
||||
Authorization: token
|
||||
},
|
||||
success: res => {
|
||||
console.log('用户信息---->',res.data);
|
||||
if (res.data.code === 1) {
|
||||
let result = res.data.data
|
||||
this.setData({
|
||||
nickName: result.nickName,
|
||||
phoneNumber: result.phoneNumber
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
fetchSupervisorInfo() {
|
||||
const token = wx.getStorageSync('token');
|
||||
wx.request({
|
||||
|
Reference in New Issue
Block a user