Refactor network and ProxyStrategy code
This commit is contained in:
@@ -5,9 +5,9 @@ import ProxyStrategy from "./strategies/ProxyStrategy";
|
|||||||
const sendNetworkRequest = (req, store) => {
|
const sendNetworkRequest = (req, store) => {
|
||||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||||
return ProxyStrategy(req, store);
|
return ProxyStrategy(req, store);
|
||||||
} else {
|
}
|
||||||
return AxiosStrategy(req, store);
|
|
||||||
}
|
return AxiosStrategy(req, store);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { sendNetworkRequest };
|
export { sendNetworkRequest };
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const proxyStrategy = async (req, store) => {
|
const proxyStrategy = async (req, store) => {
|
||||||
const proxyRes = await axios.post(
|
const { data } = await axios.post(
|
||||||
store.state.postwoman.settings.PROXY_URL ||
|
store.state.postwoman.settings.PROXY_URL ||
|
||||||
"https://postwoman.apollotv.xyz/",
|
"https://postwoman.apollotv.xyz/",
|
||||||
req
|
req
|
||||||
);
|
);
|
||||||
|
|
||||||
return proxyRes.data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default proxyStrategy;
|
export default proxyStrategy;
|
||||||
|
|||||||
Reference in New Issue
Block a user