feat: 添加 cnb-board 路由及相关功能,获取 live 的 repo、构建、PR、NPC 和评论信息,并更新文档
fix: 更新 SKILL.md 文件格式,调整 metadata 标签位置
This commit is contained in:
@@ -2,13 +2,14 @@ import { app, assistantConfig } from '../app.ts';
|
||||
import './config/index.ts';
|
||||
import './client/index.ts';
|
||||
import './shop-install/index.ts';
|
||||
import './ai/index.ts';
|
||||
// import './ai/index.ts';
|
||||
import './user/index.ts';
|
||||
import './call/index.ts'
|
||||
|
||||
import './opencode/index.ts';
|
||||
import './remote/index.ts';
|
||||
// import './kevisual/index.ts'
|
||||
import './cnb-board/index.ts';
|
||||
|
||||
import { authCache } from '@/module/cache/auth.ts';
|
||||
|
||||
@@ -70,7 +71,7 @@ export const checkAuth = async (ctx: any, isAdmin = false) => {
|
||||
if (!auth.username) {
|
||||
// 初始管理员账号
|
||||
auth.username = username;
|
||||
assistantConfig.setConfig({ auth, token: token });
|
||||
assistantConfig.setConfig({ auth });
|
||||
}
|
||||
if (isAdmin && auth.username) {
|
||||
const admins = config.auth?.admin || [];
|
||||
@@ -78,12 +79,6 @@ export const checkAuth = async (ctx: any, isAdmin = false) => {
|
||||
const admin = auth.username;
|
||||
if (admin === username) {
|
||||
isCheckAdmin = true;
|
||||
const _token = config.token;
|
||||
if (!_token) {
|
||||
assistantConfig.setConfig({ token: token });
|
||||
} else if (_token && _token.startsWith('st-') && _token !== token) {
|
||||
assistantConfig.setConfig({ token: token });
|
||||
}
|
||||
}
|
||||
if (!isCheckAdmin && admins.length > 0 && admins.includes(username)) {
|
||||
isCheckAdmin = true;
|
||||
@@ -127,6 +122,7 @@ app
|
||||
if (!ctx.query?.token && ctx.appId === app.appId) {
|
||||
return;
|
||||
}
|
||||
ctx.state.isAdmin = true;
|
||||
const authResult = await checkAuth(ctx, true);
|
||||
if (authResult.code !== 200) {
|
||||
ctx.throw(authResult.code, authResult.message);
|
||||
|
||||
Reference in New Issue
Block a user