Feat(页面):监听页面打开次数和页面停留时长接口对接

This commit is contained in:
lifizer
2024-06-13 18:09:35 +08:00
parent 51bc828dc9
commit 344e0aa888
8 changed files with 131 additions and 36 deletions
+16 -9
View File
@@ -18,13 +18,18 @@ fly.interceptors.response.use(
console.log('————————')
handleLoginFailure();
return Promise.reject({msg: "未登录", toLogin: true});
}
if (error.status == 401) {
} else if (error.status == 401) {
console.log('————————')
console.log('登录失效 401', error)
console.log('————————')
handleLoginFailure();
return Promise.reject({msg: "未登录", toLogin: true});
} else {
uni.showToast({
title: '服务开小差了,请稍后再试',
icon: 'none',
duration: 3000
})
}
return Promise.reject(error);
}
@@ -61,13 +66,15 @@ function baseRequest(options) {
} else if (data.status === 200) {
return Promise.resolve(data, res);
} else {
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 3000,
success() {
}
})
if (url.indexOf('api/systemStats/push') < 0) {
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 3000,
success() {
}
})
}
return Promise.reject({msg: res.data.msg, res, data});
}
});