feat: update login handling and redirect logic

This commit is contained in:
2026-02-24 04:31:39 +08:00
parent 9107aa3d7e
commit 420d525393
3 changed files with 11 additions and 20 deletions

View File

@@ -17,7 +17,8 @@ export const redirectHome = () => {
if (redirect) {
setTimeout(() => {
const href = decodeURIComponent(redirect);
window.open(href, '_self');
// window.open(href, '_self');
console.log('重定向到:', href);
}, 2000);
return;
}

View File

@@ -1,5 +1,5 @@
import QRCode, { QRCodeToDataURLOptions } from 'qrcode';
import { redirectHome } from '../login-handle.ts';
import { logginSuccess } from '../login-handle.ts';
import { query } from '../query.ts';
export const useCreateLoginQRCode = (el?: HTMLCanvasElement) => {
var opts: QRCodeToDataURLOptions = {
@@ -27,9 +27,7 @@ export const useCreateLoginQRCode = (el?: HTMLCanvasElement) => {
await query.setLoginToken(token);
}
clear();
setTimeout(() => {
redirectHome();
}, 1000);
logginSuccess();
} else {
timer = setTimeout(() => {
checkLogin(state);