master
qier222 3 years ago
parent e96e93f965
commit 060569ee92
No known key found for this signature in database
GPG Key ID: 9C85007ED905F14D

3
.gitignore vendored

@ -28,3 +28,6 @@ pnpm-debug.log*
/dist_electron
NeteaseCloudMusicApi-master
NeteaseCloudMusicApi-master.zip
# Local Netlify folder
.netlify

@ -5,7 +5,7 @@ import store from '@/store';
export function doLogout() {
logout();
// 网易云的接口会自动移除该 cookies
// Cookies.remove("MUSIC_U");
Cookies.remove('MUSIC_U');
// 更新状态仓库中的用户信息
store.commit('updateData', { key: 'user', value: {} });
// 更新状态仓库中的登录状态

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

@ -72,7 +72,6 @@
import { toplists, recommendPlaylist } from '@/api/playlist';
import { toplistOfArtists } from '@/api/artist';
import { byAppleMusic } from '@/utils/staticData';
import { countDBSize } from '@/utils/db';
import { newAlbums } from '@/api/album';
import NProgress from 'nprogress';
import { mapState } from 'vuex';
@ -152,7 +151,6 @@ export default {
this.topList.ids.includes(l.id)
);
});
countDBSize();
this.$refs.DailyTracksCard.loadDailyTracks();
},
},

@ -87,15 +87,17 @@
</button>
</div>
<div class="other-login">
<a v-show="mode !== 'email'" @click="mode = 'email'">{{
<a v-show="mode !== 'email'" @click="changeMode('email')">{{
$t('login.loginWithEmail')
}}</a>
<span v-show="mode === 'qrCode'">|</span>
<a v-show="mode !== 'phone'" @click="mode = 'phone'">{{
<a v-show="mode !== 'phone'" @click="changeMode('phone')">{{
$t('login.loginWithPhone')
}}</a>
<span v-show="mode !== 'qrCode'">|</span>
<a v-show="mode !== 'qrCode'" @click="mode = 'qrCode'"> </a>
<a v-show="mode !== 'qrCode'" @click="changeMode('qrCode')">
二维码登录
</a>
</div>
<div
v-show="mode !== 'qrCode'"
@ -263,6 +265,8 @@ export default {
this.qrCodeInformation = '二维码已失效,请重新扫码';
} else if (result.code === 802) {
this.qrCodeInformation = '扫描成功,请在手机上确认登录';
} else if (result.code === 801) {
this.qrCodeInformation = '打开网易云音乐APP扫码登录';
} else if (result.code === 803) {
clearInterval(this.qrCodeCheckInterval);
this.qrCodeInformation = '登录成功,请稍等...';
@ -273,6 +277,14 @@ export default {
});
}, 1000);
},
changeMode(mode) {
this.mode = mode;
if (mode === 'qrCode') {
this.checkQrCodeLogin();
} else {
clearInterval(this.qrCodeCheckInterval);
}
},
},
};
</script>

Loading…
Cancel
Save