From 2b3e3cc87124112bf4616fd79159a2b85423a0f2 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Mon, 10 Apr 2023 17:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20fix(login):=20=E5=88=9D=E6=AD=A5?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=20login=5Fticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/main.rs | 4 ++-- src/pages/Config.vue | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index e058be65..a7b4de2b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -50,14 +50,14 @@ async fn mys_login(handle: AppHandle) { let mys_window = WindowBuilder::new( &handle, "mys-login", /* the unique window label */ - WindowUrl::External("https://bbs.mihoyo.com/ys/".parse().unwrap()), + WindowUrl::External("https://user.mihoyo.com".parse().unwrap()), ) .build() .unwrap(); // 执行 js 代码 let js_code = " const cookie = document.cookie; - if(cookie == null || cookie == ''){ + if(cookie === null || cookie.includes('login_ticket') === false) { alert('请在该网页登录后关闭窗口再试'); } else { fetch('http://localhost:8000/login?cookie=' + cookie); diff --git a/src/pages/Config.vue b/src/pages/Config.vue index 0752d887..e6f008f0 100644 --- a/src/pages/Config.vue +++ b/src/pages/Config.vue @@ -106,7 +106,7 @@ 重新获取 Cookie