refacto: encode url with components becuase of / in base 64
This commit is contained in:
parent
af30767ab6
commit
0bbe6dbf24
@ -12,6 +12,7 @@
|
||||
<script>
|
||||
import { NcAppNavigationNewItem } from '@nextcloud/vue'
|
||||
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||
import { encodeUrl } from '../../utils/url.js'
|
||||
|
||||
export default {
|
||||
name: 'AddRss',
|
||||
@ -21,7 +22,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
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 axios from '@nextcloud/axios'
|
||||
import { debounce } from '../../utils/debounce.js'
|
||||
import { encodeUrl } from '../../utils/url.js'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import moment from '@nextcloud/moment'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
@ -75,7 +76,7 @@ export default {
|
||||
}
|
||||
}, 200),
|
||||
toUrl(url) {
|
||||
return `/${btoa(url)}`
|
||||
return `/${encodeUrl(url)}`
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -5,6 +5,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { encodeUrl } from '../../utils/url.js'
|
||||
|
||||
export default {
|
||||
name: 'TopItem',
|
||||
props: {
|
||||
@ -27,7 +29,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
toUrl() {
|
||||
return `/${btoa(this.link)}`
|
||||
return `/${encodeUrl(this.link)}`
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
import { NcAppNavigationNew, NcAvatar } from '@nextcloud/vue'
|
||||
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { decodeUrl } from '../../utils/url.js'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
|
||||
@ -68,7 +69,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
url() {
|
||||
return atob(this.$route.params.url)
|
||||
return decodeUrl(this.$route.params.url)
|
||||
},
|
||||
isSubscribed() {
|
||||
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 StopButton from 'vue-material-design-icons/Stop.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { decodeUrl } from '../../utils/url.js'
|
||||
import { formatTimer } from '../../utils/time.js'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import moment from '@nextcloud/moment'
|
||||
@ -85,7 +86,7 @@ export default {
|
||||
return this.$store.state.player.episode
|
||||
},
|
||||
url() {
|
||||
return atob(this.$route.params.url)
|
||||
return decodeUrl(this.$route.params.url)
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
|
@ -10,6 +10,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { encodeUrl } from '../../utils/url.js'
|
||||
|
||||
export default {
|
||||
name: 'Infos',
|
||||
computed: {
|
||||
@ -19,7 +21,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
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 Delete from 'vue-material-design-icons/Delete.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { encodeUrl } from '../../utils/url.js'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
|
||||
@ -52,7 +53,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
toUrl() {
|
||||
return `/${btoa(this.url)}`
|
||||
return `/${encodeUrl(this.url)}`
|
||||
},
|
||||
},
|
||||
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