mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-22 13:37:23 +00:00
Add support for /c/ and /user/
This commit is contained in:
parent
c6cc796ea9
commit
fcab0c9499
@ -51,7 +51,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async fetchChannel() {
|
||||
return await this.fetchJson(Constants.BASE_URL + "/channels/" + this.$route.params.channelId);
|
||||
const url =
|
||||
Constants.BASE_URL +
|
||||
(this.$route.params.channelId
|
||||
? "/channels/" + this.$route.params.channelId
|
||||
: this.$route.params.channelC
|
||||
? "/c/" + this.$route.params.channelC
|
||||
: "/user/" + this.$route.params.channelUser);
|
||||
return await this.fetchJson(url);
|
||||
},
|
||||
async getChannelData() {
|
||||
this.fetchChannel()
|
||||
@ -65,7 +72,7 @@ export default {
|
||||
this.fetchJson(
|
||||
Constants.BASE_URL +
|
||||
"/nextpage/channels/" +
|
||||
this.$route.params.channelId +
|
||||
this.channel.id +
|
||||
"?url=" +
|
||||
encodeURIComponent(this.channel.nextpage) +
|
||||
"&id=" +
|
||||
|
@ -13,7 +13,17 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: "/channel/:channelId",
|
||||
name: "Channel",
|
||||
name: "ChannelId",
|
||||
component: () => import("../components/Channel.vue"),
|
||||
},
|
||||
{
|
||||
path: "/c/:channelC",
|
||||
name: "ChannelC",
|
||||
component: () => import("../components/Channel.vue"),
|
||||
},
|
||||
{
|
||||
path: "/user/:channelUser",
|
||||
name: "ChannelUser",
|
||||
component: () => import("../components/Channel.vue"),
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user