Skip to content

Commit 68a6035

Browse files
authored
feat: auto copy
1 parent d0c114c commit 68a6035

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
credentials: 'include',
3434
})
3535
let json = await re.json()
36-
if (re.ok)
37-
alert(`【喵口令】$&${ json.token }&$`)
38-
else
36+
if (re.ok) {
37+
let text = `【喵口令】$&${ json.token }&$`
38+
navigator.clipboard.writeText(text)
39+
alert('生成完毕, 已自动复制~ (' + text + ')')
40+
} else
3941
alert('错误: ' + JSON.stringify(json))
4042
})()
4143
</script>

0 commit comments

Comments
 (0)