favicon跟随头像
This commit is contained in:
parent
1884fc6750
commit
0fb2bab1d0
@ -280,7 +280,7 @@ export default class ClientList {
|
|||||||
},
|
},
|
||||||
value: item.name ?? item.id,
|
value: item.name ?? item.id,
|
||||||
type: 'text',
|
type: 'text',
|
||||||
placeholder: '请设置你的名字',
|
placeholder: '请设置你的昵称',
|
||||||
onchange: event => {
|
onchange: event => {
|
||||||
localStorage.setItem('username', event.target.value)
|
localStorage.setItem('username', event.target.value)
|
||||||
window.location.reload() // 简单刷新页面
|
window.location.reload() // 简单刷新页面
|
||||||
|
@ -232,13 +232,20 @@
|
|||||||
// 设置自己的主机名
|
// 设置自己的主机名
|
||||||
const nameInput = document.createElement('input')
|
const nameInput = document.createElement('input')
|
||||||
nameInput.type = 'text'
|
nameInput.type = 'text'
|
||||||
nameInput.placeholder = '请设置你的名字'
|
nameInput.placeholder = '请设置你的昵称'
|
||||||
nameInput.value = name
|
nameInput.value = name
|
||||||
nameInput.onchange = event => {
|
nameInput.onchange = event => {
|
||||||
localStorage.setItem('username', event.target.value)
|
localStorage.setItem('username', event.target.value)
|
||||||
window.location.reload() // 简单刷新页面
|
window.location.reload() // 简单刷新页面
|
||||||
}
|
}
|
||||||
document.body.appendChild(nameInput)
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user