mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-02-02 19:20:47 +08:00
fix(electron): login issue after restart app
This commit is contained in:
parent
b7f51f02c2
commit
870e0a4e9e
|
@ -1,4 +1,4 @@
|
|||
VUE_APP_NETEASE_API_URL=http://127.0.0.1:3000
|
||||
VUE_APP_ELECTRON_API_URL=http://127.0.0.1:10754
|
||||
VUE_APP_ELECTRON_API_URL=/api
|
||||
VUE_APP_ENABLE_SENTRY=false
|
||||
DEV_SERVER_PORT=20201
|
|
@ -41,6 +41,7 @@
|
|||
"electron-updater": "^4.3.5",
|
||||
"express": "^4.17.1",
|
||||
"express-fileupload": "^1.2.0",
|
||||
"express-http-proxy": "^1.6.2",
|
||||
"extract-zip": "^2.0.1",
|
||||
"howler": "^2.2.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
|
|
|
@ -10,6 +10,7 @@ import { createDockMenu } from "./electron/dockMenu";
|
|||
import { createTray } from "./electron/tray.js";
|
||||
import { autoUpdater } from "electron-updater";
|
||||
import express from "express";
|
||||
import expressProxy from "express-http-proxy";
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV !== "production";
|
||||
|
||||
|
@ -50,6 +51,7 @@ function createWindow() {
|
|||
// win.loadURL("app://./index.html");
|
||||
const expressApp = express();
|
||||
expressApp.use("/", express.static(__dirname + "/"));
|
||||
expressApp.use("/api", expressProxy("http://127.0.0.1:10754"));
|
||||
expressApp.listen(27232);
|
||||
win.loadURL("http://localhost:27232");
|
||||
}
|
||||
|
|
|
@ -89,7 +89,6 @@ import { loginWithPhone, loginWithEmail } from "@/api/auth";
|
|||
import md5 from "crypto-js/md5";
|
||||
import { mapMutations } from "vuex";
|
||||
import { userPlaylist } from "@/api/user";
|
||||
import { getMusicU, setMusicU } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
|
@ -184,10 +183,6 @@ export default {
|
|||
this.processing = false;
|
||||
return;
|
||||
}
|
||||
// 获取接口返回的 MUSIC_U 写进本地 cookie 解决登录时跳转的问题
|
||||
// 但是仍然无法完全模拟登录状态,像喜欢歌曲和喜欢列表都会遇到 301 需要登录问题
|
||||
const MUSIC_U = getMusicU(data.cookie);
|
||||
setMusicU("MUSIC_U", MUSIC_U);
|
||||
if (data.code !== 502) {
|
||||
this.updateData({ key: "user", value: data.profile });
|
||||
this.afterLogin();
|
||||
|
|
20
yarn.lock
20
yarn.lock
|
@ -3905,6 +3905,13 @@ debug@4, debug@^4.0.1:
|
|||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
debug@^3.0.1:
|
||||
version "3.2.7"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
||||
integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@^3.1.1, debug@^3.2.5:
|
||||
version "3.2.6"
|
||||
resolved "https://registry.npm.taobao.org/debug/download/debug-3.2.6.tgz?cache=0&sync_timestamp=1600502894812&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||
|
@ -4564,7 +4571,7 @@ es6-error@^4.1.1:
|
|||
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
|
||||
integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==
|
||||
|
||||
es6-promise@^4.0.3:
|
||||
es6-promise@^4.0.3, es6-promise@^4.1.1:
|
||||
version "4.2.8"
|
||||
resolved "https://registry.npm.taobao.org/es6-promise/download/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
|
||||
integrity sha1-TrIVlMlyvEBVPSduUQU5FD21Pgo=
|
||||
|
@ -4862,6 +4869,15 @@ express-fileupload@^1.2.0:
|
|||
dependencies:
|
||||
busboy "^0.3.1"
|
||||
|
||||
express-http-proxy@^1.6.2:
|
||||
version "1.6.2"
|
||||
resolved "https://registry.yarnpkg.com/express-http-proxy/-/express-http-proxy-1.6.2.tgz#e87152e45958cee4b91da2fdaa20a1ffd581204a"
|
||||
integrity sha512-soP7UXySFdLbeeMYL1foBkEoZj6HELq9BDAOCr1sLRpqjPaFruN5o6+bZeC+7U4USWIl4JMKEiIvTeKJ2WQdlQ==
|
||||
dependencies:
|
||||
debug "^3.0.1"
|
||||
es6-promise "^4.1.1"
|
||||
raw-body "^2.3.0"
|
||||
|
||||
express@^4.16.3, express@^4.17.1:
|
||||
version "4.17.1"
|
||||
resolved "https://registry.npm.taobao.org/express/download/express-4.17.1.tgz?cache=0&sync_timestamp=1589682766604&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpress%2Fdownload%2Fexpress-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134"
|
||||
|
@ -8981,7 +8997,7 @@ raw-body@2.4.0:
|
|||
iconv-lite "0.4.24"
|
||||
unpipe "1.0.0"
|
||||
|
||||
raw-body@^2.2.0:
|
||||
raw-body@^2.2.0, raw-body@^2.3.0:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.npm.taobao.org/raw-body/download/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c"
|
||||
integrity sha1-MKyC+Yu1rowVLmcUnayNVRU7Fow=
|
||||
|
|
Loading…
Reference in New Issue
Block a user