mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
启用订阅缓存,大幅减少浏览器响应延迟
This commit is contained in:
@@ -32,11 +32,34 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {axios} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "ProxyList",
|
||||
props: ['proxies'],
|
||||
props: ['url'],
|
||||
data: function (){
|
||||
return {
|
||||
proxies: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
axios.post(`/refresh`, {url: this.url}).then(() => {
|
||||
this.fetch();
|
||||
})
|
||||
},
|
||||
|
||||
fetch() {
|
||||
axios.get(this.url).then(resp => {
|
||||
const {data} = resp;
|
||||
this.proxies = data.split("\n").map(p => JSON.parse(p));
|
||||
}).catch(err => {
|
||||
this.$store.commit("SET_ERROR_MESSAGE", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetch();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user