mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
feat(utils/request): override realIP param with env var (#1514)
This commit is contained in:
parent
af0a997609
commit
16b525915e
1 changed files with 6 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios';
|
|
||||||
import { getCookie, doLogout } from '@/utils/auth';
|
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
|
import { doLogout, getCookie } from '@/utils/auth';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
let baseURL = '';
|
let baseURL = '';
|
||||||
// Web 和 Electron 跑在不同端口避免同时启动时冲突
|
// Web 和 Electron 跑在不同端口避免同时启动时冲突
|
||||||
|
|
@ -34,6 +34,10 @@ service.interceptors.request.use(function (config) {
|
||||||
config.params.realIP = '211.161.244.70';
|
config.params.realIP = '211.161.244.70';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.VUE_APP_REAL_IP) {
|
||||||
|
config.params.realIP = process.env.VUE_APP_REAL_IP;
|
||||||
|
}
|
||||||
|
|
||||||
const proxy = JSON.parse(localStorage.getItem('settings')).proxyConfig;
|
const proxy = JSON.parse(localStorage.getItem('settings')).proxyConfig;
|
||||||
if (['HTTP', 'HTTPS'].includes(proxy.protocol)) {
|
if (['HTTP', 'HTTPS'].includes(proxy.protocol)) {
|
||||||
config.params.proxy = `${proxy.protocol}://${proxy.server}:${proxy.port}`;
|
config.params.proxy = `${proxy.protocol}://${proxy.server}:${proxy.port}`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue