feat: 更新版本至 0.0.61,重构登录缓存逻辑,添加浏览器缓存支持
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user