This commit is contained in:
frostime 2023-06-03 18:11:57 +08:00
parent e3304bbade
commit d365b88d09

View file

@ -14,17 +14,18 @@ const targetDir = `H:\\临时文件夹\\SiYuanDevSpace\\data\\plugins`;
const log = (info) => console.log(`\x1B[36m%s\x1B[0m`, info); const log = (info) => console.log(`\x1B[36m%s\x1B[0m`, info);
const error = (info) => console.log(`\x1B[31m%s\x1B[0m`, info); const error = (info) => console.log(`\x1B[31m%s\x1B[0m`, info);
async function getSiYuanDir() { let POST_HEADER = {
let url = 'http://127.0.0.1:6806/api/system/getWorkspaces'; // "Authorization": `Token ${token}`,
let header = {
// "Authorization": `Token 6j8dkekjqjwb5dqq`,
"Content-Type": "application/json", "Content-Type": "application/json",
} }
async function getSiYuanDir() {
let url = 'http://127.0.0.1:6806/api/system/getWorkspaces';
let conf = {}; let conf = {};
try { try {
let response = await fetch(url, { let response = await fetch(url, {
method: 'POST', method: 'POST',
headers: header headers: POST_HEADER
}); });
if (response.ok) { if (response.ok) {
conf = await response.json(); conf = await response.json();