fix: 更新 @kevisual/api 依赖至 0.0.59,并优化本地用户检查逻辑

This commit is contained in:
xiongxiao
2026-02-22 00:07:01 +08:00
parent c00062d704
commit e377557587
9 changed files with 172 additions and 129 deletions

View File

@@ -45,11 +45,15 @@ type LightCodeFile = {
id?: string, code?: string, hash?: string, filepath: string
}
export const initLightCode = async (opts: Opts) => {
const token = await assistantQuery.getToken();
if (!token) {
console.error('[light-code] 当前未登录,无法初始化 light-code');
return;
}
// 注册 light-code 路由
console.log('初始化 light-code 路由');
const config = opts.config as AssistantInit;
const app = opts.router;
const token = await assistantQuery.getToken();
console.log('初始化 light-code 路由');
const query = config.query;
const sync = opts.sync ?? 'remote';
if (!config || !app) {