refacto: encode url with components becuase of / in base 64
This commit is contained in:
parent
af30767ab6
commit
0bbe6dbf24
@ -12,6 +12,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { NcAppNavigationNewItem } from '@nextcloud/vue'
|
import { NcAppNavigationNewItem } from '@nextcloud/vue'
|
||||||
import Plus from 'vue-material-design-icons/Plus.vue'
|
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||||
|
import { encodeUrl } from '../../utils/url.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddRss',
|
name: 'AddRss',
|
||||||
@ -21,7 +22,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addSubscription(feedUrl) {
|
addSubscription(feedUrl) {
|
||||||
this.$router.push(btoa(feedUrl))
|
this.$router.push(encodeUrl(feedUrl))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import AdaptativeList from '../Atoms/AdaptativeList.vue'
|
|||||||
import Loading from '../Atoms/Loading.vue'
|
import Loading from '../Atoms/Loading.vue'
|
||||||
import axios from '@nextcloud/axios'
|
import axios from '@nextcloud/axios'
|
||||||
import { debounce } from '../../utils/debounce.js'
|
import { debounce } from '../../utils/debounce.js'
|
||||||
|
import { encodeUrl } from '../../utils/url.js'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
import moment from '@nextcloud/moment'
|
import moment from '@nextcloud/moment'
|
||||||
import { showError } from '@nextcloud/dialogs'
|
import { showError } from '@nextcloud/dialogs'
|
||||||
@ -75,7 +76,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 200),
|
}, 200),
|
||||||
toUrl(url) {
|
toUrl(url) {
|
||||||
return `/${btoa(url)}`
|
return `/${encodeUrl(url)}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { encodeUrl } from '../../utils/url.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TopItem',
|
name: 'TopItem',
|
||||||
props: {
|
props: {
|
||||||
@ -27,7 +29,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
toUrl() {
|
toUrl() {
|
||||||
return `/${btoa(this.link)}`
|
return `/${encodeUrl(this.link)}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
import { NcAppNavigationNew, NcAvatar } from '@nextcloud/vue'
|
import { NcAppNavigationNew, NcAvatar } from '@nextcloud/vue'
|
||||||
import Plus from 'vue-material-design-icons/Plus.vue'
|
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||||
import axios from '@nextcloud/axios'
|
import axios from '@nextcloud/axios'
|
||||||
|
import { decodeUrl } from '../../utils/url.js'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
import { showError } from '@nextcloud/dialogs'
|
import { showError } from '@nextcloud/dialogs'
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
url() {
|
url() {
|
||||||
return atob(this.$route.params.url)
|
return decodeUrl(this.$route.params.url)
|
||||||
},
|
},
|
||||||
isSubscribed() {
|
isSubscribed() {
|
||||||
return this.$store.state.subscriptions.subscriptions.includes(this.url)
|
return this.$store.state.subscriptions.subscriptions.includes(this.url)
|
||||||
|
@ -55,6 +55,7 @@ import Modal from './Modal.vue'
|
|||||||
import PlayButton from 'vue-material-design-icons/Play.vue'
|
import PlayButton from 'vue-material-design-icons/Play.vue'
|
||||||
import StopButton from 'vue-material-design-icons/Stop.vue'
|
import StopButton from 'vue-material-design-icons/Stop.vue'
|
||||||
import axios from '@nextcloud/axios'
|
import axios from '@nextcloud/axios'
|
||||||
|
import { decodeUrl } from '../../utils/url.js'
|
||||||
import { formatTimer } from '../../utils/time.js'
|
import { formatTimer } from '../../utils/time.js'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
import moment from '@nextcloud/moment'
|
import moment from '@nextcloud/moment'
|
||||||
@ -85,7 +86,7 @@ export default {
|
|||||||
return this.$store.state.player.episode
|
return this.$store.state.player.episode
|
||||||
},
|
},
|
||||||
url() {
|
url() {
|
||||||
return atob(this.$route.params.url)
|
return decodeUrl(this.$route.params.url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { encodeUrl } from '../../utils/url.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Infos',
|
name: 'Infos',
|
||||||
computed: {
|
computed: {
|
||||||
@ -19,7 +21,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toUrl(url) {
|
toUrl(url) {
|
||||||
return `/${btoa(url)}`
|
return `/${encodeUrl(url)}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import { NcActionButton, NcAppNavigationItem, NcAvatar } from '@nextcloud/vue'
|
|||||||
import Alert from 'vue-material-design-icons/Alert.vue'
|
import Alert from 'vue-material-design-icons/Alert.vue'
|
||||||
import Delete from 'vue-material-design-icons/Delete.vue'
|
import Delete from 'vue-material-design-icons/Delete.vue'
|
||||||
import axios from '@nextcloud/axios'
|
import axios from '@nextcloud/axios'
|
||||||
|
import { encodeUrl } from '../../utils/url.js'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
import { showError } from '@nextcloud/dialogs'
|
import { showError } from '@nextcloud/dialogs'
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
toUrl() {
|
toUrl() {
|
||||||
return `/${btoa(this.url)}`
|
return `/${encodeUrl(this.url)}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
2
src/utils/url.js
Normal file
2
src/utils/url.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export const encodeUrl = (url) => encodeURIComponent(btoa(url))
|
||||||
|
export const decodeUrl = (url) => atob(decodeURIComponent(url))
|
Loading…
Reference in New Issue
Block a user