This commit is contained in:
frostime 2023-05-22 21:34:17 +08:00
parent 831ba76c7c
commit c29ea97240

View file

@ -11,10 +11,10 @@ const targetDir = '';
//******************************************************************************************** //********************************************************************************************
async function getSiYuanDir() { async function getSiYuanDir(token) {
let url = 'http://127.0.0.1:6806/api/system/getConf'; let url = 'http://127.0.0.1:6806/api/system/getConf';
let header = { let header = {
// "Authorization": `Token ${token}`, "Authorization": `Token ${token}`,
"Content-Type": "application/json", "Content-Type": "application/json",
} }
try { try {
@ -24,13 +24,13 @@ async function getSiYuanDir() {
}); });
console.log(conf); console.log(conf);
} catch (e) { } catch (e) {
console.log('Failed! Please make sure SiYuan is running'); console.log(e);
process.exit(1); process.exit(1);
} }
} }
if (targetDir === '') { if (targetDir === '') {
await getSiYuanDir(); await getSiYuanDir('es7zy9zewgibc6dt');
process.exit(0); process.exit(0);
} }