Commit 06ec2364 by 李伟康

Merge branch 'v1.0.7' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.7

2 parents b5f981cf 0eb86439
import { getOssToken } from "@/utils/ossUploadFile/uploadFile.js";
import Queue from "@/utils/Queue.js";
const interval = 6
export default {
onLoad() {},
data() {
......@@ -221,25 +222,29 @@ export default {
polling() {
console.log(this.snapshot.size, "this.snapshot.size");
if (this.snapshot === null) return;
if (this.snapshot.size == 0) {
this.enQueue();
setTimeout(() => {
this.polling();
}, 1000 * 60);
} else {
console.log(this.snapshot, "this.snapshot");
const record = this.snapshot.dequeue();
console.log(record);
this.uploadRecord(record);
}
uni.$isNetWork().then(() => {
if (this.snapshot.size == 0) {
this.enQueue();
this.pollingLater(interval);
} else {
const record = this.snapshot.dequeue();
this.uploadRecord(record);
}
}).catch(() => {
this.pollingLater(interval);
});
},
stopPolling() {
this.snapshot.clear();
this.snapshot = null;
},
pollingLater(interval = 60 * 10) {
setTimeout(() => {
this.polling();
}, interval * 1000);
},
beforeDestroy() {
console.log("stopPolling");
this.stopPolling();
},
}
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!