|
|
@ -185,19 +185,26 @@ function errorCreate(msg: string, hideError: boolean) {
|
|
|
|
// 记录和显示错误
|
|
|
|
// 记录和显示错误
|
|
|
|
function errorLog(error: Error, hideError: boolean) {
|
|
|
|
function errorLog(error: Error, hideError: boolean) {
|
|
|
|
// 打印到控制台
|
|
|
|
// 打印到控制台
|
|
|
|
|
|
|
|
let content;
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
console.error('>>>>>> Error >>>>>>');
|
|
|
|
console.error('>>>>>> Error >>>>>>');
|
|
|
|
console.error(error);
|
|
|
|
console.error(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (error.message) {
|
|
|
|
|
|
|
|
content = error.message;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
content = '网络请求超时';
|
|
|
|
|
|
|
|
}
|
|
|
|
// 显示提示
|
|
|
|
// 显示提示
|
|
|
|
hideError ||
|
|
|
|
hideError ||
|
|
|
|
// uni.showToast({
|
|
|
|
// uni.showToast({
|
|
|
|
// icon: 'none',
|
|
|
|
// icon: 'none',
|
|
|
|
// title: error.message,
|
|
|
|
// title: error.message,
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
uni.showModal({
|
|
|
|
uni.showModal({
|
|
|
|
title: '',
|
|
|
|
title: '',
|
|
|
|
content: error.message,
|
|
|
|
content: content,
|
|
|
|
confirmText: '确定',
|
|
|
|
confirmText: '确定',
|
|
|
|
cancelText: '取消',
|
|
|
|
cancelText: '取消',
|
|
|
|
showCancel: false,
|
|
|
|
showCancel: false,
|
|
|
|