Skip to content

Commit

Permalink
1.8.7 更新:控制台,修复bug等
Browse files Browse the repository at this point in the history
  • Loading branch information
liugaowei committed Nov 14, 2022
1 parent 564432f commit f12449d
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 13 deletions.
10 changes: 10 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,13 @@ ipcMain.on("openLogs", async (event, arg) => {
ipcMain.on("openLogFolder", async (event, arg) => {
shell.openPath(logger.logFolder);
});
ipcMain.on("showItemInFolder", async (event, arg) => {
shell.showItemInFolder(arg);
});
ipcMain.on("openDevTools", async (event, arg) => {
if (win.webContents.isDevToolsOpened()) {
win.webContents.closeDevTools();
} else {
win.webContents.openDevTools({ mode: "undocked", activate: true });
}
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tts-vue",
"version": "1.8.5",
"version": "1.8.7",
"main": "dist/electron/main/index.js",
"description": "🎤 微软语音合成工具,使用 Electron + Vue + ElementPlus + Vite 构建。",
"author": "沫離Loker <[email protected]>",
Expand Down
5 changes: 0 additions & 5 deletions src/components/aside/Version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ const checkUpdate = async () => {
<li><a href="https://github.com/LokerL/tts-vue/releases/latest" target="_blank">GitHub</a></li>
<li><a href="https://gitee.com/LGW_space/tts-vue/releases/latest" target="_blank">Gitee</a></li>
<li><a href="https://wwn.lanzoul.com/b0f3ype9g" target="_blank">lanzou云</a> 密码:em1n</li>
<li>点击链接加入企鹅群聊<a
href="https://jq.qq.com/?_wv=1027&k=nyp8gPOW"
target="_blank"
>【tts-vue交流群】</a
></li>
</ul>
</p>
<p style="margin-top:5px;">
Expand Down
15 changes: 10 additions & 5 deletions src/components/configpage/Donate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
<h3>
欢迎<span>Star</span>、<span>Fork</span>和<span>PR</span>。你的Star是对作者最好的鼓励:)
</h3>
<p style="margin: 0 10px">
点击链接加入企鹅群聊<a
href="https://jq.qq.com/?_wv=1027&k=nyp8gPOW"
target="_blank"
>【tts-vue交流群】</a
<p style="margin: 0 10px; font-size: 11px">
不再有自建的群聊,有问题请在
<a href="https://github.com/LokerL/tts-vue/issues" target="_blank"
>GitHub Issues</a
>
或者
<a href="https://gitee.com/LGW_space/tts-vue/issues" target="_blank"
>Gitee Issues</a
>
进行提问或反馈。
</p>
</div>

Expand Down Expand Up @@ -58,6 +62,7 @@ import GithubBtn from "./GithubBtn.vue";
}
h3 {
margin: 1px 10px;
font-size: 1em;
}
.btns {
Expand Down
8 changes: 8 additions & 0 deletions src/components/header/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
>
<el-icon v-show="currShow == 3"><FullScreen /></el-icon>
</el-button>
<el-button
size="small"
circle
class="circle-btn"
@click="ipcRenderer.send('openDevTools')"
>
<el-icon><Monitor /></el-icon>
</el-button>
</div>
<Logo />
</div>
Expand Down
23 changes: 21 additions & 2 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { defineStore } from "pinia";
import getTTSData from "./play";
import { ElMessage } from "element-plus";
import { h } from "vue";
const fs = require("fs");
const path = require("path");
const Store = require("electron-store");
Expand Down Expand Up @@ -105,6 +106,9 @@ export const useTtsStore = defineStore("ttsStore", {
);
},
async start() {
console.log("清空缓存中");
this.currMp3Buffer = Buffer.alloc(0);
this.currMp3Url = "";
// this.page.asideIndex == "1"单文本转换
if (this.page.asideIndex == "1") {
this.currMp3Url = "";
Expand Down Expand Up @@ -302,9 +306,21 @@ export const useTtsStore = defineStore("ttsStore", {
const filePath = path.join(this.config.savePath, currTime + ".mp3");
fs.writeFileSync(path.resolve(filePath), this.currMp3Buffer);
ElMessage({
message: "下载成功:" + filePath,
dangerouslyUseHTMLString: true,
message: h("p", null, [
h("span", null, "下载完成:"),
h(
"span",
{
on: {
click: this.showItemInFolder(filePath),
},
},
filePath
),
]),
type: "success",
duration: 2000,
duration: 4000,
});
ipcRenderer.send("log.info", `下载完成:${filePath}`);
},
Expand All @@ -327,5 +343,8 @@ export const useTtsStore = defineStore("ttsStore", {
sound.play();
});
},
showItemInFolder(filePath: string) {
ipcRenderer.send("showItemInFolder", filePath);
},
},
});

0 comments on commit f12449d

Please sign in to comment.