fix: proxy issue

This commit is contained in:
qier222 2021-05-17 19:04:14 +08:00
parent cc6b364b87
commit 5b6619d1de
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
4 changed files with 17 additions and 2 deletions

View file

@ -24,6 +24,12 @@ service.interceptors.request.use(function (config) {
if (baseURL[0] !== '/' && !process.env.IS_ELECTRON) {
config.params.cookie = `MUSIC_U=${Cookies.get('MUSIC_U')};`;
}
const proxy = JSON.parse(localStorage.getItem('settings')).proxyConfig;
if (['HTTP', 'HTTPS'].includes(proxy.protocol)) {
config.params.proxy = `${proxy.protocol}://${proxy.server}:${proxy.port}`;
}
return config;
});