mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
fix: upload images (#86)
This commit is contained in:
parent
2eec1e0b0b
commit
224e4b045a
@ -85,8 +85,8 @@ async function ghFileUpload(content, filename) {
|
|||||||
const githubResourceUrl = `raw.githubusercontent.com/${username}/${repo}/${branch}/`;
|
const githubResourceUrl = `raw.githubusercontent.com/${username}/${repo}/${branch}/`;
|
||||||
const cdnResourceUrl = `cdn.jsdelivr.net/gh/${username}/${repo}@${branch}/`;
|
const cdnResourceUrl = `cdn.jsdelivr.net/gh/${username}/${repo}@${branch}/`;
|
||||||
return useDefault
|
return useDefault
|
||||||
? res.content.download_url.replace(githubResourceUrl, cdnResourceUrl)
|
? res.data.content.download_url.replace(githubResourceUrl, cdnResourceUrl)
|
||||||
: res.content.download_url;
|
: res.data.content.download_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@ -112,7 +112,7 @@ async function giteeUpload(content, filename) {
|
|||||||
message: `Upload by ${window.location.href}`,
|
message: `Upload by ${window.location.href}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return encodeURI(res.content.download_url);
|
return encodeURI(res.data.content.download_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user