fix: 更新缓存文件路径的创建逻辑

This commit is contained in:
2026-01-20 17:45:59 +08:00
parent a4e04e7afa
commit ddba845ce7

View File

@@ -1,10 +1,18 @@
import { simpleRouter } from '@/app.ts';
import http from 'http';
import { useContextKey } from '@kevisual/context';
import { useFileStore } from '@kevisual/use-config';
export { simpleRouter };
export const cacheFilePath = useFileStore('cache-file', { needExists: true });
import os from 'node:os';
import path from 'node:path';
import fs from 'node:fs';
/**
* 缓存文件路径
*/
const defaultCachePath = path.join(os.homedir(), '.envision', 'cache-file');
if (!fs.existsSync(defaultCachePath)) {
fs.mkdirSync(defaultCachePath, { recursive: true });
}
export const cacheFilePath = defaultCachePath;
/**
* 事件客户端