diff --git a/.drone.yml b/.drone.yml index 8cc0a8c..65b3d1f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,8 +9,8 @@ steps: - name: node_modules_cache path: /drone/src/node_modules commands: - - pwd - node -v + - npm -v - ls -al - npm config set registry https://registry.npmmirror.com/ - npm i diff --git a/src/components/canvas/Canvas.ts b/src/components/canvas/Canvas.ts index 4f1615f..52c0cd6 100644 --- a/src/components/canvas/Canvas.ts +++ b/src/components/canvas/Canvas.ts @@ -150,8 +150,8 @@ class MiCanvas { } catch (e) { try { return this.canvas.toDataURL(); - } catch (err) { - console.error(err.message); + } catch (err: any) { + console.error(err?.message); return ''; } } diff --git a/src/utils/config.ts b/src/utils/config.ts index 538a8a2..d8d2a3e 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -44,7 +44,7 @@ class MiConfig { public mobile = false; /** 是否为触摸屏 */ - public supportsTouch = ('ontouchstart' in window) || navigator.msMaxTouchPoints; + public supportsTouch = ('ontouchstart' in window) || navigator?.maxTouchPoints; /** 通用正则 */ public reg: {[index: string]: any} = { diff --git a/src/views/canvas/Index.vue b/src/views/canvas/Index.vue index 81d5aa8..e32baf3 100644 --- a/src/views/canvas/Index.vue +++ b/src/views/canvas/Index.vue @@ -394,7 +394,7 @@ if (elem) elem.remove(); }; if (Text.data && Text.data.content) { - return new Promise((resolve) => { + return new Promise((resolve: any) => { Text.rendering( Text.data as MiTextConfig, true,