From c8b867145f1293a3e3e2276ecbd97879715c9078 Mon Sep 17 00:00:00 2001 From: winkidney Date: Mon, 25 Nov 2019 23:48:01 +0800 Subject: [PATCH] Feature: Now the repack works well --- pinry-spa/src/components/Pins.vue | 136 ++++++++++++++++++++++++++- pinry-spa/src/components/utils/PinHandler.js | 13 +++ pinry-spa/src/main.js | 2 +- pinry-spa/vue.config.js | 7 +- 4 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 pinry-spa/src/components/utils/PinHandler.js diff --git a/pinry-spa/src/components/Pins.vue b/pinry-spa/src/components/Pins.vue index 5a53576..b40d72a 100644 --- a/pinry-spa/src/components/Pins.vue +++ b/pinry-spa/src/components/Pins.vue @@ -1,21 +1,153 @@ diff --git a/pinry-spa/src/components/utils/PinHandler.js b/pinry-spa/src/components/utils/PinHandler.js new file mode 100644 index 0000000..0a4df2e --- /dev/null +++ b/pinry-spa/src/components/utils/PinHandler.js @@ -0,0 +1,13 @@ +/** + * Remove http prefix from url. + * @param url: String +*/ +function escapeUrl(url) { + const uri = new URL(url); + return uri.pathname; +} + + +export default { + escapeUrl, +}; diff --git a/pinry-spa/src/main.js b/pinry-spa/src/main.js index e1a0323..3df5785 100644 --- a/pinry-spa/src/main.js +++ b/pinry-spa/src/main.js @@ -1,6 +1,6 @@ import Buefy from 'buefy'; import Vue from 'vue'; -import VueMasonryPlugin from 'vue-masonry'; +import { VueMasonryPlugin } from 'vue-masonry'; import App from './App.vue'; diff --git a/pinry-spa/vue.config.js b/pinry-spa/vue.config.js index 3647f32..39cb39b 100644 --- a/pinry-spa/vue.config.js +++ b/pinry-spa/vue.config.js @@ -5,9 +5,10 @@ module.exports = { target: 'http://localhost:8000/', changeOrigin: true, ws: true, - pathRewrite: { - '^/api': '/api', - }, + }, + '/static/media': { + target: 'http://localhost:8000/', + changeOrigin: true, }, }, },