Skip to content

Commit

Permalink
2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeLyn committed Sep 23, 2023
1 parent 5ee1461 commit 5eac671
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
beforeCreate() {
const app = getCurrentInstance();
app.appContext.config.globalProperties.$http.defaults((config) => {
config.timeout = 5 * 1000;
config.timeout = 10 * 1000;
config.$on_before_request = () => {
//options.headers["Authorization"] = "Bearer " + localStorage.getItem("access_token");
};
Expand Down
11 changes: 8 additions & 3 deletions src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</el-form-item>
<el-divider> Google翻译 </el-divider>
<el-form-item label="域名">
<el-select v-model="google.domain" style="width: 100%">
<el-select v-model="google.domain" style="width: 100%" :loading="loading">
<el-option label="https://translate.google.com" value="https://translate.google.com">
<div class="option-wrap">
<span>官方:https://translate.google.com</span>
Expand Down Expand Up @@ -48,6 +48,7 @@ export default {
name: "settings",
data() {
return {
loading: true,
google_proxy_domains: [
{
domain: "https://translate.amz.wang",
Expand Down Expand Up @@ -101,7 +102,8 @@ export default {
// }
// });
this.$http
.get("https://raw.githubusercontent.com/ZeeLyn/Translate.Desktop/main/google_proxy_domains.json", {
.get("https://raw.githubusercontent.com/ZeeLyn/Translate.Desktop/main/src/google_proxy_domains.json", {
timeout: 20 * 1000,
$400: null,
$401: null,
$403: null,
Expand All @@ -113,7 +115,10 @@ export default {
this.google_proxy_domains = res.data;
this.ping();
})
.catch(() => {});
.catch(() => {})
.finally(() => {
this.loading = false;
});
},
methods: {
ping() {
Expand Down
20 changes: 4 additions & 16 deletions src/google_proxy_domains.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
[
{
"domain": "https://translate.amz.wang",
"status": 0
},
{
"domain": "https://translate.3822808.com",
"status": 0
},
{
"domain": "https://gt.cky.codes",
"status": 0
},
{
"domain": "https://gtranslate.cdn.haah.net",
"status": 0
}
"https://translate.amz.wang",
"https://translate.3822808.com",
"https://gt.cky.codes",
"https://gtranslate.cdn.haah.net"
]

0 comments on commit 5eac671

Please sign in to comment.