毕设-dev-first

This commit is contained in:
2025-08-19 13:41:17 +08:00
parent 3dc4d64215
commit 4807d0547b
13 changed files with 322 additions and 471 deletions

View File

@ -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({