feat: 接入真实登录鉴权流程

This commit is contained in:
湛兮
2026-05-26 14:45:15 +08:00
parent a6c9f5dee3
commit 5003628017
21 changed files with 572 additions and 305 deletions
+2 -1
View File
@@ -12,7 +12,7 @@ import { subBefore, getQueryMap } from "@pureadmin/utils";
*/
(function () {
// 获取 url 中的参数
const params = getQueryMap(location.href) as DataInfo<Date>;
const params = getQueryMap(location.href) as unknown as DataInfo<number>;
const must = ["username", "roles", "accessToken"];
const mustLength = must.length;
if (Object.keys(params).length !== mustLength) return;
@@ -37,6 +37,7 @@ import { subBefore, getQueryMap } from "@pureadmin/utils";
removeToken();
// 保存新信息到本地
params.expires = Number(params.expires) || Date.now() + 2 * 60 * 60 * 1000;
setToken(params);
// 删除不需要显示在 url 的参数