Use UTF-8 safe return-to encoding and decoding across router and login

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
2026-03-08 19:35:40 +08:00
parent 28464214bc
commit 28fd83242c
5 changed files with 58 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import { defineStore } from "pinia";
import axios from "axios";
import apiClient from "@/api/client.js";
import apiError from "@/module/apiError.js";
import { decodeReturnTo } from "@/utils/returnToEncoding";
import {
deleteCookie,
setCookie,
@@ -73,7 +74,7 @@ export const useLoginStore = defineStore("loginStore", {
if (this.rememberedReturnToUrl !== "") {
let decodedUrl = "";
try {
decodedUrl = atob(this.rememberedReturnToUrl);
decodedUrl = decodeReturnTo(this.rememberedReturnToUrl);
} catch {
this.$router.push("/files");
return;