fix: bug 修复 #20

Merged
yinkang merged 1 commits from yink into dev 2025-07-10 02:49:10 +00:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 6e0322e2c7 - Show all commits

View File

@ -993,6 +993,7 @@ html[theme-mode='dark'] {
outline: none;
.tiptap.ProseMirror{
height: 100%;
white-space: pre-wrap;
}
.image-upload-loading {
position: relative;

View File

@ -52,14 +52,14 @@ export function throttle(fn, delay, call = function () {}) {
* @param {String} text 复制内容
* @param {Function} callback 复制成功回调方法
*/
export function clipboard(text, callback) {
export async function clipboard(text, callback) {
// 在wujie环境下使用主应用的clipboard
const clipboardObj = window.__POWERED_BY_WUJIE__
? window.parent.navigator.clipboard
: navigator.clipboard
try {
clipboardObj
?.writeText(text)
.writeText(text)
.then(() => {
callback && callback()
})
@ -68,7 +68,7 @@ export function clipboard(text, callback) {
})
} catch (e) {
console.error(e)
toClipboard(text)
await toClipboard(text)
callback && callback()
}
}