debug: 钉钉环境自动启用 vConsole
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
yuliang_guo
2026-01-29 17:22:45 +08:00
parent ad969e39d4
commit 34789e582e
3 changed files with 60 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
"marked": "^15.0.12",
"pdfjs-dist": "^4.10.38",
"pinia": "^2.1.7",
"vconsole": "^3.15.1",
"vue": "^3.4.21",
"vue-pdf-embed": "^2.1.3",
"vue-router": "^4.3.0"
@@ -150,6 +151,15 @@
"node": ">=6.0.0"
}
},
"node_modules/@babel/runtime": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
"integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": {
"version": "7.28.4",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz",
@@ -3374,6 +3384,29 @@
"dev": true,
"license": "MIT"
},
"node_modules/copy-text-to-clipboard": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.2.tgz",
"integrity": "sha512-T6SqyLd1iLuqPA90J5N4cTalrtovCySh58iiZDGJ6FGznbclKh4UI+FGacQSgFzwKG77W7XT5gwbVEbd9cIH1A==",
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/core-js": {
"version": "3.48.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.48.0.tgz",
"integrity": "sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==",
"hasInstallScript": true,
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -5945,6 +5978,11 @@
"dev": true,
"license": "MIT"
},
"node_modules/mutation-observer": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/mutation-observer/-/mutation-observer-1.0.3.tgz",
"integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
},
"node_modules/nanoid": {
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
@@ -8211,6 +8249,18 @@
"uuid": "dist/bin/uuid"
}
},
"node_modules/vconsole": {
"version": "3.15.1",
"resolved": "https://registry.npmjs.org/vconsole/-/vconsole-3.15.1.tgz",
"integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.17.2",
"copy-text-to-clipboard": "^3.0.1",
"core-js": "^3.11.0",
"mutation-observer": "^1.0.3"
}
},
"node_modules/vite": {
"version": "5.4.20",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.20.tgz",

View File

@@ -41,6 +41,7 @@
"marked": "^15.0.12",
"pdfjs-dist": "^4.10.38",
"pinia": "^2.1.7",
"vconsole": "^3.15.1",
"vue": "^3.4.21",
"vue-pdf-embed": "^2.1.3",
"vue-router": "^4.3.0"

View File

@@ -8,6 +8,15 @@ import router from './router'
import './style/index.scss'
import { errorHandler, handlePromiseError } from './utils/errorHandler'
// 在钉钉环境中启用 vConsole 调试
const ua = navigator.userAgent.toLowerCase()
if (ua.includes('dingtalk') || ua.includes('aliapp')) {
import('vconsole').then(({ default: VConsole }) => {
new VConsole()
console.log('[vConsole] 已启用(钉钉环境)')
}).catch(e => console.warn('vConsole 加载失败:', e))
}
const app = createApp(App)
// 设置页面标题(优先使用环境变量)