mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Add support for /c/ and /user/
This commit is contained in:
		
							parent
							
								
									c6cc796ea9
								
							
						
					
					
						commit
						fcab0c9499
					
				
					 2 changed files with 20 additions and 3 deletions
				
			
		| 
						 | 
					@ -51,7 +51,14 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
        async fetchChannel() {
 | 
					        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() {
 | 
					        async getChannelData() {
 | 
				
			||||||
            this.fetchChannel()
 | 
					            this.fetchChannel()
 | 
				
			||||||
| 
						 | 
					@ -65,7 +72,7 @@ export default {
 | 
				
			||||||
                this.fetchJson(
 | 
					                this.fetchJson(
 | 
				
			||||||
                    Constants.BASE_URL +
 | 
					                    Constants.BASE_URL +
 | 
				
			||||||
                        "/nextpage/channels/" +
 | 
					                        "/nextpage/channels/" +
 | 
				
			||||||
                        this.$route.params.channelId +
 | 
					                        this.channel.id +
 | 
				
			||||||
                        "?url=" +
 | 
					                        "?url=" +
 | 
				
			||||||
                        encodeURIComponent(this.channel.nextpage) +
 | 
					                        encodeURIComponent(this.channel.nextpage) +
 | 
				
			||||||
                        "&id=" +
 | 
					                        "&id=" +
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,17 @@ const routes = [
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        path: "/channel/:channelId",
 | 
					        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"),
 | 
					        component: () => import("../components/Channel.vue"),
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue