|
@@ -23,8 +23,28 @@ export const wxRequest = (url,data) => {
|
|
|
if (response.statusCode !== 200) {
|
|
|
reject(response.data.msg || '请求错误')
|
|
|
} else {
|
|
|
- if (response.data.code !== '000') {
|
|
|
+ if (response.data.code !== '000' && response.data.code !== '102') {
|
|
|
reject(response.data.msg || '请求错误')
|
|
|
+ } else if (response.data.code == '102') {
|
|
|
+ wx.hideLoading()
|
|
|
+ // 重新登录
|
|
|
+ wx.showModal({
|
|
|
+ content: response.data.msg,
|
|
|
+ confirmColor: '#333',
|
|
|
+ showCancel: false,
|
|
|
+ success (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ app.globalData.userInfo.login = false
|
|
|
+ app.globalData.accessToken = ''
|
|
|
+ app.globalData.userInfo.headImg= ''
|
|
|
+ app.globalData.userInfo.userName = ''
|
|
|
+ app.globalData.userInfo.phoneNumber = ''
|
|
|
+ wx.reLaunch({
|
|
|
+ url: '/pages/my/my',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
resolve(response.data)
|
|
|
}
|