Commit cf507444 by xiexiaoqin

fix: add err message and fix backtotoday

parent 7a94b60d
......@@ -28,10 +28,11 @@ export default function xFetch({ url, method, data, type }) {
}
},
fail: function (err) {
console.log('err', JSON.stringify(err))
if (err && err.status == 401) {
login();
}
alertOnce('网络异常,请重试', rejects);
alertOnce((err && err.errorMsg) || '网络异常,请重试', rejects);
}
});
});
......
......@@ -154,15 +154,6 @@ create.Page({
endTime: "2025-12-30 23:59:59"
}).then(res => {
//只修改sign, 防止30S后刷新页面
if (onlyChangeSign) {
console.log('只修改sign')
this.setData({
sign: res.data.data.sign
})
return
}
//第一次加载
if (this.isFirstLoad && !this.isLoaded) {
console.log('第一次加载')
......@@ -177,9 +168,23 @@ create.Page({
loading: false
});
this.isLoaded = true;
this.backToToday('first')
return;
}
//只修改sign, 防止30S后刷新页面
if (onlyChangeSign) {
console.log('只修改sign')
this.setData({
sign: res.data.data.sign
})
if (this.isFirstLoad) {
this.backToToday('first')
this.isFirstLoad = false;
}
return
}
//是否刷新页面
if (res.data.data.sign !== this.data.sign) {
console.log('刷新页面')
......@@ -194,10 +199,10 @@ create.Page({
sign: res.data.data.sign
});
}
}).catch(err => {
if (err && err.refresh) {
this.setData({
loading: false,
refresh: true
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment