Commit b3809c29 by yixinjj

调整日志输出

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