Merge pull request #144 from Guation/main

feat: http与ws允许监听同一端口,快速登录允许自动选择QQ号,允许禁用webUI
This commit is contained in:
手瓜一十雪
2024-07-24 14:09:19 +08:00
committed by GitHub
7 changed files with 129 additions and 53 deletions

View File

@@ -91,8 +91,10 @@ export function enableConsoleLog(enable: boolean) {
function formatMsg(msg: any[]) {
let logMsg = '';
for (const msgItem of msg) {
// 判断是否是对象
if (typeof msgItem === 'object') {
if (msgItem instanceof Error) { // 判断是否是错误
logMsg += msgItem.stack + ' ';
continue;
} else if (typeof msgItem === 'object') { // 判断是否是对象
const obj = JSON.parse(JSON.stringify(msgItem, null, 2));
logMsg += JSON.stringify(truncateString(obj)) + ' ';
continue;