qingcheng-xiaochengxu/pages/wodejiedan/wodejiedan.js
2025-05-15 21:01:14 +08:00

87 lines
1.6 KiB
JavaScript

import {url} from '../../request'
const { checkLogin } = require('../../utils/logcheck');
Page({
data: {
items: [null, null, null,null],
},
onLoad(options) {
checkLogin();
},
onReady() {
},
onShow() {
const that = this
wx.getStorage({
key: "logmessage",
success(res) {
const userinfo = res.data.Authorization
wx.request({
url: url + '/project/get/running',
method: 'POST',
data: {
},
header: {
'content-type': 'application/json',
'Authorization': userinfo
},
success(res) {
console.log('登录成功', res);
if(res.data.code==1){
that.setData({
list:res.data.data
})
wx.showToast({
title: '查询成功',
icon: 'success',
duration: 2000
});
}else{
wx.showToast({
title: res.data.message,
icon:"error",
duration:2000
})
}
},
fail(err) {
console.error('请求失败', err);
}
});
}
})
},
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})