favicon跟随头像
This commit is contained in:
parent
1884fc6750
commit
0fb2bab1d0
@ -280,7 +280,7 @@ export default class ClientList {
|
||||
},
|
||||
value: item.name ?? item.id,
|
||||
type: 'text',
|
||||
placeholder: '请设置你的名字',
|
||||
placeholder: '请设置你的昵称',
|
||||
onchange: event => {
|
||||
localStorage.setItem('username', event.target.value)
|
||||
window.location.reload() // 简单刷新页面
|
||||
|
@ -228,17 +228,24 @@
|
||||
|
||||
// 延迟1500ms
|
||||
//await new Promise((resolve) => setTimeout(resolve, 100))
|
||||
|
||||
|
||||
// 设置自己的主机名
|
||||
const nameInput = document.createElement('input')
|
||||
nameInput.type = 'text'
|
||||
nameInput.placeholder = '请设置你的名字'
|
||||
nameInput.placeholder = '请设置你的昵称'
|
||||
nameInput.value = name
|
||||
nameInput.onchange = event => {
|
||||
localStorage.setItem('username', event.target.value)
|
||||
window.location.reload() // 简单刷新页面
|
||||
}
|
||||
document.body.appendChild(nameInput)
|
||||
|
||||
if (localStorage.getItem('avatar')) {
|
||||
const favicon = document.createElement('link')
|
||||
favicon.rel = 'icon'
|
||||
favicon.href = localStorage.getItem('avatar')
|
||||
document.head.appendChild(favicon)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user