This commit is contained in:
xiongxiao
2026-03-18 01:25:49 +08:00
committed by cnb
parent 819cbcebac
commit 83ac00588e
6 changed files with 118 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import { App } from "@kevisual/router";
import { useContextKey } from "@kevisual/context";
import { useContextKey, useKey } from "@kevisual/context";
import { CNB } from "@kevisual/cnb";
import { Gitea } from '@kevisual/gitea';
import path from "node:path";
@@ -11,13 +11,13 @@ export const app = useContextKey("app", () => {
});
export const cnb = useContextKey("cnb", () => {
const token = useContextKey("CNB_API_KEY") || useContextKey('CNB_TOKEN')
const token = useKey("CNB_API_KEY") || useKey('CNB_TOKEN')
return new CNB({ token });
});
export const gitea = useContextKey('gitea', () => {
const GITEA_TOKEN = useContextKey("GITEA_TOKEN")
const GITEA_URL = useContextKey("GITEA_URL")
const GITEA_TOKEN = useKey("GITEA_TOKEN")
const GITEA_URL = useKey("GITEA_URL")
return new Gitea({
token: GITEA_TOKEN,
baseURL: GITEA_URL,