websocket消息支持 (#188)
* Release (#162) * feat: ✨ websocket server demo * feat: ✨ ws server demo dev * feat: ✨ ws server and mobile page * feat: ✨ 手机端发送消息 * feat: ✨ 手机网页发送消息 * 添加了抽奖中和抽奖完成时的音效 * feat: ✨ 自定义设置弹幕服务器地址 * feat: ✨ ws not done * fix: 🐛 fix pr-185 #185 为播放音效添加控制 * feat: ✨ server worker demo not done * feat: ✨ websocket server * feat: ✨ 全局接收websocket消息并存储到indexdb中 --------- Co-authored-by: Silence@2024 <707261624@qq.com>
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
import FingerprintJS from '@fingerprintjs/fingerprintjs'
|
||||
|
||||
export function getToken() {
|
||||
return window.localStorage.getItem('userToken')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户浏览器唯一标识
|
||||
* @returns {Promise<string>} 唯一标识符
|
||||
*/
|
||||
export async function getUniqueSignature() {
|
||||
const fp = await FingerprintJS.load()
|
||||
const result = await fp.get()
|
||||
return result.visitorId
|
||||
}
|
||||
|
||||
// 获取origin url
|
||||
export function getOriginUrl() {
|
||||
return window.location.origin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user