mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
refactor: config使用QQ号区分
This commit is contained in:
@@ -66,7 +66,7 @@ export function setLogSelfInfo(selfInfo: SelfInfo) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
logConfig.appenders.FileAppender.layout.pattern = logConfig.appenders.ConsoleAppender.layout.pattern =
|
||||
`%d{yyyy-MM-dd hh:mm:ss} [%p] ${selfInfo.nick || selfInfo.uin}(${selfInfo.uin}) %m`;
|
||||
`%d{yyyy-MM-dd hh:mm:ss} [%p] ${selfInfo.nick}(${selfInfo.uin}) %m`;
|
||||
log4js.configure(logConfig);
|
||||
}
|
||||
|
||||
|
2
src/core
2
src/core
Submodule src/core updated: 69ea8dbb97...5d6d446065
@@ -35,16 +35,16 @@ checkVersion().then((remoteVersion: string) => {
|
||||
});
|
||||
new NapCatOnebot11();
|
||||
napCatCore.onLoginSuccess(() => {
|
||||
log('登录成功!');
|
||||
console.log('登录成功!');
|
||||
postLoginStatus();
|
||||
});
|
||||
const showQRCode = (qrCodeData: { url: string, base64: string, buffer: Buffer }) => {
|
||||
log('请扫描下面的二维码,然后在手Q上授权登录:');
|
||||
console.log('请扫描下面的二维码,然后在手Q上授权登录:');
|
||||
const qrcodePath = path.join(__dirname, 'qrcode.png');
|
||||
qrcode.generate(qrCodeData.url, { small: true }, (res) => {
|
||||
log(`${res}\n二维码解码URL: ${qrCodeData.url}\n如果控制台二维码无法扫码,可以复制解码url到二维码生成网站生成二维码再扫码,也可以打开下方的二维码路径图片进行扫码`);
|
||||
console.log(`${res}\n二维码解码URL: ${qrCodeData.url}\n如果控制台二维码无法扫码,可以复制解码url到二维码生成网站生成二维码再扫码,也可以打开下方的二维码路径图片进行扫码`);
|
||||
fs.writeFile(qrcodePath, qrCodeData.buffer).then(() => {
|
||||
log('二维码已保存到', qrcodePath);
|
||||
console.log('二维码已保存到', qrcodePath);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
6
src/napcat.json
Normal file
6
src/napcat.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"fileLog": true,
|
||||
"consoleLog": true,
|
||||
"fileLogLevel": "debug",
|
||||
"consoleLogLevel": "info"
|
||||
}
|
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"httpHost": "",
|
||||
"enableHttp": false,
|
||||
"httpPort": 3000,
|
||||
"wsHost": "",
|
||||
"enableWs": false,
|
||||
"wsPort": 3001,
|
||||
"enableWsReverse": false,
|
||||
|
Reference in New Issue
Block a user