Browse Source

删除user/index.js无用声明周期;修改请求库中,错误提醒。

master
lqq 6 years ago
parent
commit
3722408864
  1. 48
      pages/user/index.js
  2. 4
      utils/http.js

48
pages/user/index.js

@ -108,52 +108,4 @@ Page({
// }) // })
// } // }
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })

4
utils/http.js

@ -55,7 +55,7 @@ class HTTP {
} else { } else {
console.log('数据请求失败') console.log('数据请求失败')
wx.showToast({ wx.showToast({
title: res.data.message, title: res.data.message || '服务器错误,请稍后重试',
icon: 'none' icon: 'none'
}) })
} }
@ -70,7 +70,7 @@ class HTTP {
}, },
fail: function (res) { fail: function (res) {
wx.showToast({ wx.showToast({
title: '网络连接错误,请求失败!', title: '网络连接错误,请求稍后重试!',
icon: 'none' icon: 'none'
}) })
params.fail && params.fail(res) params.fail && params.fail(res)

Loading…
Cancel
Save