fix: url encode for tag name (#1031)

This commit is contained in:
boojack
2023-02-06 20:28:19 +08:00
committed by GitHub
parent 771ef44d82
commit 4de65ab55d
2 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ export function upsertTag(tagName: string) {
} }
export function deleteTag(tagName: string) { export function deleteTag(tagName: string) {
return axios.delete<ResponseObject<string>>(`/api/tag/${encodeURI(tagName)}`); return axios.delete<ResponseObject<string>>(`/api/tag/${encodeURIComponent(tagName)}`);
} }
export async function getRepoStarCount() { export async function getRepoStarCount() {

View File

@ -2,5 +2,5 @@ export const getResourceUrl = (resource: Resource, withOrigin = true) => {
if (resource.externalLink) { if (resource.externalLink) {
return resource.externalLink; return resource.externalLink;
} }
return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${encodeURI(resource.filename)}`; return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${encodeURIComponent(resource.filename)}`;
}; };