Fetch descriptions from origin

This commit is contained in:
Geometrically 2021-01-02 18:34:59 -07:00
parent 343116ea24
commit d2b26124e4
No known key found for this signature in database
GPG Key ID: 90C056FDC8FC9FF0
2 changed files with 12 additions and 2 deletions

View File

@ -309,7 +309,11 @@ export default {
name: mod.license.name, name: mod.license.name,
} }
const res = await axios.get(mod.body_url) const reg = /.+?:\/\/.+?(\/.+?)(?:#|\?|$)/
const urlPath = reg.exec(mod.body_url)[1]
const res = await axios.get(
`https://modrinth-cdn.nyc3.digitaloceanspaces.com${urlPath}`
)
return { return {
mod, mod,

View File

@ -17,7 +17,13 @@ export default {
components: { ModPage }, components: { ModPage },
auth: false, auth: false,
async fetch() { async fetch() {
this.body = (await axios.get(this.mod.body_url)).data const reg = /.+?:\/\/.+?(\/.+?)(?:#|\?|$)/
const urlPath = reg.exec(this.mod.body_url)[1]
this.body = (
await axios.get(
`https://modrinth-cdn.nyc3.digitaloceanspaces.com${urlPath}`
)
).data
}, },
async asyncData(data) { async asyncData(data) {
const config = { const config = {