chore: 模块化前端js脚本

This commit is contained in:
MoonLeeeaf
2024-05-31 00:08:55 +08:00
parent 6654141c18
commit b2c8c86689
6 changed files with 727 additions and 680 deletions

View 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