mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
fix(terminal): console相关正规化
This commit is contained in:
16
src/App.vue
16
src/App.vue
@@ -53,7 +53,7 @@ onMounted(async () => {
|
||||
async function checkLoad() {
|
||||
await appStore.check();
|
||||
if (appStore.loading) {
|
||||
console.log("数据已加载!");
|
||||
console.info("数据已加载!");
|
||||
return;
|
||||
}
|
||||
DeleteTGData();
|
||||
@@ -61,32 +61,32 @@ async function checkLoad() {
|
||||
await writeData();
|
||||
await writeIndex();
|
||||
appStore.loading = true;
|
||||
console.log("数据加载完成!");
|
||||
console.info("数据加载完成!");
|
||||
}
|
||||
// 创建数据文件夹
|
||||
async function createDataDir() {
|
||||
console.log("开始创建数据文件夹...");
|
||||
console.info("开始创建数据文件夹...");
|
||||
await fs.createDir("appData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("userData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("tempData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
|
||||
console.log("数据文件夹创建完成!");
|
||||
console.info("数据文件夹创建完成!");
|
||||
}
|
||||
// 将数据写入文件夹
|
||||
async function writeData() {
|
||||
console.log("开始写入数据...");
|
||||
console.info("开始写入数据...");
|
||||
TGAppDataList.map(async item => {
|
||||
await fs.writeFile(`${appStore.dataPath.app}\\${item.name}`, JSON.stringify(item.data));
|
||||
});
|
||||
console.log("数据写入完成!");
|
||||
console.info("数据写入完成!");
|
||||
}
|
||||
// 写入 IndexedDB
|
||||
async function writeIndex() {
|
||||
console.log("开始写入 IndexedDB...");
|
||||
console.info("开始写入 IndexedDB...");
|
||||
await InitTGData();
|
||||
TGGetDataList.map(async item => {
|
||||
await WriteTGData(item.name, item.data);
|
||||
});
|
||||
console.log("IndexedDB 写入完成!");
|
||||
console.info("IndexedDB 写入完成!");
|
||||
}
|
||||
</script>
|
||||
<style lang="css">
|
||||
|
||||
@@ -229,8 +229,8 @@ function DividerParser(data: PostStructuredContent): HTMLDivElement {
|
||||
img.src =
|
||||
"https://mihoyo-community-web.oss-cn-shanghai.aliyuncs.com/upload/2022/07/13/line_4.png";
|
||||
} else {
|
||||
console.log(data);
|
||||
throw new Error("Unknown divider type");
|
||||
console.error("Unknown divider type", data);
|
||||
return UnknownParser(data);
|
||||
}
|
||||
// 插入 img
|
||||
div.appendChild(img);
|
||||
|
||||
Reference in New Issue
Block a user