mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: webui finish!!
This commit is contained in:
parent
6702024805
commit
4545d9285b
@ -37,13 +37,13 @@ export const OB11GetConfigHandler: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
export const OB11SetConfigHandler: RequestHandler = async (req, res) => {
|
export const OB11SetConfigHandler: RequestHandler = async (req, res) => {
|
||||||
let isLogin = await DataRuntime.getQQLoginStatus();
|
let isLogin = await DataRuntime.getQQLoginStatus();
|
||||||
if (!isLogin) {
|
// if (!isLogin) {
|
||||||
res.send({
|
// res.send({
|
||||||
code: -1,
|
// code: -1,
|
||||||
message: 'Not Login'
|
// message: 'Not Login'
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (isEmpty(req.body.config)) {
|
if (isEmpty(req.body.config)) {
|
||||||
res.send({
|
res.send({
|
||||||
code: -1,
|
code: -1,
|
||||||
@ -53,7 +53,7 @@ export const OB11SetConfigHandler: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
let configFilePath = resolve(__dirname, `./config/onebot_${await DataRuntime.getQQLoginUin()}.json`);
|
let configFilePath = resolve(__dirname, `./config/onebot_${await DataRuntime.getQQLoginUin()}.json`);
|
||||||
try {
|
try {
|
||||||
require(configFilePath);
|
readFileSync(configFilePath);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
configFilePath = resolve(__dirname, `./config/onebot.json`);
|
configFilePath = resolve(__dirname, `./config/onebot.json`);
|
||||||
|
@ -8,7 +8,11 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
const isEmpty = (value: any) => value === undefined || value === undefined || value === '';
|
const isEmpty = (value: any) => value === undefined || value === undefined || value === '';
|
||||||
let ob11Config: OB11Config = await OB11ConfigWrapper.GetOB11Config();
|
let ob11Config: OB11Config = await OB11ConfigWrapper.GetOB11Config();
|
||||||
const setOB11Config = (key: string, value: any) => {
|
const setOB11Config = (key: string, value: any) => {
|
||||||
console.log(key, value);
|
const configKey = key.split('.');
|
||||||
|
if (configKey.length === 2) {
|
||||||
|
ob11Config[configKey[1]] = value;
|
||||||
|
}
|
||||||
|
OB11ConfigWrapper.SetOB11Config(ob11Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user