Fixed cronSyncArtifact failed issue

This commit is contained in:
Peng-YM
2022-05-18 11:06:40 +08:00
parent 5954ff0a58
commit 48d533af83
4 changed files with 120 additions and 149 deletions

View File

@@ -108,31 +108,31 @@ export default {
}
},
methods: {
async refresh() {
await axios.post(`/utils/refresh`, {url: this.sub});
await this.fetch();
},
async fetch() {
await axios.get(this.raw ? `${this.url}?raw=true` : this.url).then(resp => {
let {data} = resp;
// eslint-disable-next-line no-debugger
this.proxies = data;
}).catch(err => {
this.$store.commit("SET_ERROR_MESSAGE", err);
});
try {
this.$store.commit("SET_LOADING", true);
await axios.get(this.raw ? `${this.url}?raw=true` : this.url).then(resp => {
let {data} = resp;
// eslint-disable-next-line no-debugger
this.proxies = data;
}).catch(err => {
this.$store.commit("SET_ERROR_MESSAGE", err);
});
await axios.get(this.raw ? `${this.url}?target=URI&raw=true` : `${this.url}?target=URI`).then(resp => {
const {data} = resp;
this.uris = data.split("\n");
});
await axios.get(this.raw ? `${this.url}?target=URI&raw=true` : `${this.url}?target=URI`).then(resp => {
const {data} = resp;
this.uris = data.split("\n");
});
// fix http offset
this.proxies.forEach((p, idx) => {
if (p.type === 'http') {
this.uris.splice(idx, 0, null);
}
})
// fix http offset
this.proxies.forEach((p, idx) => {
if (p.type === 'http') {
this.uris.splice(idx, 0, null);
}
})
} finally {
this.$store.commit("SET_LOADING", false);
}
},
async showInfo(idx) {