mirror of
https://github.com/LingChair/LingChair-V0.git
synced 2025-12-08 01:55:50 +08:00
chore: 重构, 日志函数装库, 修改启动文本
使用反引号来重构字符串相关代码行 将log函数分出到 log.js 中 重新编写了启动的提示文本
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
* 铃之椅 Node 服务端
|
||||
*/
|
||||
|
||||
const log = (t) => {
|
||||
console.log("[" + new Date().toLocaleTimeString('en-US', { hour12: false }) + "] " + t)
|
||||
}
|
||||
const { log, loge, logw } = require("./log")
|
||||
|
||||
const msgs = require("./api-msgs")
|
||||
const users = require("./api-users")
|
||||
@@ -48,7 +46,7 @@ let api = {
|
||||
if (!users.checkRefreshToken(a.name, a.refreshToken))
|
||||
return cb({ code: -1, msg: "刷新令牌错误", invalid: true })
|
||||
|
||||
log(color.yellow + "客户端 " + client.handshake.address + " 完成了用户 " + a.name + " 的验证" + color.none)
|
||||
logw(`客户端 ${client.handshake.address} 完成了用户 ${a.name} 的验证`)
|
||||
|
||||
// 更新映射
|
||||
client.handshake.auth.passCheck = true
|
||||
|
||||
Reference in New Issue
Block a user