feat(M2): FR-S1/S4/S6 保存机制完善——setBody 防抖读 settings.autoSaveInterval(S1); beforeunload 冲刷+saveNow(S4); ReadDocResult 加 mtime+reloadDoc 检测外部改动(R6); store 暴露 __STORE__; save-mechanism E2E 3 项
This commit is contained in:
@@ -140,8 +140,9 @@ export class FileService {
|
||||
async readDoc(path: string): Promise<ReadDocResult> {
|
||||
const abs = this.abs(path);
|
||||
const raw = await fs.readFile(abs, 'utf8');
|
||||
const stat = await fs.stat(abs);
|
||||
const { meta, body } = splitFrontmatter(raw);
|
||||
return { meta, body };
|
||||
return { meta, body, mtime: stat.mtimeMs };
|
||||
}
|
||||
|
||||
async writeDoc(payload: WriteDocPayload): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user