feat(kol): admin-web API client + router entries for KOL
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
declare module "@/views/KolManageView.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
|
||||
const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module "@/views/KolDashboardView.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
|
||||
const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module "@/views/KolMarketplaceView.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
|
||||
const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module "@/views/KolPackageDetailView.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
|
||||
const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module "@/views/KolGenerateView.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
|
||||
const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
|
||||
export default component;
|
||||
}
|
||||
@@ -146,6 +146,53 @@ const router = createRouter({
|
||||
navKey: "/images",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "kol/manage",
|
||||
name: "kol-manage",
|
||||
component: () => import("@/views/KolManageView.vue"),
|
||||
meta: {
|
||||
titleKey: "kol.manage.title",
|
||||
navKey: "/kol/manage",
|
||||
requiresKol: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "kol/dashboard",
|
||||
name: "kol-dashboard",
|
||||
component: () => import("@/views/KolDashboardView.vue"),
|
||||
meta: {
|
||||
titleKey: "kol.dashboard.title",
|
||||
navKey: "/kol/dashboard",
|
||||
requiresKol: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "kol/marketplace",
|
||||
name: "kol-marketplace",
|
||||
component: () => import("@/views/KolMarketplaceView.vue"),
|
||||
meta: {
|
||||
titleKey: "kol.marketplace.title",
|
||||
navKey: "/kol/marketplace",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "kol/packages/:id",
|
||||
name: "kol-package-detail",
|
||||
component: () => import("@/views/KolPackageDetailView.vue"),
|
||||
meta: {
|
||||
titleKey: "kol.marketplace.title",
|
||||
navKey: "/kol/marketplace",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "kol/generate/:subscriptionPromptId",
|
||||
name: "kol-generate",
|
||||
component: () => import("@/views/KolGenerateView.vue"),
|
||||
meta: {
|
||||
titleKey: "kol.generate.title",
|
||||
navKey: "/kol/marketplace",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -166,6 +213,10 @@ router.beforeEach(async (to) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (to.meta.requiresKol && !authStore.isActiveKol) {
|
||||
return { name: "workspace" };
|
||||
}
|
||||
|
||||
if (to.name === "login" && authStore.isAuthenticated) {
|
||||
return { name: "workspace" };
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -7,6 +7,7 @@ declare module "vue-router" {
|
||||
titleKey?: string;
|
||||
descriptionKey?: string;
|
||||
requiresAuth?: boolean;
|
||||
requiresKol?: boolean;
|
||||
navKey?: string | null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user