diff --git a/src/org/wanxp/utils/Logutil.ts b/src/org/wanxp/utils/Logutil.ts index a5d076a..dab9146 100644 --- a/src/org/wanxp/utils/Logutil.ts +++ b/src/org/wanxp/utils/Logutil.ts @@ -36,7 +36,8 @@ export default class Logger { console.error(e); }else { try { - console.log(`OB-Douban:${moment(new Date()).format('YYYY-MM-DD HH:mm:SS')}:${typeof e == 'string' ? e : JSON.stringify(e)}`); + let showMessage = typeof e == 'string' ? e : e.toString(); + console.log(`OB-Douban:${moment(new Date()).format('YYYY-MM-DD HH:mm:SS')}: ${showMessage}`); }catch (e) { console.log(`OB-Douban:${moment(new Date()).format('YYYY-MM-DD HH:mm:SS')}:` + e.toString()); } diff --git a/src/org/wanxp/utils/model/HttpResponse.ts b/src/org/wanxp/utils/model/HttpResponse.ts index d0ae6d6..7d31080 100644 --- a/src/org/wanxp/utils/model/HttpResponse.ts +++ b/src/org/wanxp/utils/model/HttpResponse.ts @@ -1,3 +1,5 @@ +import {Platform} from "obsidian"; + export class HttpResponse { private readonly _status:number; private readonly _headers:Record; @@ -32,8 +34,10 @@ export class HttpResponse { } get textArrayBuffer():ArrayBuffer { - if (this.text instanceof Buffer) { - return this.text as Buffer; + if (Platform.isDesktopApp) { + if (this.text instanceof Buffer) { + return this.text as Buffer; + } } if (this.text instanceof ArrayBuffer) { return this.text as ArrayBuffer;