chore: 统一为简体中文

This commit is contained in:
CrescentLeaf
2025-10-06 15:36:12 +08:00
parent bd857b840b
commit dced175d7a
23 changed files with 131 additions and 175 deletions

View File

@@ -75,17 +75,17 @@ export default class ApiManager {
socket.on('disconnect', (_reason) => {
if (clientInfo.userId == '')
console.log(chalk.yellow('[]') + ` ${ip} disconnected`)
console.log(chalk.yellow('[]') + ` ${ip} disconnected`)
else {
console.log(chalk.green('[]') + ` ${ip} disconnected`)
console.log(chalk.green('[]') + ` ${ip} disconnected`)
delete this.clients[clientInfo.userId][deviceId + '_' + sessionId]
}
})
console.log(chalk.yellow('[]') + ` ${ip} connected`)
console.log(chalk.yellow('[]') + ` ${ip} connected`)
socket.on("The_White_Silk", async (name: string, args: { [key: string]: unknown }, callback_: (ret: ApiCallbackMessage) => void) => {
function callback(ret: ApiCallbackMessage) {
console.log(chalk.blue('[]') + ` ${ip} <- ${ret.code == 200 ? chalk.green(ret.msg) : chalk.red(ret.msg)} [${ret.code}]${ret.data ? (' <extras: ' + stringifyNotIncludeArrayBuffer(ret.data) + '>') : ''}`)
console.log(chalk.blue('[]') + ` ${ip} <- ${ret.code == 200 ? chalk.green(ret.msg) : chalk.red(ret.msg)} [${ret.code}]${ret.data ? (' <extras: ' + stringifyNotIncludeArrayBuffer(ret.data) + '>') : ''}`)
return callback_(ret)
}
async function checkIsPromiseAndAwait(value: Promise<unknown> | unknown) {
@@ -106,11 +106,11 @@ export default class ApiManager {
})
} catch (e) {
const err = e as Error
console.log(chalk.yellow('[]') + ` ${err.message} (${err.stack})`)
console.log(chalk.yellow('[]') + ` ${err.message} (${err.stack})`)
try {
callback({
code: err instanceof DataWrongError ? 400 : 500,
msg: "錯誤: " + err.message
msg: "错误: " + err.message
})
} catch (_e) { }
}