Skip to content

Commit 224e4b0

Browse files
committed
fix: upload images (#86)
1 parent 2eec1e0 commit 224e4b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/file.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ async function ghFileUpload(content, filename) {
8585
const githubResourceUrl = `raw.githubusercontent.com/${username}/${repo}/${branch}/`;
8686
const cdnResourceUrl = `cdn.jsdelivr.net/gh/${username}/${repo}@${branch}/`;
8787
return useDefault
88-
? res.content.download_url.replace(githubResourceUrl, cdnResourceUrl)
89-
: res.content.download_url;
88+
? res.data.content.download_url.replace(githubResourceUrl, cdnResourceUrl)
89+
: res.data.content.download_url;
9090
}
9191

9292
//-----------------------------------------------------------------------
@@ -112,7 +112,7 @@ async function giteeUpload(content, filename) {
112112
message: `Upload by ${window.location.href}`,
113113
},
114114
});
115-
return encodeURI(res.content.download_url);
115+
return encodeURI(res.data.content.download_url);
116116
}
117117

118118
//-----------------------------------------------------------------------

0 commit comments

Comments
 (0)