mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-11-22 12:15:54 +08:00
fix(request): cross domain api issue (#2026)
Fix the issue when NCMapi is not under the same domain as the one frontend uses. The original method using Vercel to proxy requests may cause latency under some circumstances.
This commit is contained in:
parent
8a50337854
commit
65f5df8a60
|
@ -23,7 +23,11 @@ const service = axios.create({
|
|||
service.interceptors.request.use(function (config) {
|
||||
if (!config.params) config.params = {};
|
||||
if (baseURL.length) {
|
||||
if (baseURL[0] !== '/' && !process.env.IS_ELECTRON) {
|
||||
if (
|
||||
baseURL[0] !== '/' &&
|
||||
!process.env.IS_ELECTRON &&
|
||||
getCookie('MUSIC_U') !== null
|
||||
) {
|
||||
config.params.cookie = `MUSIC_U=${getCookie('MUSIC_U')};`;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -275,7 +275,7 @@ export default {
|
|||
clearInterval(this.qrCodeCheckInterval);
|
||||
this.qrCodeInformation = '登录成功,请稍等...';
|
||||
result.code = 200;
|
||||
result.cookie = result.cookie.replace('HTTPOnly', '');
|
||||
result.cookie = result.cookie.replaceAll(' HTTPOnly', '');
|
||||
this.handleLoginResponse(result);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user