feat: 更新版本至 0.0.61,重构登录缓存逻辑,添加浏览器缓存支持

This commit is contained in:
2026-03-05 21:53:42 +08:00
parent b32e622707
commit 27503bf4a7
8 changed files with 217 additions and 23 deletions

View File

@@ -17,12 +17,16 @@ export const initApi = async (opts: {
const token = opts?.token;
const query = item?.api?.query || new Query({ url: item?.api?.url || '/api/router' })
const res = await query.post<{ list: RouterItem[] }>({ path: "router", key: 'list', token: token });
if (item) {
item.routerStatus = res?.code === 200 ? 'active' : 'error';
}
if (res.code !== 200) {
return {
code: res.code,
message: `初始化路由失败: ${res.message}, url: ${query.url}`
}
}
let _list = res.data?.list || []
if (opts?.exclude) {
if (opts?.exclude) {