支持配置Gist同步

This commit is contained in:
Peng-YM
2020-09-24 14:59:14 +08:00
parent 8bae8e0ac5
commit 6d76cda39b
3 changed files with 207 additions and 17 deletions

View File

@@ -125,10 +125,12 @@ export default {
async fetch() {
await axios.get(this.url).then(resp => {
let {data} = resp;
if (data instanceof String && data.indexOf("\n") !== -1)
if ((typeof data === 'string' || data instanceof String) && data.indexOf("\n") !== -1){
this.proxies = data.split("\n").map(p => JSON.parse(p));
else
}
else {
this.proxies = [data];
}
}).catch(err => {
this.$store.commit("SET_ERROR_MESSAGE", err);
});