feat: update login handling and redirect logic

This commit is contained in:
abearxiong committed 2026-02-24 04:31:39 +08:00
1 parent 9107aa3d7e
commit 420d525393
3 files changed
+11 -20

No files matched your search

+2 -1
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;
}
+2 -4
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);