Update: 更新socket工作模式

This commit is contained in:
王立帮
2024-11-29 21:21:58 +08:00
parent 546912edd7
commit d8ceafadbf
9 changed files with 428 additions and 0 deletions

18
src/common/debug.js Normal file
View File

@@ -0,0 +1,18 @@
import { DEBUG } from './config';
const Debug = {};
for (let key in console) {
if (typeof console[key] !== 'function') {
continue;
}
Debug[key] = (...args) => {
if (DEBUG) {
console[key](...args);
} else {
console.log(`[${key.toUpperCase()}]`, ...args);
}
}
}
export default Debug;