Commit d5cb1dc2 by liimin

优化代码逻辑

1 parent fb40ec57
......@@ -40,18 +40,21 @@ export default {
},
methods: {
async init() {
// await this.checkDB()
// 初始化 WebView
this.wv = await this.initWebview()
this.interval = UPLOAD_INTERVAL
// 初始化操作队列
this.operationQueue = new OperationQueue()
this.timeoutManager = new TimeoutManager()
// 开始轮询
this.startPolling()
// uni.$logger.local.error({ extra : { key: 'data', value: {'abc':123,'sss':456,'GDF':888} }, msg:'test', tag : { key: 'tag', value: 'tagtest' } })
// uni.$logger.local.getFiles('20240905','2024-09/05')
// uni.$logger.local.removeOverDays(1)
try {
// 初始化 WebView
this.wv = await this.initWebview()
this.interval = UPLOAD_INTERVAL
// 初始化操作队列
this.operationQueue = new OperationQueue()
this.timeoutManager = new TimeoutManager()
// 开始轮询
this.startPolling()
// uni.$logger.local.error({ extra : { key: 'data', value: {'abc':123,'sss':456,'GDF':888} }, msg:'test', tag : { key: 'tag', value: 'tagtest' } })
// uni.$logger.local.getFiles('20240905','2024-09/05')
// uni.$logger.local.removeOverDays(1)
} catch (error) {
this.reportError(`【上传管理Uploader】初始化失败 error:${error.message}`, error.message)
}
},
/**
* 订阅事件
......@@ -691,7 +694,7 @@ export default {
* 清除 timer
*/
canclePromises() {
this.timeoutManager.cancelAllTasks()
this.timeoutManager?.cancelAllTasks()
this.endTask()
},
off() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!