Skip to content

Commit

Permalink
去除无用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
liugaowei committed Oct 16, 2023
1 parent aaf2866 commit ce71f02
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 48 deletions.
2 changes: 1 addition & 1 deletion electron/utils/azure-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logger from "../utils/log";
var sdk = require("microsoft-cognitiveservices-speech-sdk");

const azureApi = (ssml: string, key: string, region: string) => {
var sdk = require("microsoft-cognitiveservices-speech-sdk");
const speechConfig = sdk.SpeechConfig.fromSubscription(key, region);
speechConfig.setProperty(sdk.PropertyId.SpeechServiceResponse_RequestSentenceBoundary, "true");
var audio_config = sdk.AudioConfig.fromDefaultSpeakerOutput();
Expand Down
62 changes: 17 additions & 45 deletions src/components/configpage/ConfigPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ const openFolderSelector = async () => {
}
};
const successMessage = () => {
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。",
type: "success",
duration: 2000,
});
};
const handleDelete = (index: any, row: any) => {
delete config.value.formConfigJson[row.tagName];
store.set("FormConfig", config.value.formConfigJson);
Expand Down Expand Up @@ -202,89 +210,53 @@ const openLogFolder = () => {
const savePathConfig = () => {
ttsStore.setSavePath();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。",
type: "success",
duration: 2000,
});
successMessage();
};
const auditionConfig = () => {
ttsStore.setAuditionConfig();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。",
type: "success",
duration: 2000,
});
successMessage();
};
const switchChange = () => {
ttsStore.setAutoPlay();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
const updateNotificationChange = () => {
ttsStore.updateNotificationChange();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
const updateTitleStyle = () => {
ttsStore.updateTitleStyle();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
const setSpeechKey = () => {
ttsStore.setSpeechKey();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
const setServiceRegion = () => {
ttsStore.setServiceRegion();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
const setRetryCount = () => {
if (config.value.retryCount == '' || config.value.retryCount < 0) {
config.value.retryCount = 1;
}
ttsStore.setRetryCount();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
const setRetryInterval = () => {
if (config.value.retryInterval== '' || config.value.retryInterval < 0) {
config.value.retryInterval = 0;
}
ttsStore.setRetryInterval();
ElMessage({
message: "保存成功,请点击“刷新配置”立即应用。。",
type: "success",
duration: 2000,
});
successMessage();
};
</script>

Expand Down
2 changes: 0 additions & 2 deletions src/store/play.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const axios = require("axios");

const { ipcRenderer } = require("electron");

async function getTTSData(
Expand Down

0 comments on commit ce71f02

Please sign in to comment.