header
This commit is contained in:
parent
e3304bbade
commit
d365b88d09
1 changed files with 6 additions and 5 deletions
|
@ -14,17 +14,18 @@ const targetDir = `H:\\临时文件夹\\SiYuanDevSpace\\data\\plugins`;
|
|||
const log = (info) => console.log(`\x1B[36m%s\x1B[0m`, info);
|
||||
const error = (info) => console.log(`\x1B[31m%s\x1B[0m`, info);
|
||||
|
||||
let POST_HEADER = {
|
||||
// "Authorization": `Token ${token}`,
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
async function getSiYuanDir() {
|
||||
let url = 'http://127.0.0.1:6806/api/system/getWorkspaces';
|
||||
let header = {
|
||||
// "Authorization": `Token 6j8dkekjqjwb5dqq`,
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
let conf = {};
|
||||
try {
|
||||
let response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: header
|
||||
headers: POST_HEADER
|
||||
});
|
||||
if (response.ok) {
|
||||
conf = await response.json();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue