summaryrefslogtreecommitdiff
path: root/iridescence/src
diff options
context:
space:
mode:
Diffstat (limited to 'iridescence/src')
-rw-r--r--iridescence/src/api/dichroism.js2
-rw-r--r--iridescence/src/components/ProductCard.vue2
-rw-r--r--iridescence/src/components/ProductDetail.vue6
-rw-r--r--iridescence/src/components/admin/ProductEditCard.vue2
-rw-r--r--iridescence/src/views/Admin.vue9
5 files changed, 14 insertions, 7 deletions
diff --git a/iridescence/src/api/dichroism.js b/iridescence/src/api/dichroism.js
index 7da0c4f..93989c5 100644
--- a/iridescence/src/api/dichroism.js
+++ b/iridescence/src/api/dichroism.js
@@ -3,7 +3,7 @@ import PhotoSet from "../models/photo_set";
import ApiError from "./error";
export default class Dichroism {
- _base_addr = "https://theglassyladies.com/api/";
+ _base_addr = process.env.VUE_APP_API_BASE_ADDR;
async createPhoto(file) {
const fd = new FormData();
diff --git a/iridescence/src/components/ProductCard.vue b/iridescence/src/components/ProductCard.vue
index f796f92..144dd9e 100644
--- a/iridescence/src/components/ProductCard.vue
+++ b/iridescence/src/components/ProductCard.vue
@@ -54,7 +54,7 @@ export default {
return "$ " + (this.cents / 100).toFixed(2);
},
thumbnail() {
- return process.env.VUE_APP_IMAGE_ROOT + "/" + this.photo_thumbnail;
+ return process.env.VUE_APP_IMAGE_ROOT + this.photo_thumbnail;
},
shortDescription() {
let description = this.description.split(" ");
diff --git a/iridescence/src/components/ProductDetail.vue b/iridescence/src/components/ProductDetail.vue
index 6aeb68c..a67e39f 100644
--- a/iridescence/src/components/ProductDetail.vue
+++ b/iridescence/src/components/ProductDetail.vue
@@ -110,13 +110,11 @@ export default {
return "$ " + (this.product.cents / 100).toFixed(2);
},
base() {
- return [process.env.VUE_APP_IMAGE_ROOT, this.product.photo_base].join(
- "/"
- );
+ return [process.env.VUE_APP_IMAGE_ROOT, this.product.photo_base].join("");
},
fullsize() {
return [process.env.VUE_APP_IMAGE_ROOT, this.product.photo_fullsize].join(
- "/"
+ ""
);
},
categories() {
diff --git a/iridescence/src/components/admin/ProductEditCard.vue b/iridescence/src/components/admin/ProductEditCard.vue
index f8895aa..88d8e91 100644
--- a/iridescence/src/components/admin/ProductEditCard.vue
+++ b/iridescence/src/components/admin/ProductEditCard.vue
@@ -161,7 +161,7 @@ export default {
},
computed: {
thumbnail: function() {
- return process.env.VUE_APP_IMAGE_ROOT + "/" + this.old.photo_thumbnail;
+ return process.env.VUE_APP_IMAGE_ROOT + this.old.photo_thumbnail;
},
old: function() {
return this.$store.getters.products.find(p => p.id == this.oldid) || {};
diff --git a/iridescence/src/views/Admin.vue b/iridescence/src/views/Admin.vue
index 5274740..f1cf227 100644
--- a/iridescence/src/views/Admin.vue
+++ b/iridescence/src/views/Admin.vue
@@ -27,6 +27,15 @@ export default {
ProductEditList,
NewProduct,
ProductSearch
+ },
+ beforeRouteEnter: (to, from, next) => {
+ fetch(process.env.VUE_APP_LOGIN_URL).then(res => {
+ if (res.status == 401) {
+ next(false);
+ } else {
+ next();
+ }
+ });
}
};
</script>