Commit db74ec8a authored by liujiangnan's avatar liujiangnan

feat

parent 7c6b4d75
......@@ -810,12 +810,17 @@ Atmosphere and Colors: [Fill in content]
handleAiGenerateDownload: async function () {
var _this = this;
try {
var indexParam = parseInt(new URLSearchParams(window.location.search).get('index'), 10);
var pageXxx = (isNaN(indexParam) ? 0 : indexParam) + 1;
var templateFilename = 'page_' + pageXxx + '_template.md';
var dataFilename = 'page_' + pageXxx + '_data.md';
var tplRes = await fetch('./ImagesActionsTemplate.md');
if (!tplRes.ok) {
throw new Error('无法读取 ImagesActionsTemplate.md');
}
var tplText = await tplRes.text();
_this.downloadTextFile('ImagesActionsTemplate.md', tplText);
_this.downloadTextFile(templateFilename, tplText);
var dataRes = await fetch('./ImagesActionsTemplateData.md');
if (!dataRes.ok) {
......@@ -834,7 +839,7 @@ Atmosphere and Colors: [Fill in content]
throw new Error('ImagesActionsTemplateData.md 中未找到可替换的空 content(需为 content: {})');
}
setTimeout(function () {
_this.downloadTextFile('ImagesActionsTemplateData.md', filled);
_this.downloadTextFile(dataFilename, filled);
}, 200);
this.$message.success('已开始下载两个 MD 文件');
} catch (err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment