Commit b3809c29 by yixinjj

调整日志输出

1 parent a0557323
......@@ -163,7 +163,7 @@ export default {
async uploadSuccess(recordId, filePathOnServer, filePathOnClient, fileName) {
const unlock = await uni.$recordManager.lock()
try {
uni.$logger.local.info(`文件上传成功!!', filePathOnServer-> ${filePathOnServer}, filePathOnClient-> ${filePathOnClient} , fileName-> ${fileName}`)
uni.$logger.local.info(`文件上传完成回调(uploadSuccess)!!', filePathOnServer-> ${filePathOnServer}, filePathOnClient-> ${filePathOnClient} , fileName-> ${fileName}`)
const record = uni.$recordManager.getRecordById(recordId)
if (!record) return uni.$logger.local.info(`未找到接待记录!!`)
this._changeFilePathToServer(record, filePathOnClient, filePathOnServer, fileName)
......@@ -212,7 +212,7 @@ export default {
filePath: filePathOnClient,
complete: function (res) {
// console.log(res)
uni.$logger.local.info(`删除成功!!`)
uni.$logger.local.info(`${filePathOnClient}->删除成功!!`)
}
})
},
......
......@@ -18,10 +18,10 @@ export class Ws {
}
async connect() {
const { code, data, ...o } = await this.login()
if (code == 200) {
this.deviceId = data.device_id
if (code == 200) {
this.deviceId = data.device_id
this.token = data.token
this.ws = io(this.wsAddress, {
this.ws = io(this.wsAddress, {
auth: { token: this.token, deviceId: this.deviceId },
transports: ['websocket'],
timeout: 5000
......@@ -40,10 +40,10 @@ export class Ws {
return new Promise((resolve, reject) => {
uni.request({
url: this.loginAddress,
data: { user, mobile },
data: { user, mobile },
method: 'POST',
dataType: 'json',
success(response) {
dataType: 'json',
success(response) {
resolve(response.data)
},
fail(err) {
......
......@@ -27,7 +27,7 @@ export default class LogsWorker {
if (files.length > 0) {
const file = files.shift()
await this.post(file, deviceId)
this.process(files, deviceId)
setTimeout(() => this.process(files, deviceId), 500)
} else {
this.isUploading = false
}
......@@ -50,7 +50,7 @@ export default class LogsWorker {
resolve()
},
fail: res => {
uni.$logger.local.error(`文件上传失败! res->${serializeIfObject(res)} filePath->${path} .请检查服务端是否有文件被打开`)
uni.$logger.local.error(`文件上传失败! res->${serializeIfObject(res)} filePath->${path} .`)
resolve()
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!