aboutsummaryrefslogtreecommitdiff
path: root/src/site/pages/a
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-03-29 00:35:58 +0900
committerPitu <[email protected]>2019-03-29 00:35:58 +0900
commitea3e503d13b7be477c064b02b9b2e5a9ef06c9a9 (patch)
tree8ffd0bef5e2e210ca28478d18c3876b73cc79784 /src/site/pages/a
parentAdded axios package (diff)
downloadhost.fuwn.me-ea3e503d13b7be477c064b02b9b2e5a9ef06c9a9.tar.xz
host.fuwn.me-ea3e503d13b7be477c064b02b9b2e5a9ef06c9a9.zip
Added middleware for pages and switched to $axios
Diffstat (limited to 'src/site/pages/a')
-rw-r--r--src/site/pages/a/_identifier.vue29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/site/pages/a/_identifier.vue b/src/site/pages/a/_identifier.vue
index a1f719a..d00ad85 100644
--- a/src/site/pages/a/_identifier.vue
+++ b/src/site/pages/a/_identifier.vue
@@ -51,19 +51,26 @@
<script>
import Grid from '~/components/grid/Grid.vue';
-import Loading from '~/components/loading/CubeShadow.vue';
import axios from 'axios';
export default {
- components: { Grid, Loading },
+ components: { Grid },
+ data() {
+ return {};
+ },
+ computed: {
+ config() {
+ return this.$store.state.config;
+ }
+ },
async asyncData({ app, params, error }) {
try {
- const res = await axios.get(`${app.store.state.config.baseURL}/album/${params.identifier}`);
- const downloadLink = res.data.downloadEnabled ? `${app.store.state.config.baseURL}/album/${params.identifier}/zip` : null;
+ const data = await axios.get(`${app.store.state.config.baseURL}/album/${params.identifier}`);
+ const downloadLink = data.downloadEnabled ? `${app.store.state.config.baseURL}/album/${params.identifier}/zip` : null;
return {
- name: res.data.name,
- downloadEnabled: res.data.downloadEnabled,
- files: res.data.files,
+ name: data.name,
+ downloadEnabled: data.downloadEnabled,
+ files: data.files,
downloadLink
};
} catch (err) {
@@ -79,14 +86,6 @@ export default {
error({ statusCode: 404, message: 'Post not found' });
}
},
- data() {
- return {};
- },
- computed: {
- config() {
- return this.$store.state.config;
- }
- },
metaInfo() {
if (this.files) {
return {