mirror of
https://github.com/LingChair/LingChair-V0.git
synced 2025-12-08 01:55:50 +08:00
chore: 模块化前端js脚本
This commit is contained in:
32
ling_chair_http/manager.js
Normal file
32
ling_chair_http/manager.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* ©2024 满月叶
|
||||
* Github: MoonLeeeaf
|
||||
* 资源类
|
||||
*/
|
||||
|
||||
const viewBinding = NData.mount($("#app").get(0))
|
||||
|
||||
let client
|
||||
|
||||
function setUpClient(server) {
|
||||
if (server && server !== "")
|
||||
client = new io(server, {
|
||||
auth: {
|
||||
name: localStorage.isSignIn === "false" ? null : localStorage.userName
|
||||
}
|
||||
})
|
||||
else
|
||||
client = new io({
|
||||
auth: {
|
||||
name: localStorage.isSignIn === "false" ? null : localStorage.userName
|
||||
}
|
||||
})
|
||||
|
||||
client.on("connect", () => {
|
||||
User.auth()
|
||||
})
|
||||
}
|
||||
|
||||
window.viewBinding = viewBinding
|
||||
window.setUpClient = setUpClient
|
||||
window.client = client
|
||||
Reference in New Issue
Block a user