|
@@ -23,7 +23,6 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
- <!--TODO 字典展示-->
|
|
|
|
|
<div style="white-space: pre-wrap;">{{ res }}</div>
|
|
<div style="white-space: pre-wrap;">{{ res }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -36,6 +35,7 @@
|
|
|
import LanguageIcon from "@/components/languageIcon/languageIcon.vue";
|
|
import LanguageIcon from "@/components/languageIcon/languageIcon.vue";
|
|
|
import {Search} from '@element-plus/icons-vue';
|
|
import {Search} from '@element-plus/icons-vue';
|
|
|
import type {IDialogue} from "@/types/dialogue";
|
|
import type {IDialogue} from "@/types/dialogue";
|
|
|
|
|
+ import {ElMessage} from "element-plus";
|
|
|
|
|
|
|
|
const apis = useApis()
|
|
const apis = useApis()
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
@@ -104,9 +104,13 @@
|
|
|
|
|
|
|
|
apis.requestAI("6718dffaee5b2137080707f5", "ChatGLM4", requestBody)
|
|
apis.requestAI("6718dffaee5b2137080707f5", "ChatGLM4", requestBody)
|
|
|
.then((_res:any) => {
|
|
.then((_res:any) => {
|
|
|
- let translation = _res.data.data.content;
|
|
|
|
|
- console.log(translation)
|
|
|
|
|
- res.value = translation
|
|
|
|
|
|
|
+ if(_res.data.code == 500){
|
|
|
|
|
+ ElMessage.error("翻译请求超时")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let translation = _res.data.data.content;
|
|
|
|
|
+ console.log(translation)
|
|
|
|
|
+ res.value = translation
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
.catch((_err:any) => {
|
|
.catch((_err:any) => {
|
|
|
console.log(_err);
|
|
console.log(_err);
|