You've already forked AstralRinth
forked from didirus/AstralRinth
Version editing, user, mod, version deletion
This commit is contained in:
@@ -5,7 +5,11 @@
|
||||
:members="members"
|
||||
:current-member="currentMember"
|
||||
>
|
||||
<div v-compiled-markdown="body" v-highlightjs class="markdown-body"></div>
|
||||
<div
|
||||
v-compiled-markdown="mod.body"
|
||||
v-highlightjs
|
||||
class="markdown-body"
|
||||
></div>
|
||||
</ModPage>
|
||||
</template>
|
||||
|
||||
@@ -16,15 +20,6 @@ import ModPage from '@/components/ModPage'
|
||||
export default {
|
||||
components: { ModPage },
|
||||
auth: false,
|
||||
async fetch() {
|
||||
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) {
|
||||
const config = {
|
||||
headers: {
|
||||
@@ -42,6 +37,10 @@ export default {
|
||||
)
|
||||
).data
|
||||
|
||||
if (mod.body_url && !mod.body) {
|
||||
mod.body = (await axios.get(mod.body_url)).data
|
||||
}
|
||||
|
||||
const [members, versions] = (
|
||||
await Promise.all([
|
||||
axios.get(`https://api.modrinth.com/api/v1/team/${mod.team}/members`),
|
||||
@@ -90,11 +89,6 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
body: '',
|
||||
}
|
||||
},
|
||||
head() {
|
||||
return {
|
||||
title: this.mod.title + ' - Modrinth',
|
||||
|
||||
Reference in New Issue
Block a user