Skip to content

Commit

Permalink
免责声明
Browse files Browse the repository at this point in the history
  • Loading branch information
liugaowei committed Jul 27, 2023
1 parent cbb2782 commit 7c30e7f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Footer from "./components/footer/Footer.vue";
const ttsStore = useTtsStore();
ttsStore.genFormConfig();
ttsStore.setSSMLValue();
ttsStore.showDisclaimers();
</script>

<template>
Expand Down
3 changes: 1 addition & 2 deletions src/components/main/MainOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
v-model="currConfigName"
placeholder="选择配置"
filterable
:options="config.configLable"
:options="config.configLabel"
@change="configChange"
></el-select-v2>
</div>
Expand Down Expand Up @@ -398,7 +398,6 @@ const startBtn = () => {
font-weight: bold;
}
/* From uiverse.io by @Zena4L */
.startBtn {
margin-bottom: 0 !important;
flex: 1;
Expand Down
3 changes: 3 additions & 0 deletions src/global/initLocalStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ export default async function initStore() {
if (!store.has("serviceRegion")) {
store.set("serviceRegion", "");
}
if (!store.has("disclaimers")) {
store.set("disclaimers", false);
}
}
22 changes: 19 additions & 3 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { defineStore } from "pinia";
import getTTSData from "./play";
import { ElMessage } from "element-plus";
import { ElMessage, ElMessageBox } from "element-plus";
import { h } from "vue";
const fs = require("fs");
const path = require("path");
Expand All @@ -29,7 +29,7 @@ export const useTtsStore = defineStore("ttsStore", {
config: {
formConfigJson: store.get("FormConfig"),
formConfigList: <any>[],
configLable: <any>[],
configLabel: <any>[],
savePath: store.get("savePath"),
audition: store.get("audition"),
autoplay: store.get("autoplay"),
Expand All @@ -38,6 +38,7 @@ export const useTtsStore = defineStore("ttsStore", {
api: store.get("api"),
speechKey: store.get("speechKey"),
serviceRegion: store.get("serviceRegion"),
disclaimers: store.get("disclaimers"),
},
isLoading: false,
currMp3Buffer: Buffer.alloc(0),
Expand Down Expand Up @@ -111,7 +112,7 @@ export const useTtsStore = defineStore("ttsStore", {
content: this.config.formConfigJson[item],
})
);
this.config.configLable = Object.keys(this.config.formConfigJson).map(
this.config.configLabel = Object.keys(this.config.formConfigJson).map(
(item) => ({
value: item,
label: item,
Expand Down Expand Up @@ -444,5 +445,20 @@ export const useTtsStore = defineStore("ttsStore", {
showItemInFolder(filePath: string) {
ipcRenderer.send("showItemInFolder", filePath);
},
showDisclaimers() {
if (!this.config.disclaimers) {
ElMessageBox.confirm(
'该软件以及代码仅为个人学习测试使用,请在下载后24小时内删除,不得用于商业用途,否则后果自负。任何违规使用造成的法律后果与本人无关。该软件也永远不会收费,如果您使用该软件前支付了额外费用,或付费获得源码以及成品软件,那么你一定被骗了!',
'注意!',
{
confirmButtonText: '我已确认,不再弹出',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
store.set('disclaimers', true)
})
}
}
},
});

0 comments on commit 7c30e7f

Please sign in to comment.